crux_structs v0.2.3 Crux.Structs.Message View Source
Represents a Discord Message Object.
Differences opposed to the Discord API Object:
:mentionsis a MapSet of user ids
Link to this section Summary
Types
All available types that can be resolved into a message id.
message_idisnilfor the initial message sent when a user starts following a channel.guild_idis onlynilfor some messages during the initial rollout of this feature.
Functions
Creates a t:Crux.Structs.Message.t/0 struct from raw data.
Link to this section Types
Specs
id_resolvable() :: Crux.Structs.Message.t() | Crux.Structs.Snowflake.t() | String.t()
All available types that can be resolved into a message id.
Specs
mention_channel() :: %{
id: Crux.Structs.Snowflake.t(),
guild_id: Crux.Structs.Snowflake.t(),
name: String.t(),
type: non_neg_integer()
}
Specs
Specs
message_application() :: %{
id: Crux.Structs.Snowflake.t(),
primary_sku_id: Crux.Structs.Snowflake.t() | nil,
cover_image: String.t() | nil,
description: String.t(),
icon: String.t() | nil,
name: String.t()
}
Specs
message_reference() :: %{
message_id: Crux.Structs.Snowflake.t() | nil,
guild_id: Crux.Structs.Snowflake.t() | nil,
channel_id: Crux.Structs.Snowflake.t()
}
message_idisnilfor the initial message sent when a user starts following a channel.guild_idis onlynilfor some messages during the initial rollout of this feature.
Specs
t() :: %Crux.Structs.Message{
activity: message_activity() | nil,
application: message_application() | nil,
attachments: [Crux.Structs.Attachment.t()],
author: Crux.Structs.User.t(),
channel_id: Crux.Structs.Snowflake.t(),
content: String.t(),
edited_timestamp: String.t(),
embeds: [Crux.Structs.Embed.t()],
flags: Crux.Structs.Message.Flags.raw(),
guild_id: Crux.Structs.Snowflake.t() | nil,
id: Crux.Structs.Snowflake.t(),
member: Crux.Structs.Member.t() | nil,
mention_channels: [mention_channel()],
mention_everyone: boolean(),
mention_roles: MapSet.t(Crux.Structs.Snowflake.t()),
mentions: MapSet.t(Crux.Structs.Snowflake.t()),
message_reference: message_reference(),
nonce: String.t() | nil,
pinned: boolean(),
reactions: %{required(String.t()) => Crux.Structs.Reaction.t()},
timestamp: String.t(),
tts: boolean(),
type: integer(),
webhook_id: Crux.Structs.Snowflake.t() | nil
}
Link to this section Functions
Specs
Creates a t:Crux.Structs.Message.t/0 struct from raw data.
Automatically invoked by
Crux.Structs.create/2.