Messages::CachedMessage
Inherits BSON::Serializable < Struct < Value < Object
Constructors
new(id : Discord::Snowflake, channel_id : Discord::Snowflake, author : Discord::Snowflake, timestamp : Time, content : String, attachments : Array(Messages::Attachment))
Sourcenew(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 methods
Instance methods
attachments
Sourceattachments=(attachments : Array(Attachment))
Sourceauthor
Sourceauthor!
Sourceauthor=(author : Int64)
Sourcechannel_id
Sourcechannel_id!
Sourcechannel_id=(channel_id : Int64)
Sourcecontent
Sourcecontent=(content : String)
Sourceid
Sourceid!
Sourceid=(id : Int64)
Sourcetimestamp
Sourcetimestamp=(timestamp : Time)
Sourceto_bson(bson = BSON.new)
Converts to a BSON representation.
user = User.new name: "John"
bson = user.to_bson