grom/gateway
Types
pub type AllShardsReadyMessage {
AllShardsReadyMessage(
api_version: Int,
user: user.User,
guilds: List(guild.UnavailableGuild),
application: ReadyApplication,
shard_count: Int,
)
}
Constructors
-
AllShardsReadyMessage( api_version: Int, user: user.User, guilds: List(guild.UnavailableGuild), application: ReadyApplication, shard_count: Int, )
pub type AuditLogEntryCreatedMessage {
AuditLogEntryCreatedMessage(
entry: audit_log.Entry,
guild_id: String,
)
}
Constructors
-
AuditLogEntryCreatedMessage( entry: audit_log.Entry, guild_id: String, )
pub type AutoModerationActionExecutedMessage {
AutoModerationActionExecutedMessage(
guild_id: String,
action: auto_moderation.Action,
rule_id: String,
rule_trigger_type: auto_moderation.TriggerType,
user_id: String,
channel_id: option.Option(String),
message_id: option.Option(String),
alert_system_message_id: option.Option(String),
content: option.Option(String),
matched_keyword: option.Option(String),
matched_content: option.Option(String),
)
}
Constructors
-
AutoModerationActionExecutedMessage( guild_id: String, action: auto_moderation.Action, rule_id: String, rule_trigger_type: auto_moderation.TriggerType, user_id: String, channel_id: option.Option(String), message_id: option.Option(String), alert_system_message_id: option.Option(String), content: option.Option(String), matched_keyword: option.Option(String), matched_content: option.Option(String), )
pub type BaseIdentifyMessage {
BaseIdentifyMessage(
token: String,
properties: IdentifyProperties,
supports_compression: Bool,
max_offline_members: option.Option(Int),
presence: option.Option(UpdatePresenceMessage),
intents: List(intent.Intent),
)
}
Constructors
-
BaseIdentifyMessage( token: String, properties: IdentifyProperties, supports_compression: Bool, max_offline_members: option.Option(Int), presence: option.Option(UpdatePresenceMessage), intents: List(intent.Intent), )
pub type ChannelPinsUpdatedMessage {
ChannelPinsUpdatedMessage(
guild_id: option.Option(String),
channel_id: String,
last_pin_timestamp: option.Option(timestamp.Timestamp),
)
}
Constructors
-
ChannelPinsUpdatedMessage( guild_id: option.Option(String), channel_id: String, last_pin_timestamp: option.Option(timestamp.Timestamp), )
pub type ClientStatus {
ClientStatus(
desktop: option.Option(String),
mobile: option.Option(String),
web: option.Option(String),
)
}
Constructors
-
ClientStatus( desktop: option.Option(String), mobile: option.Option(String), web: option.Option(String), )
pub type Data {
Data(
url: String,
recommended_shards: Int,
session_start_limits: SessionStartLimits,
)
}
Constructors
-
Data( url: String, recommended_shards: Int, session_start_limits: SessionStartLimits, )
pub type Event {
ReadyEvent(ReadyMessage)
AllShardsReadyEvent(AllShardsReadyMessage)
ErrorEvent(grom.Error)
ResumedEvent
RateLimitedEvent(RateLimitedMessage)
ApplicationCommandPermissionsUpdatedEvent(
command.GuildPermissions,
)
AutoModerationRuleCreatedEvent(auto_moderation.Rule)
AutoModerationRuleUpdatedEvent(auto_moderation.Rule)
AutoModerationRuleDeletedEvent(auto_moderation.Rule)
AutoModerationActionExecutedEvent(
AutoModerationActionExecutedMessage,
)
ChannelCreatedEvent(channel.Channel)
ChannelUpdatedEvent(channel.Channel)
ChannelDeletedEvent(channel.Channel)
ThreadCreatedEvent(ThreadCreatedMessage)
ThreadUpdatedEvent(thread.Thread)
ThreadDeletedEvent(ThreadDeletedMessage)
ThreadListSyncedEvent(ThreadListSyncedMessage)
ThreadMemberUpdatedEvent(ThreadMemberUpdatedMessage)
PresenceUpdatedEvent(PresenceUpdatedMessage)
ThreadMembersUpdatedEvent(ThreadMembersUpdatedMessage)
ChannelPinsUpdatedEvent(ChannelPinsUpdatedMessage)
EntitlementCreatedEvent(entitlement.Entitlement)
EntitlementUpdatedEvent(entitlement.Entitlement)
EntitlementDeletedEvent(entitlement.Entitlement)
GuildCreatedEvent(GuildCreatedMessage)
GuildUpdatedEvent(guild.Guild)
GuildDeletedEvent(guild.UnavailableGuild)
AuditLogEntryCreatedEvent(AuditLogEntryCreatedMessage)
GuildBanCreatedEvent(GuildBanMessage)
GuildBanDeletedEvent(GuildBanMessage)
GuildEmojisUpdatedEvent(GuildEmojisUpdatedMessage)
GuildStickersUpdatedEvent(GuildStickersUpdatedMessage)
GuildIntegrationsUpdatedEvent(GuildIntegrationsUpdatedMessage)
GuildMemberCreatedEvent(GuildMemberCreatedMessage)
GuildMemberDeletedEvent(GuildMemberDeletedMessage)
GuildMemberUpdatedEvent(GuildMemberUpdatedMessage)
GuildMembersChunkEvent(GuildMembersChunkMessage)
RoleCreatedEvent(RoleCreatedMessage)
RoleUpdatedEvent(RoleUpdatedMessage)
RoleDeletedEvent(RoleDeletedMessage)
ScheduledEventCreatedEvent(scheduled_event.ScheduledEvent)
ScheduledEventUpdatedEvent(scheduled_event.ScheduledEvent)
ScheduledEventDeletedEvent(scheduled_event.ScheduledEvent)
ScheduledEventUserCreatedEvent(ScheduledEventUserMessage)
ScheduledEventUserDeletedEvent(ScheduledEventUserMessage)
GuildSoundboardSoundCreatedEvent(soundboard.Sound)
GuildSoundboardSoundUpdatedEvent(soundboard.Sound)
GuildSoundboardSoundDeletedEvent(
GuildSoundboardSoundDeletedMessage,
)
GuildSoundboardSoundsUpdatedEvent(
GuildSoundboardSoundsUpdatedMessage,
)
SoundboardSoundsEvent(SoundboardSoundsMessage)
IntegrationCreatedEvent(IntegrationCreatedMessage)
IntegrationUpdatedEvent(IntegrationUpdatedMessage)
IntegrationDeletedEvent(IntegrationDeletedMessage)
InviteCreatedEvent(InviteCreatedMessage)
InviteDeletedEvent(InviteDeletedMessage)
MessageCreatedEvent(MessageCreatedMessage)
MessageUpdatedEvent(MessageUpdatedMessage)
MessageDeletedEvent(MessageDeletedMessage)
MessagesBulkDeletedEvent(MessagesBulkDeletedMessage)
MessageReactionCreatedEvent(MessageReactionCreatedMessage)
MessageReactionDeletedEvent(MessageReactionDeletedMessage)
MessageAllReactionsDeletedEvent(
MessageAllReactionsDeletedMessage,
)
MessageEmojiReactionsDeletedEvent(
MessageEmojiReactionsDeletedMessage,
)
TypingStartedEvent(TypingStartedMessage)
CurrentUserUpdatedEvent(user.User)
VoiceChannelEffectSentEvent(VoiceChannelEffectSentMessage)
VoiceStateUpdatedEvent(voice.State)
VoiceServerUpdatedEvent(VoiceServerUpdatedMessage)
InteractionCreatedEvent(interaction.Interaction)
StageInstanceCreatedEvent(stage_instance.StageInstance)
StageInstanceUpdatedEvent(stage_instance.StageInstance)
StageInstanceDeletedEvent(stage_instance.StageInstance)
SubscriptionCreatedEvent(subscription.Subscription)
SubscriptionUpdatedEvent(subscription.Subscription)
SubscriptionDeletedEvent(subscription.Subscription)
PollVoteCreatedEvent(PollVoteCreatedMessage)
PollVoteDeletedEvent(PollVoteDeletedMessage)
UnknownEvent
}
Constructors
-
ReadyEvent(ReadyMessage) -
AllShardsReadyEvent(AllShardsReadyMessage) -
ErrorEvent(grom.Error) -
ResumedEvent -
RateLimitedEvent(RateLimitedMessage) -
ApplicationCommandPermissionsUpdatedEvent( command.GuildPermissions, ) -
AutoModerationRuleCreatedEvent(auto_moderation.Rule) -
AutoModerationRuleUpdatedEvent(auto_moderation.Rule) -
AutoModerationRuleDeletedEvent(auto_moderation.Rule) -
AutoModerationActionExecutedEvent( AutoModerationActionExecutedMessage, ) -
ChannelCreatedEvent(channel.Channel) -
ChannelUpdatedEvent(channel.Channel) -
ChannelDeletedEvent(channel.Channel) -
ThreadCreatedEvent(ThreadCreatedMessage) -
ThreadUpdatedEvent(thread.Thread) -
ThreadDeletedEvent(ThreadDeletedMessage) -
ThreadListSyncedEvent(ThreadListSyncedMessage) -
ThreadMemberUpdatedEvent(ThreadMemberUpdatedMessage)Could not test decoding. Please report any attempts in issues.
-
PresenceUpdatedEvent(PresenceUpdatedMessage) -
ThreadMembersUpdatedEvent(ThreadMembersUpdatedMessage) -
ChannelPinsUpdatedEvent(ChannelPinsUpdatedMessage) -
EntitlementCreatedEvent(entitlement.Entitlement)Could not test decoding. Please report any attempts in issues.
-
EntitlementUpdatedEvent(entitlement.Entitlement)Could not test decoding. Please report any attempts in issues.
-
EntitlementDeletedEvent(entitlement.Entitlement)Could not test decoding. Please report any attempts in issues.
-
GuildCreatedEvent(GuildCreatedMessage) -
GuildUpdatedEvent(guild.Guild) -
GuildDeletedEvent(guild.UnavailableGuild)If
!guild.unavailable, then the user was removed from the guild. -
AuditLogEntryCreatedEvent(AuditLogEntryCreatedMessage) -
GuildBanCreatedEvent(GuildBanMessage) -
GuildBanDeletedEvent(GuildBanMessage) -
GuildEmojisUpdatedEvent(GuildEmojisUpdatedMessage) -
GuildStickersUpdatedEvent(GuildStickersUpdatedMessage) -
GuildIntegrationsUpdatedEvent(GuildIntegrationsUpdatedMessage) -
GuildMemberCreatedEvent(GuildMemberCreatedMessage) -
GuildMemberDeletedEvent(GuildMemberDeletedMessage) -
GuildMemberUpdatedEvent(GuildMemberUpdatedMessage) -
GuildMembersChunkEvent(GuildMembersChunkMessage) -
RoleCreatedEvent(RoleCreatedMessage) -
RoleUpdatedEvent(RoleUpdatedMessage) -
RoleDeletedEvent(RoleDeletedMessage) -
ScheduledEventCreatedEvent(scheduled_event.ScheduledEvent) -
ScheduledEventUpdatedEvent(scheduled_event.ScheduledEvent) -
ScheduledEventDeletedEvent(scheduled_event.ScheduledEvent) -
ScheduledEventUserCreatedEvent(ScheduledEventUserMessage) -
ScheduledEventUserDeletedEvent(ScheduledEventUserMessage) -
GuildSoundboardSoundCreatedEvent(soundboard.Sound) -
GuildSoundboardSoundUpdatedEvent(soundboard.Sound) -
GuildSoundboardSoundDeletedEvent( GuildSoundboardSoundDeletedMessage, ) -
GuildSoundboardSoundsUpdatedEvent( GuildSoundboardSoundsUpdatedMessage, ) -
SoundboardSoundsEvent(SoundboardSoundsMessage)Sent in response to
request_soundboard_sounds. -
IntegrationCreatedEvent(IntegrationCreatedMessage) -
IntegrationUpdatedEvent(IntegrationUpdatedMessage) -
IntegrationDeletedEvent(IntegrationDeletedMessage) -
InviteCreatedEvent(InviteCreatedMessage) -
InviteDeletedEvent(InviteDeletedMessage) -
MessageCreatedEvent(MessageCreatedMessage) -
MessageUpdatedEvent(MessageUpdatedMessage) -
MessageDeletedEvent(MessageDeletedMessage) -
MessagesBulkDeletedEvent(MessagesBulkDeletedMessage) -
MessageReactionCreatedEvent(MessageReactionCreatedMessage) -
MessageReactionDeletedEvent(MessageReactionDeletedMessage) -
MessageAllReactionsDeletedEvent( MessageAllReactionsDeletedMessage, ) -
MessageEmojiReactionsDeletedEvent( MessageEmojiReactionsDeletedMessage, ) -
TypingStartedEvent(TypingStartedMessage) -
CurrentUserUpdatedEvent(user.User) -
VoiceChannelEffectSentEvent(VoiceChannelEffectSentMessage) -
VoiceStateUpdatedEvent(voice.State) -
VoiceServerUpdatedEvent(VoiceServerUpdatedMessage) -
InteractionCreatedEvent(interaction.Interaction) -
StageInstanceCreatedEvent(stage_instance.StageInstance) -
StageInstanceUpdatedEvent(stage_instance.StageInstance) -
StageInstanceDeletedEvent(stage_instance.StageInstance) -
SubscriptionCreatedEvent(subscription.Subscription)Could not test decoding. Please report any attempts in issues.
-
SubscriptionUpdatedEvent(subscription.Subscription)Could not test decoding. Please report any attempts in issues.
-
SubscriptionDeletedEvent(subscription.Subscription)Could not test decoding. Please report any attempts in issues.
-
PollVoteCreatedEvent(PollVoteCreatedMessage) -
PollVoteDeletedEvent(PollVoteDeletedMessage) -
UnknownEvent
pub type GuildCreatedMessage {
GuildCreatedMessage(
guild: guild.Guild,
joined_at: timestamp.Timestamp,
is_large: Bool,
member_count: Int,
voice_states: List(voice.State),
members: List(guild_member.GuildMember),
channels: List(channel.Channel),
threads: List(thread.Thread),
presences: List(PresenceUpdatedMessage),
stage_instances: List(stage_instance.StageInstance),
scheduled_events: List(scheduled_event.ScheduledEvent),
soundboard_sounds: List(soundboard.Sound),
)
UnavailableGuildCreatedMessage(guild.UnavailableGuild)
}
Constructors
-
GuildCreatedMessage( guild: guild.Guild, joined_at: timestamp.Timestamp, is_large: Bool, member_count: Int, voice_states: List(voice.State), members: List(guild_member.GuildMember), channels: List(channel.Channel), threads: List(thread.Thread), presences: List(PresenceUpdatedMessage), stage_instances: List(stage_instance.StageInstance), scheduled_events: List(scheduled_event.ScheduledEvent), soundboard_sounds: List(soundboard.Sound), )Arguments
- members
-
If the guild has over 75k members, this will be only your bot and users in voice channels.
- presences
-
If you don’t have the
GuildPresencesintent enabled, or if the guild has over 75k members, this will only have presences for your bot and users in voice channels.
-
UnavailableGuildCreatedMessage(guild.UnavailableGuild)
pub type GuildEmojisUpdatedMessage {
GuildEmojisUpdatedMessage(
guild_id: String,
emojis: List(emoji.Emoji),
)
}
Constructors
-
GuildEmojisUpdatedMessage( guild_id: String, emojis: List(emoji.Emoji), )
pub type GuildIntegrationsUpdatedMessage {
GuildIntegrationsUpdatedMessage(guild_id: String)
}
Constructors
-
GuildIntegrationsUpdatedMessage(guild_id: String)
pub type GuildMemberCreatedMessage {
GuildMemberCreatedMessage(
guild_id: String,
guild_member: guild_member.GuildMember,
)
}
Constructors
-
GuildMemberCreatedMessage( guild_id: String, guild_member: guild_member.GuildMember, )
pub type GuildMemberUpdatedMessage {
GuildMemberUpdatedMessage(
guild_id: String,
role_ids: List(String),
user: user.User,
nick: modification.Modification(String),
avatar_hash: option.Option(String),
banner_hash: option.Option(String),
joined_at: option.Option(timestamp.Timestamp),
premium_since: option.Option(timestamp.Timestamp),
is_deaf: option.Option(Bool),
is_mute: option.Option(Bool),
is_pending: option.Option(Bool),
communication_disabled_until: modification.Modification(
timestamp.Timestamp,
),
flags: option.Option(List(guild_member.Flag)),
avatar_decoration_data: modification.Modification(
user.AvatarDecorationData,
),
)
}
Constructors
-
GuildMemberUpdatedMessage( guild_id: String, role_ids: List(String), user: user.User, nick: modification.Modification(String), avatar_hash: option.Option(String), banner_hash: option.Option(String), joined_at: option.Option(timestamp.Timestamp), premium_since: option.Option(timestamp.Timestamp), is_deaf: option.Option(Bool), is_mute: option.Option(Bool), is_pending: option.Option(Bool), communication_disabled_until: modification.Modification( timestamp.Timestamp, ), flags: option.Option(List(guild_member.Flag)), avatar_decoration_data: modification.Modification( user.AvatarDecorationData, ), )
pub type GuildMembersChunkMessage {
GuildMembersChunkMessage(
guild_id: String,
members: List(guild_member.GuildMember),
chunk_index: Int,
chunk_count: Int,
not_found_ids: option.Option(List(String)),
presences: option.Option(List(PresenceUpdatedMessage)),
nonce: option.Option(String),
)
}
Constructors
-
GuildMembersChunkMessage( guild_id: String, members: List(guild_member.GuildMember), chunk_index: Int, chunk_count: Int, not_found_ids: option.Option(List(String)), presences: option.Option(List(PresenceUpdatedMessage)), nonce: option.Option(String), )
pub type GuildSoundboardSoundDeletedMessage {
GuildSoundboardSoundDeletedMessage(
sound_id: String,
guild_id: String,
)
}
Constructors
-
GuildSoundboardSoundDeletedMessage( sound_id: String, guild_id: String, )
pub type GuildSoundboardSoundsUpdatedMessage {
GuildSoundboardSoundsUpdatedMessage(
soundboard_sounds: List(soundboard.Sound),
guild_id: String,
)
}
Constructors
-
GuildSoundboardSoundsUpdatedMessage( soundboard_sounds: List(soundboard.Sound), guild_id: String, )
pub type GuildStickersUpdatedMessage {
GuildStickersUpdatedMessage(
guild_id: String,
stickers: List(sticker.Sticker),
)
}
Constructors
-
GuildStickersUpdatedMessage( guild_id: String, stickers: List(sticker.Sticker), )
pub type IdentifyProperties {
IdentifyProperties(os: String, browser: String, device: String)
}
Constructors
-
IdentifyProperties(os: String, browser: String, device: String)
pub type IntegrationCreatedMessage {
IntegrationCreatedMessage(
integration: integration.Integration,
guild_id: String,
)
}
Constructors
-
IntegrationCreatedMessage( integration: integration.Integration, guild_id: String, )
pub type IntegrationDeletedMessage {
IntegrationDeletedMessage(
id: String,
guild_id: String,
application_id: option.Option(String),
)
}
Constructors
-
IntegrationDeletedMessage( id: String, guild_id: String, application_id: option.Option(String), )
pub type IntegrationUpdatedMessage {
IntegrationUpdatedMessage(
integration: integration.Integration,
guild_id: String,
)
}
Constructors
-
IntegrationUpdatedMessage( integration: integration.Integration, guild_id: String, )
pub type InviteCreatedMessage {
InviteCreatedMessage(
channel_id: String,
code: String,
created_at: timestamp.Timestamp,
guild_id: option.Option(String),
inviter: option.Option(user.User),
max_age: duration.Duration,
max_uses: Int,
target_type: option.Option(invite.TargetType),
target_user: option.Option(user.User),
target_application: option.Option(application.Application),
is_temporary: Bool,
uses: Int,
expires_at: option.Option(timestamp.Timestamp),
)
}
Constructors
-
InviteCreatedMessage( channel_id: String, code: String, created_at: timestamp.Timestamp, guild_id: option.Option(String), inviter: option.Option(user.User), max_age: duration.Duration, max_uses: Int, target_type: option.Option(invite.TargetType), target_user: option.Option(user.User), target_application: option.Option(application.Application), is_temporary: Bool, uses: Int, expires_at: option.Option(timestamp.Timestamp), )
pub type InviteDeletedMessage {
InviteDeletedMessage(
channel_id: String,
guild_id: option.Option(String),
code: String,
)
}
Constructors
-
InviteDeletedMessage( channel_id: String, guild_id: option.Option(String), code: String, )
pub type MessageAllReactionsDeletedMessage {
MessageAllReactionsDeletedMessage(
channel_id: String,
message_id: String,
guild_id: option.Option(String),
)
}
Constructors
-
MessageAllReactionsDeletedMessage( channel_id: String, message_id: String, guild_id: option.Option(String), )
pub type MessageCreatedMessage {
MessageCreatedMessage(
message: message.Message,
guild_id: option.Option(String),
member: option.Option(guild_member.GuildMember),
mentions: List(user.User),
)
}
Constructors
-
MessageCreatedMessage( message: message.Message, guild_id: option.Option(String), member: option.Option(guild_member.GuildMember), mentions: List(user.User), )
pub type MessageDeletedMessage {
MessageDeletedMessage(
id: String,
channel_id: String,
guild_id: option.Option(String),
)
}
Constructors
-
MessageDeletedMessage( id: String, channel_id: String, guild_id: option.Option(String), )
pub type MessageEmojiReactionsDeletedMessage {
MessageEmojiReactionsDeletedMessage(
channel_id: String,
message_id: String,
guild_id: option.Option(String),
emoji: emoji.Emoji,
)
}
Constructors
-
MessageEmojiReactionsDeletedMessage( channel_id: String, message_id: String, guild_id: option.Option(String), emoji: emoji.Emoji, )
pub type MessageReactionCreatedMessage {
MessageReactionCreatedMessage(
user_id: String,
channel_id: String,
message_id: String,
guild_id: option.Option(String),
member: option.Option(guild_member.GuildMember),
emoji: emoji.Emoji,
message_author_id: option.Option(String),
is_burst: Bool,
burst_colors: option.Option(List(String)),
type_: reaction.Type,
)
}
Constructors
-
MessageReactionCreatedMessage( user_id: String, channel_id: String, message_id: String, guild_id: option.Option(String), member: option.Option(guild_member.GuildMember), emoji: emoji.Emoji, message_author_id: option.Option(String), is_burst: Bool, burst_colors: option.Option(List(String)), type_: reaction.Type, )
pub type MessageReactionDeletedMessage {
MessageReactionDeletedMessage(
user_id: String,
channel_id: String,
message_id: String,
guild_id: option.Option(String),
emoji: emoji.Emoji,
is_burst: Bool,
type_: reaction.Type,
)
}
Constructors
-
MessageReactionDeletedMessage( user_id: String, channel_id: String, message_id: String, guild_id: option.Option(String), emoji: emoji.Emoji, is_burst: Bool, type_: reaction.Type, )
pub type MessageUpdatedMessage {
MessageUpdatedMessage(
message: message.Message,
guild_id: option.Option(String),
member: option.Option(guild_member.GuildMember),
mentions: List(user.User),
)
}
Constructors
-
MessageUpdatedMessage( message: message.Message, guild_id: option.Option(String), member: option.Option(guild_member.GuildMember), mentions: List(user.User), )
pub type MessagesBulkDeletedMessage {
MessagesBulkDeletedMessage(
ids: List(String),
channel_id: String,
guild_id: option.Option(String),
)
}
Constructors
-
MessagesBulkDeletedMessage( ids: List(String), channel_id: String, guild_id: option.Option(String), )
pub type PollVoteCreatedMessage {
PollVoteCreatedMessage(
user_id: String,
channel_id: String,
message_id: String,
guild_id: option.Option(String),
answer_id: Int,
)
}
Constructors
-
PollVoteCreatedMessage( user_id: String, channel_id: String, message_id: String, guild_id: option.Option(String), answer_id: Int, )
pub type PollVoteDeletedMessage {
PollVoteDeletedMessage(
user_id: String,
channel_id: String,
message_id: String,
guild_id: option.Option(String),
answer_id: Int,
)
}
Constructors
-
PollVoteDeletedMessage( user_id: String, channel_id: String, message_id: String, guild_id: option.Option(String), answer_id: Int, )
pub type PresenceStatus {
Online
DoNotDisturb
Idle
Invisible
Offline
}
Constructors
-
Online -
DoNotDisturb -
Idle -
Invisible -
Offline
pub type PresenceUpdatedMessage {
PresenceUpdatedMessage(
user_id: option.Option(String),
guild_id: option.Option(String),
status: option.Option(String),
activities: option.Option(List(activity.Activity)),
client_status: option.Option(ClientStatus),
)
}
Constructors
-
PresenceUpdatedMessage( user_id: option.Option(String), guild_id: option.Option(String), status: option.Option(String), activities: option.Option(List(activity.Activity)), client_status: option.Option(ClientStatus), )
pub type RateLimitedMessage {
RateLimitedMessage(
limited_opcode: Int,
retry_after: duration.Duration,
metadata: RateLimitedMetadata,
)
}
Constructors
-
RateLimitedMessage( limited_opcode: Int, retry_after: duration.Duration, metadata: RateLimitedMetadata, )
pub type RateLimitedMetadata {
RequestGuildMembersRateLimited(
guild_id: String,
nonce: option.Option(String),
)
}
Constructors
-
RequestGuildMembersRateLimited( guild_id: String, nonce: option.Option(String), )
pub type ReadyApplication {
ReadyApplication(id: String, flags: List(application.Flag))
}
Constructors
-
ReadyApplication(id: String, flags: List(application.Flag))
pub type ReadyMessage {
ReadyMessage(
api_version: Int,
user: user.User,
guilds: List(guild.UnavailableGuild),
session_id: String,
resume_gateway_url: String,
shard: option.Option(Shard),
application: ReadyApplication,
)
}
Constructors
-
ReadyMessage( api_version: Int, user: user.User, guilds: List(guild.UnavailableGuild), session_id: String, resume_gateway_url: String, shard: option.Option(Shard), application: ReadyApplication, )
pub type RequestGuildMembersMessage {
RequestAllGuildMembersMessage(
guild_id: String,
with_presences: Bool,
nonce: option.Option(String),
)
RequestGuildMembersByIdsMessage(
guild_id: String,
with_presences: Bool,
nonce: option.Option(String),
user_ids: List(String),
)
RequestGuildMembersByQueryMessage(
guild_id: String,
with_presences: Bool,
nonce: option.Option(String),
query: String,
limit: Int,
)
}
Constructors
-
RequestAllGuildMembersMessage( guild_id: String, with_presences: Bool, nonce: option.Option(String), ) -
RequestGuildMembersByIdsMessage( guild_id: String, with_presences: Bool, nonce: option.Option(String), user_ids: List(String), ) -
RequestGuildMembersByQueryMessage( guild_id: String, with_presences: Bool, nonce: option.Option(String), query: String, limit: Int, )
pub type RoleDeletedMessage {
RoleDeletedMessage(guild_id: String, role_id: String)
}
Constructors
-
RoleDeletedMessage(guild_id: String, role_id: String)
pub type ScheduledEventUserMessage {
ScheduledEventUserMessage(
scheduled_event_id: String,
user_id: String,
guild_id: String,
)
}
Constructors
-
ScheduledEventUserMessage( scheduled_event_id: String, user_id: String, guild_id: String, )
pub type SessionStartLimits {
SessionStartLimits(
maximum_starts: Int,
remaining_starts: Int,
resets_after: duration.Duration,
max_identify_requests_per_5_seconds: Int,
)
}
Constructors
-
SessionStartLimits( maximum_starts: Int, remaining_starts: Int, resets_after: duration.Duration, max_identify_requests_per_5_seconds: Int, )
pub type Shard {
Shard(id: Int, num_shards: Int)
}
Constructors
-
Shard(id: Int, num_shards: Int)
pub type SoundboardSoundsMessage {
SoundboardSoundsMessage(
soundboard_sounds: List(soundboard.Sound),
guild_id: String,
)
}
Constructors
-
SoundboardSoundsMessage( soundboard_sounds: List(soundboard.Sound), guild_id: String, )
pub type ThreadCreatedMessage {
ThreadCreatedMessage(
thread: thread.Thread,
is_newly_created: Bool,
)
}
Constructors
-
ThreadCreatedMessage( thread: thread.Thread, is_newly_created: Bool, )
pub type ThreadDeletedMessage {
ThreadDeletedMessage(
id: String,
guild_id: String,
parent_id: String,
type_: thread.Type,
)
}
Constructors
-
ThreadDeletedMessage( id: String, guild_id: String, parent_id: String, type_: thread.Type, )
pub type ThreadListSyncedMessage {
ThreadListSyncedMessage(
guild_id: String,
channel_ids: option.Option(List(String)),
threads: List(thread.Thread),
members: List(thread.Member),
)
}
Constructors
-
ThreadListSyncedMessage( guild_id: String, channel_ids: option.Option(List(String)), threads: List(thread.Thread), members: List(thread.Member), )Arguments
- channel_ids
-
If
None, then threads are synced for the entire guild. - members
-
A list of thread members for the current user.
pub type ThreadMemberUpdatedMessage {
ThreadMemberUpdatedMessage(
thread_member: thread.Member,
guild_id: String,
)
}
Constructors
-
ThreadMemberUpdatedMessage( thread_member: thread.Member, guild_id: String, )
pub type ThreadMembersUpdatedMessage {
ThreadMembersUpdatedMessage(
id: String,
guild_id: String,
member_count: Int,
added_members: option.Option(
List(
#(thread.Member, option.Option(PresenceUpdatedMessage)),
),
),
removed_member_ids: option.Option(List(String)),
)
}
Constructors
-
ThreadMembersUpdatedMessage( id: String, guild_id: String, member_count: Int, added_members: option.Option( List(#(thread.Member, option.Option(PresenceUpdatedMessage))), ), removed_member_ids: option.Option(List(String)), )
pub type TypingStartedMessage {
TypingStartedMessage(
channel_id: String,
guild_id: option.Option(String),
user_id: String,
timestamp: timestamp.Timestamp,
member: option.Option(guild_member.GuildMember),
)
}
Constructors
-
TypingStartedMessage( channel_id: String, guild_id: option.Option(String), user_id: String, timestamp: timestamp.Timestamp, member: option.Option(guild_member.GuildMember), )
pub type UpdatePresenceMessage {
UpdatePresenceMessage(
since: option.Option(timestamp.Timestamp),
activities: List(activity.Activity),
status: PresenceStatus,
is_afk: Bool,
)
}
Constructors
-
UpdatePresenceMessage( since: option.Option(timestamp.Timestamp), activities: List(activity.Activity), status: PresenceStatus, is_afk: Bool, )Arguments
- since
-
Only for Idle.
pub type UpdateVoiceStateMessage {
UpdateVoiceStateMessage(
guild_id: String,
channel_id: option.Option(String),
is_self_muted: Bool,
is_self_deafened: Bool,
)
}
Constructors
-
UpdateVoiceStateMessage( guild_id: String, channel_id: option.Option(String), is_self_muted: Bool, is_self_deafened: Bool, )Arguments
- channel_id
-
Set to
Noneif disconnecting.
pub type VoiceChannelEffectSentMessage {
VoiceChannelEffectSentMessage(
channel_id: String,
guild_id: String,
user_id: String,
emoji: option.Option(emoji.Emoji),
animation_type: option.Option(voice.AnimationType),
animation_id: option.Option(Int),
sound_id: option.Option(soundboard.SoundId),
sound_volume: option.Option(Float),
)
}
Constructors
-
VoiceChannelEffectSentMessage( channel_id: String, guild_id: String, user_id: String, emoji: option.Option(emoji.Emoji), animation_type: option.Option(voice.AnimationType), animation_id: option.Option(Int), sound_id: option.Option(soundboard.SoundId), sound_volume: option.Option(Float), )
pub type VoiceServerUpdatedMessage {
VoiceServerUpdatedMessage(
token: String,
guild_id: String,
endpoint: option.Option(String),
)
}
Constructors
-
VoiceServerUpdatedMessage( token: String, guild_id: String, endpoint: option.Option(String), )
Values
pub fn get_data(client: grom.Client) -> Result(Data, grom.Error)
pub fn identify(
client: grom.Client,
intents intents: List(intent.Intent),
) -> BaseIdentifyMessage
pub fn identify_with_presence(
identify: BaseIdentifyMessage,
presence: UpdatePresenceMessage,
) -> BaseIdentifyMessage
pub fn new(
state: state,
identify: BaseIdentifyMessage,
data: Data,
) -> Builder(state)
Only use this function if you have no intention of sending user messages, such as:
UpdatePresenceUpdateVoiceStateRequestGuildMembersRequestSoundboardSounds
pub fn new_with_initializer(
init: fn(process.Subject(Message)) -> Result(user_state, String),
identify: BaseIdentifyMessage,
data: Data,
) -> Builder(user_state)
You should hold the gateway subject in your state. You’ll send user messages to that subject.
pub fn on_event(
builder: Builder(state),
do handler: fn(state, Event) -> Next(state),
) -> Builder(state)
pub fn request_guild_members(
gateway: process.Subject(Message),
using message: RequestGuildMembersMessage,
) -> Nil
pub fn request_soundboard_sounds(
gateway: process.Subject(Message),
for guild_ids: List(String),
) -> Nil
It’s possible that this function is buggy, and I cannot test it right now. If you use multiple shards, you might: a) receive multiple SoundboardSounds events with the same data b) receive multiple SoundboardSounds events with different data based on the guild-shard relationship Please report any usage of this function with multiple shards in issues.
pub fn start(
builder: Builder(state),
) -> Result(
actor.Started(process.Subject(Message)),
actor.StartError,
)
pub fn stop_abnormal(reason: String) -> Next(state)
pub fn update_presence(
gateway: process.Subject(Message),
using message: UpdatePresenceMessage,
) -> Nil
pub fn update_voice_state(
gateway: process.Subject(Message),
using message: UpdateVoiceStateMessage,
) -> Nil
pub fn with_shards(
builder: Builder(user_state),
count count: Int,
) -> Builder(user_state)
Use this to force the amount of shards to a set number. By default, grom will resort to the recommended shard count given to us from Discord. Unless you have more than 150,000 guilds using your bot, you likely shouldn’t use this function.