struct Messages::CachedMessage
- Messages::CachedMessage
- Struct
- Value
- Object
Included Modules
- BSON::Serializable
Defined in:
messages.crConstructors
- .new(id : Discord::Snowflake, channel_id : Discord::Snowflake, author : Discord::Snowflake, timestamp : Time, content : String, attachments : Array(Messages::Attachment))
-
.new(bson : BSON)
Allocate an instance and copies data from a BSON struct.
Class Method Summary
-
.from_bson(bson : BSON)
NOTE See
self.new
.
Instance Method Summary
- #attachments : Array(Attachment)
- #attachments=(attachments : Array(Attachment))
- #author : Int64
- #author!
- #author=(author : Int64)
- #channel_id : Int64
- #channel_id!
- #channel_id=(channel_id : Int64)
- #content : String
- #content=(content : String)
- #id : Int64
- #id!
- #id=(id : Int64)
- #timestamp : Time
- #timestamp=(timestamp : Time)
-
#to_bson(bson = BSON.new)
Converts to a BSON representation.
Constructor Detail
def self.new(id : Discord::Snowflake, channel_id : Discord::Snowflake, author : Discord::Snowflake, timestamp : Time, content : String, attachments : Array(Messages::Attachment))
#
def self.new(bson : BSON)
#
Allocate an instance and copies data from a BSON struct.
class User
include BSON::Serializable
property name : String
end
data = BSON.new
data["name"] = "John"
User.new(data)
Class Method Detail
Instance Method Detail
def to_bson(bson = BSON.new)
#
Converts to a BSON representation.
user = User.new name: "John"
bson = user.to_bson