struct

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))
Source
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)
Source

Class methods

from_bson(bson : BSON)

NOTE: See self.new.

Source

Instance methods

attachments
Source
attachments=(attachments : Array(Attachment))
Source
author
Source
author!
Source
author=(author : Int64)
Source
channel_id
Source
channel_id!
Source
channel_id=(channel_id : Int64)
Source
content
Source
content=(content : String)
Source
id=(id : Int64)
Source
timestamp
Source
timestamp=(timestamp : Time)
Source
to_bson(bson = BSON.new)

Converts to a BSON representation.

user = User.new name: "John"
bson = user.to_bson
Source