crux_structs v0.2.2 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 Crux.Structs.Message.t/0 struct from raw data.
Link to this section Types
Link to this type
id_resolvable()
View Source
(since 0.2.1)
id_resolvable()
View Source
(since 0.2.1)
id_resolvable() ::
Crux.Structs.Message.t() | Crux.Structs.Snowflake.t() | String.t()
id_resolvable() :: Crux.Structs.Message.t() | Crux.Structs.Snowflake.t() | String.t()
All available types that can be resolved into a message id.
Link to this type
mention_channel()
View Source
(since 0.2.1)
mention_channel()
View Source
(since 0.2.1)
mention_channel() :: %{
id: Crux.Structs.Snowflake.t(),
guild_id: Crux.Structs.Snowflake.t(),
name: String.t(),
type: non_neg_integer()
}
mention_channel() :: %{
id: Crux.Structs.Snowflake.t(),
guild_id: Crux.Structs.Snowflake.t(),
name: String.t(),
type: non_neg_integer()
}
Link to this type
message_activity() View Source (since 0.2.1)
Link to this type
message_application()
View Source
(since 0.2.1)
message_application()
View Source
(since 0.2.1)
message_application() :: %{
id: Crux.Structs.Snowflake.t(),
cover_image: String.t() | nil,
description: String.t(),
icon: String.t() | nil,
name: String.t()
}
message_application() :: %{
id: Crux.Structs.Snowflake.t(),
cover_image: String.t() | nil,
description: String.t(),
icon: String.t() | nil,
name: String.t()
}
Link to this type
message_reference()
View Source
(since 0.2.1)
message_reference()
View Source
(since 0.2.1)
message_reference() :: %{
message_id: Crux.Structs.Snowflake.t() | nil,
guild_id: Crux.Structs.Snowflake.t() | nil,
channel_id: Crux.Structs.Snowflake.t()
}
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.
Link to this type
t()
View Source
(since 0.1.0)
t()
View Source
(since 0.1.0)
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: non_neg_integer(),
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
}
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: non_neg_integer(),
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
Link to this function
create(data) View Source (since 0.1.0)
Creates a Crux.Structs.Message.t/0 struct from raw data.
Automatically invoked by
Crux.Structs.create/2.