grom/message
Types
pub type ChannelMention {
TextChannelMention(
channel_id: String,
guild_id: String,
channel_name: String,
)
VoiceChannelMention(
channel_id: String,
guild_id: String,
channel_name: String,
)
CategoryChannelMention(
channel_id: String,
guild_id: String,
channel_name: String,
)
AnnouncementChannelMention(
channel_id: String,
guild_id: String,
channel_name: String,
)
AnnouncementThreadMention(
channel_id: String,
guild_id: String,
channel_name: String,
)
PublicThreadMention(
channel_id: String,
guild_id: String,
channel_name: String,
)
PrivateThreadMention(
channel_id: String,
guild_id: String,
channel_name: String,
)
StageChannelMention(
channel_id: String,
guild_id: String,
channel_name: String,
)
ForumChannelMention(
channel_id: String,
guild_id: String,
channel_name: String,
)
MediaChannelMention(
channel_id: String,
guild_id: String,
channel_name: String,
)
}
Constructors
-
TextChannelMention( channel_id: String, guild_id: String, channel_name: String, ) -
VoiceChannelMention( channel_id: String, guild_id: String, channel_name: String, ) -
CategoryChannelMention( channel_id: String, guild_id: String, channel_name: String, ) -
AnnouncementChannelMention( channel_id: String, guild_id: String, channel_name: String, ) -
AnnouncementThreadMention( channel_id: String, guild_id: String, channel_name: String, ) -
PublicThreadMention( channel_id: String, guild_id: String, channel_name: String, ) -
PrivateThreadMention( channel_id: String, guild_id: String, channel_name: String, ) -
StageChannelMention( channel_id: String, guild_id: String, channel_name: String, ) -
ForumChannelMention( channel_id: String, guild_id: String, channel_name: String, ) -
MediaChannelMention( channel_id: String, guild_id: String, channel_name: String, )
pub type Component {
ActionRow(action_row.ActionRow)
Section(section.Section)
TextDisplay(text_display.TextDisplay)
MediaGallery(media_gallery.MediaGallery)
File(file.File)
Separator(separator.Separator)
Container(container.Container)
}
Constructors
-
ActionRow(action_row.ActionRow) -
Section(section.Section) -
TextDisplay(text_display.TextDisplay) -
MediaGallery(media_gallery.MediaGallery) -
File(file.File) -
Separator(separator.Separator) -
Container(container.Container)
pub type Create {
Create(
content: option.Option(String),
nonce: option.Option(Nonce),
is_tts: option.Option(Bool),
embeds: option.Option(List(embed.Embed)),
allowed_mentions: option.Option(
allowed_mentions.AllowedMentions,
),
message_reference: option.Option(
message_reference.MessageReference,
),
components: option.Option(List(Component)),
sticker_ids: option.Option(List(String)),
files: option.Option(List(file.File)),
attachments: option.Option(List(attachment.Create)),
flags: option.Option(List(CreateFlag)),
enforce_nonce: option.Option(Bool),
poll: option.Option(poll.Create),
)
}
Constructors
-
Create( content: option.Option(String), nonce: option.Option(Nonce), is_tts: option.Option(Bool), embeds: option.Option(List(embed.Embed)), allowed_mentions: option.Option( allowed_mentions.AllowedMentions, ), message_reference: option.Option( message_reference.MessageReference, ), components: option.Option(List(Component)), sticker_ids: option.Option(List(String)), files: option.Option(List(file.File)), attachments: option.Option(List(attachment.Create)), flags: option.Option(List(CreateFlag)), enforce_nonce: option.Option(Bool), poll: option.Option(poll.Create), )
pub type CreateFlag {
CreateWithSuppressedEmbeds
CreateWithSuppressedNotifications
CreateAsVoiceMessage
CreateWithComponentsV2
}
Constructors
-
CreateWithSuppressedEmbeds -
CreateWithSuppressedNotifications -
CreateAsVoiceMessage -
CreateWithComponentsV2
pub type Flag {
Crossposted
IsCrosspost
SuppressEmbeds
SourceMessageDeleted
Urgent
HasThread
Ephemeral
Loading
FailedToMentionSomeRolesInThread
SuppressNotifications
IsVoiceMessage
HasSnapshot
IsComponentsV2
}
Constructors
-
Crossposted -
IsCrosspost -
SuppressEmbeds -
SourceMessageDeleted -
Urgent -
HasThread -
Ephemeral -
Loading -
FailedToMentionSomeRolesInThread -
SuppressNotifications -
IsVoiceMessage -
HasSnapshot -
IsComponentsV2
pub type GetReactionsQuery {
Type(reaction.Type)
AfterUserId(String)
Limit(Int)
}
Constructors
-
Type(reaction.Type) -
AfterUserId(String) -
Limit(Int)
pub type Message {
Message(
id: String,
channel_id: String,
author: user.User,
content: String,
sent_at: timestamp.Timestamp,
last_edited_at: option.Option(timestamp.Timestamp),
is_tts: Bool,
mentions_everyone: Bool,
mentions_users: List(user.User),
mentions_roles: List(String),
mentions_channels: option.Option(List(ChannelMention)),
attachments: List(attachment.Attachment),
embeds: List(embed.Embed),
reactions: option.Option(List(reaction.Reaction)),
nonce: option.Option(Nonce),
is_pinned: Bool,
webhook_id: option.Option(String),
type_: Type,
activity: option.Option(activity.Activity),
application: option.Option(application.Application),
application_id: option.Option(String),
flags: option.Option(List(Flag)),
reference: option.Option(message_reference.MessageReference),
snapshots: option.Option(List(Snapshot)),
refrenced_message: option.Option(Message),
interaction_metadata: option.Option(
interaction_metadata.InteractionMetadata,
),
thread: option.Option(thread.Thread),
components: option.Option(List(Component)),
sticker_items: option.Option(List(sticker.Item)),
position: option.Option(Int),
role_subscription_data: option.Option(RoleSubscriptionData),
resolved: option.Option(Resolved),
poll: option.Option(poll.Poll),
call: option.Option(call.Call),
)
}
Constructors
-
Message( id: String, channel_id: String, author: user.User, content: String, sent_at: timestamp.Timestamp, last_edited_at: option.Option(timestamp.Timestamp), is_tts: Bool, mentions_everyone: Bool, mentions_users: List(user.User), mentions_roles: List(String), mentions_channels: option.Option(List(ChannelMention)), attachments: List(attachment.Attachment), embeds: List(embed.Embed), reactions: option.Option(List(reaction.Reaction)), nonce: option.Option(Nonce), is_pinned: Bool, webhook_id: option.Option(String), type_: Type, activity: option.Option(activity.Activity), application: option.Option(application.Application), application_id: option.Option(String), flags: option.Option(List(Flag)), reference: option.Option(message_reference.MessageReference), snapshots: option.Option(List(Snapshot)), refrenced_message: option.Option(Message), interaction_metadata: option.Option( interaction_metadata.InteractionMetadata, ), thread: option.Option(thread.Thread), components: option.Option(List(Component)), sticker_items: option.Option(List(sticker.Item)), position: option.Option(Int), role_subscription_data: option.Option(RoleSubscriptionData), resolved: option.Option(Resolved), poll: option.Option(poll.Poll), call: option.Option(call.Call), )
pub type Modify {
Modify(
content: modification.Modification(String),
embeds: modification.Modification(List(embed.Embed)),
flags: modification.Modification(List(ModifyFlag)),
allowed_mentions: modification.Modification(
allowed_mentions.AllowedMentions,
),
components: modification.Modification(List(Component)),
files: modification.Modification(List(file.File)),
attachments: modification.Modification(List(ModifyAttachment)),
)
}
Constructors
-
Modify( content: modification.Modification(String), embeds: modification.Modification(List(embed.Embed)), flags: modification.Modification(List(ModifyFlag)), allowed_mentions: modification.Modification( allowed_mentions.AllowedMentions, ), components: modification.Modification(List(Component)), files: modification.Modification(List(file.File)), attachments: modification.Modification(List(ModifyAttachment)), )
pub type ModifyAttachment {
ExistingAttachment(id: String)
NewAttachment(attachment.Create)
}
Constructors
-
ExistingAttachment(id: String) -
NewAttachment(attachment.Create)
pub type ModifyFlag {
ModifyEmbedSuppression
ModifyUsingComponentsV2
}
Constructors
-
ModifyEmbedSuppression -
ModifyUsingComponentsV2
pub type Nonce {
IntNonce(Int)
StringNonce(String)
}
Constructors
-
IntNonce(Int) -
StringNonce(String)
pub type Resolved {
Resolved(
users: option.Option(dict.Dict(String, user.User)),
members: option.Option(
dict.Dict(String, guild_member.GuildMember),
),
roles: option.Option(dict.Dict(String, role.Role)),
channels: option.Option(dict.Dict(String, ResolvedChannel)),
messages: option.Option(dict.Dict(String, Message)),
attachments: option.Option(
dict.Dict(String, attachment.Attachment),
),
)
}
Constructors
-
Resolved( users: option.Option(dict.Dict(String, user.User)), members: option.Option( dict.Dict(String, guild_member.GuildMember), ), roles: option.Option(dict.Dict(String, role.Role)), channels: option.Option(dict.Dict(String, ResolvedChannel)), messages: option.Option(dict.Dict(String, Message)), attachments: option.Option( dict.Dict(String, attachment.Attachment), ), )
pub type ResolvedChannel {
ResolvedTextChannel(
id: String,
name: String,
current_user_permissions: List(permission.Permission),
)
ResolvedVoiceChannel(
id: String,
name: String,
current_user_permissions: List(permission.Permission),
)
ResolvedCategoryChannel(
id: String,
name: String,
current_user_permissions: List(permission.Permission),
)
ResolvedAnnouncementChannel(
id: String,
name: String,
current_user_permissions: List(permission.Permission),
)
ResolvedAnnouncementThread(
id: String,
name: String,
current_user_permissions: List(permission.Permission),
metadata: thread.Metadata,
parent_id: String,
)
ResolvedPublicThread(
id: String,
name: String,
current_user_permissions: List(permission.Permission),
metadata: thread.Metadata,
parent_id: String,
)
ResolvedPrivateThread(
id: String,
name: String,
current_user_permissions: List(permission.Permission),
metadata: thread.Metadata,
parent_id: String,
)
ResolvedStageChannel(
id: String,
name: String,
current_user_permissions: List(permission.Permission),
)
ResolvedForumChannel(
id: String,
name: String,
current_user_permissions: List(permission.Permission),
)
ResolvedMediaChannel(
id: String,
name: String,
current_user_permissions: List(permission.Permission),
)
}
Constructors
-
ResolvedTextChannel( id: String, name: String, current_user_permissions: List(permission.Permission), ) -
ResolvedVoiceChannel( id: String, name: String, current_user_permissions: List(permission.Permission), ) -
ResolvedCategoryChannel( id: String, name: String, current_user_permissions: List(permission.Permission), ) -
ResolvedAnnouncementChannel( id: String, name: String, current_user_permissions: List(permission.Permission), ) -
ResolvedAnnouncementThread( id: String, name: String, current_user_permissions: List(permission.Permission), metadata: thread.Metadata, parent_id: String, ) -
ResolvedPublicThread( id: String, name: String, current_user_permissions: List(permission.Permission), metadata: thread.Metadata, parent_id: String, ) -
ResolvedPrivateThread( id: String, name: String, current_user_permissions: List(permission.Permission), metadata: thread.Metadata, parent_id: String, ) -
ResolvedStageChannel( id: String, name: String, current_user_permissions: List(permission.Permission), ) -
ResolvedForumChannel( id: String, name: String, current_user_permissions: List(permission.Permission), ) -
ResolvedMediaChannel( id: String, name: String, current_user_permissions: List(permission.Permission), )
pub type RoleSubscriptionData {
RoleSubscriptionData(
role_subscription_listing_id: String,
tier_name: String,
total_months_subscribed: Int,
is_renewal: Bool,
)
}
Constructors
-
RoleSubscriptionData( role_subscription_listing_id: String, tier_name: String, total_months_subscribed: Int, is_renewal: Bool, )
pub type Snapshot {
Snapshot(
type_: Type,
content: String,
embeds: List(embed.Embed),
attachments: List(attachment.Attachment),
sent_at: timestamp.Timestamp,
last_edited_at: option.Option(timestamp.Timestamp),
flags: option.Option(List(Flag)),
mentions_users: List(user.User),
mentions_roles: List(String),
sticker_items: option.Option(List(sticker.Item)),
components: option.Option(List(Component)),
)
}
Constructors
-
Snapshot( type_: Type, content: String, embeds: List(embed.Embed), attachments: List(attachment.Attachment), sent_at: timestamp.Timestamp, last_edited_at: option.Option(timestamp.Timestamp), flags: option.Option(List(Flag)), mentions_users: List(user.User), mentions_roles: List(String), sticker_items: option.Option(List(sticker.Item)), components: option.Option(List(Component)), )
pub type StartThreadInForumOrMedia {
StartThreadInForumOrMedia(
name: String,
auto_archive_duration: option.Option(duration.Duration),
rate_limit_per_user: option.Option(duration.Duration),
message: StartThreadInForumOrMediaMessage,
applied_tags_ids: option.Option(List(String)),
files: option.Option(List(file.File)),
)
}
Constructors
-
StartThreadInForumOrMedia( name: String, auto_archive_duration: option.Option(duration.Duration), rate_limit_per_user: option.Option(duration.Duration), message: StartThreadInForumOrMediaMessage, applied_tags_ids: option.Option(List(String)), files: option.Option(List(file.File)), )
pub type StartThreadInForumOrMediaMessage {
StartThreadInForumOrMediaMessage(
content: option.Option(String),
embeds: option.Option(List(embed.Embed)),
allowed_mentions: option.Option(
allowed_mentions.AllowedMentions,
),
components: option.Option(List(Component)),
sticker_ids: option.Option(List(String)),
attachments: option.Option(List(attachment.Create)),
flags: option.Option(
List(StartThreadInForumOrMediaMessageFlag),
),
)
}
Constructors
-
StartThreadInForumOrMediaMessage( content: option.Option(String), embeds: option.Option(List(embed.Embed)), allowed_mentions: option.Option( allowed_mentions.AllowedMentions, ), components: option.Option(List(Component)), sticker_ids: option.Option(List(String)), attachments: option.Option(List(attachment.Create)), flags: option.Option(List(StartThreadInForumOrMediaMessageFlag)), )
pub type StartThreadInForumOrMediaMessageFlag {
StartThreadInForumOrMediaMessageWithSuppressedEmbeds
StartThreadInForumOrMediaMessageWithSuppressedNotifications
}
Constructors
-
StartThreadInForumOrMediaMessageWithSuppressedEmbeds -
StartThreadInForumOrMediaMessageWithSuppressedNotifications
pub type Type {
Default
RecipientAdd
RecipientRemove
Call
ChannelNameChange
ChannelIconChange
ChannelPinnedMessage
UserJoin
GuildBoost
GuildBoostTier1
GuildBoostTier2
GuildBoostTier3
ChannelFollowAdd
GuildDiscoveryDisqualified
GuildDiscoveryRequalified
GuildDiscoveryGracePeriodInitialWarning
GuildDiscoveryGracePeriodFinalWarning
ThreadCreated
Reply
ChatInputCommand
ThreadStarterMessage
GuildInviteReminder
ContextMenuCommand
AutoModerationAction
RoleSubscriptionPurchase
InteractionPremiumUpsell
StageStart
StageEnd
StageSpeaker
StageTopic
GuildApplicationPremiumSubscription
GuildIncidentAlertModeEnabled
GuildIncidentAlertModeDisabled
GuildIncidentReportRaid
GuildIncidentReportFalseAlarm
PurchaseNotification
PollResult
Unknown
}
Constructors
-
Default -
RecipientAdd -
RecipientRemove -
Call -
ChannelNameChange -
ChannelIconChange -
ChannelPinnedMessage -
UserJoin -
GuildBoost -
GuildBoostTier1 -
GuildBoostTier2 -
GuildBoostTier3 -
ChannelFollowAdd -
GuildDiscoveryDisqualified -
GuildDiscoveryRequalified -
GuildDiscoveryGracePeriodInitialWarning -
GuildDiscoveryGracePeriodFinalWarning -
ThreadCreated -
Reply -
ChatInputCommand -
ThreadStarterMessage -
GuildInviteReminder -
ContextMenuCommand -
AutoModerationAction -
RoleSubscriptionPurchase -
InteractionPremiumUpsell -
StageStart -
StageEnd -
StageSpeaker -
StageTopic -
GuildApplicationPremiumSubscription -
GuildIncidentAlertModeEnabled -
GuildIncidentAlertModeDisabled -
GuildIncidentReportRaid -
GuildIncidentReportFalseAlarm -
PurchaseNotification -
PollResult -
UnknownUsed as a workaround for undocumented message types.
Values
pub fn create(
client: grom.Client,
in channel_id: String,
using create: Create,
) -> Result(Message, grom.Error)
pub fn crosspost(
client: grom.Client,
from channel_id: String,
id message_id: String,
) -> Result(Message, grom.Error)
pub fn delete(
client: grom.Client,
in channel_id: String,
id message_id: String,
because reason: option.Option(String),
) -> Result(Nil, grom.Error)
pub fn delete_all_reactions(
client: grom.Client,
in channel_id: String,
from message_id: String,
) -> Result(Nil, grom.Error)
pub fn delete_all_reactions_for_emoji(
client: grom.Client,
in channel_id: String,
from message_id: String,
emoji emoji_id: String,
) -> Result(Nil, grom.Error)
pub fn end_poll(
client: grom.Client,
in channel_id: String,
id message_id: String,
) -> Result(Message, grom.Error)
pub fn get(
client: grom.Client,
in channel_id: String,
id message_id: String,
) -> Result(Message, grom.Error)
pub fn get_reactions(
client: grom.Client,
in channel_id: String,
on message_id: String,
emoji emoji_id: String,
using query: List(GetReactionsQuery),
) -> Result(List(user.User), grom.Error)
pub fn modify(
client: grom.Client,
in channel_id: String,
id message_id: String,
using modify: Modify,
) -> Result(Message, grom.Error)
pub fn new_create() -> Create
pub fn new_modify() -> Modify
pub fn new_start_thread_in_forum_or_media(
name: String,
message: StartThreadInForumOrMediaMessage,
) -> StartThreadInForumOrMedia
pub fn new_start_thread_in_forum_or_media_message() -> StartThreadInForumOrMediaMessage
pub fn pin(
client: grom.Client,
in channel_id: String,
id message_id: String,
reason reason: option.Option(String),
) -> Result(Nil, grom.Error)
pub fn start_thread_in_forum_or_media(
client: grom.Client,
in channel_id: String,
with start_thread: StartThreadInForumOrMedia,
because reason: option.Option(String),
) -> Result(thread.Thread, grom.Error)
pub fn unpin(
client: grom.Client,
from channel_id: String,
id message_id: String,
reason reason: option.Option(String),
) -> Result(Nil, grom.Error)