pub use crate::models::payloads::common::*;
use serde::{Deserialize, Serialize};
use crate::models::payloads::{
APIApplication, APIApplicationCommandPermission, APIAuditLogEntry, APIAutoModerationAction,
APIAutoModerationRule, APIBaseGuild, APIBaseGuildMember, APIBaseMessage,
APIBaseVoiceGuildMember, APIBaseVoiceState, APIChannel, APIEmoji, APIEntitlement,
APIFlaggedGuildMember, APIGuild, APIGuildIntegration, APIGuildMember, APIGuildMemberAvatar,
APIGuildMemberJoined, APIGuildMemberUser, APIGuildScheduledEvent, APIInteraction, APIRole,
APISoundboardSound, APIStageInstance, APISticker, APISubscription, APIThreadChannel,
APIThreadMember, APIUnavailableGuild, APIUser, APIVoiceState, AutoModerationRuleTriggerType,
ChannelType, GatewayGuildMembersChunkPresence, GatewayPresenceUpdate, GatewayThreadListSync,
GatewayThreadMembersUpdate as RawGatewayThreadMembersUpdate, InviteTargetType,
PresenceUpdateStatus,
};
pub type _Nullable<T> = Option<T>;
pub const GATEWAY_VERSION: &str = "10";
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[repr(u8)]
pub enum GatewayOpcodes {
Dispatch = 0,
Heartbeat = 1,
Identify = 2,
PresenceUpdate = 3,
VoiceStateUpdate = 4,
Resume = 6,
Reconnect = 7,
RequestGuildMembers = 8,
InvalidSession = 9,
Hello = 10,
HeartbeatAck = 11,
RequestSoundboardSounds = 31,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[repr(u16)]
pub enum GatewayCloseCodes {
UnknownError = 4000,
UnknownOpcode = 4001,
DecodeError = 4002,
NotAuthenticated = 4003,
AuthenticationFailed = 4004,
AlreadyAuthenticated = 4005,
InvalidSeq = 4007,
RateLimited = 4008,
SessionTimedOut = 4009,
InvalidShard = 4010,
ShardingRequired = 4011,
InvalidAPIVersion = 4012,
InvalidIntents = 4013,
DisallowedIntents = 4014,
}
use bitflags::bitflags;
bitflags! {
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(transparent)]
pub struct GatewayIntents: u64 {
const GUILDS = 1 << 0;
const GUILD_MEMBERS = 1 << 1;
const GUILD_MODERATION = 1 << 2;
const GUILD_EXPRESSIONS = 1 << 3;
const GUILD_INTEGRATIONS = 1 << 4;
const GUILD_WEBHOOKS = 1 << 5;
const GUILD_INVITES = 1 << 6;
const GUILD_VOICE_STATES = 1 << 7;
const GUILD_PRESENCES = 1 << 8;
const GUILD_MESSAGES = 1 << 9;
const GUILD_MESSAGE_REACTIONS = 1 << 10;
const GUILD_MESSAGE_TYPING = 1 << 11;
const DIRECT_MESSAGES = 1 << 12;
const DIRECT_MESSAGE_REACTIONS = 1 << 13;
const DIRECT_MESSAGE_TYPING = 1 << 14;
const MESSAGE_CONTENT = 1 << 15;
const GUILD_SCHEDULED_EVENTS = 1 << 16;
const AUTO_MODERATION_CONFIGURATION = 1 << 20;
const AUTO_MODERATION_EXECUTION = 1 << 21;
const GUILD_MESSAGE_POLLS = 1 << 24;
const DIRECT_MESSAGE_POLLS = 1 << 25;
}
}
impl GatewayIntents {
pub const fn minimal() -> Self {
Self::GUILDS.union(Self::GUILD_MESSAGES)
}
pub const fn recommended() -> Self {
Self::minimal().union(Self::GUILD_MESSAGE_REACTIONS)
}
pub const fn privileged() -> Self {
Self::GUILD_MEMBERS
.union(Self::GUILD_PRESENCES)
.union(Self::MESSAGE_CONTENT)
}
pub fn non_privileged() -> Self {
Self::all() - Self::privileged()
}
}
pub type GatewayDispatch<D = serde_json::Value> = _DataPayload<GatewayDispatchEvents, D>;
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
pub enum GatewayDispatchEvents {
ApplicationCommandPermissionsUpdate,
AutoModerationActionExecution,
AutoModerationRuleCreate,
AutoModerationRuleDelete,
AutoModerationRuleUpdate,
ChannelCreate,
ChannelDelete,
ChannelPinsUpdate,
ChannelUpdate,
EntitlementCreate,
EntitlementDelete,
EntitlementUpdate,
GuildAuditLogEntryCreate,
GuildBanAdd,
GuildBanRemove,
GuildCreate,
GuildDelete,
GuildEmojisUpdate,
GuildIntegrationsUpdate,
GuildMemberAdd,
GuildMemberRemove,
GuildMembersChunk,
GuildMemberUpdate,
GuildRoleCreate,
GuildRoleDelete,
GuildRoleUpdate,
GuildScheduledEventCreate,
GuildScheduledEventDelete,
GuildScheduledEventUpdate,
GuildScheduledEventUserAdd,
GuildScheduledEventUserRemove,
GuildSoundboardSoundCreate,
GuildSoundboardSoundDelete,
GuildSoundboardSoundsUpdate,
GuildSoundboardSoundUpdate,
SoundboardSounds,
GuildStickersUpdate,
GuildUpdate,
IntegrationCreate,
IntegrationDelete,
IntegrationUpdate,
InteractionCreate,
InviteCreate,
InviteDelete,
MessageCreate,
MessageDelete,
MessageDeleteBulk,
MessagePollVoteAdd,
MessagePollVoteRemove,
MessageReactionAdd,
MessageReactionRemove,
MessageReactionRemoveAll,
MessageReactionRemoveEmoji,
MessageUpdate,
PresenceUpdate,
Ready,
Resumed,
StageInstanceCreate,
StageInstanceDelete,
StageInstanceUpdate,
SubscriptionCreate,
SubscriptionDelete,
SubscriptionUpdate,
ThreadCreate,
ThreadDelete,
ThreadListSync,
ThreadMembersUpdate,
ThreadMemberUpdate,
ThreadUpdate,
TypingStart,
UserUpdate,
VoiceChannelEffectSend,
VoiceServerUpdate,
VoiceStateUpdate,
WebhooksUpdate,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GatewaySendPayload {
GatewayHeartbeat(GatewayHeartbeat),
GatewayIdentify(GatewayIdentify),
GatewayRequestGuildMembers(GatewayRequestGuildMembers),
GatewayRequestSoundboardSounds(GatewayRequestSoundboardSounds),
GatewayResume(GatewayResume),
GatewayUpdatePresence(GatewayUpdatePresence),
GatewayVoiceStateUpdate(GatewayVoiceStateUpdate),
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GatewayReceivePayload {
GatewayDispatchPayload(GatewayDispatchPayload),
GatewayHeartbeatAck(GatewayHeartbeatAck),
GatewayHeartbeatRequest(GatewayHeartbeatRequest),
GatewayHello(GatewayHello),
GatewayInvalidSession(GatewayInvalidSession),
GatewayReconnect(GatewayReconnect),
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GatewayDispatchPayload {
GatewayApplicationCommandPermissionsUpdateDispatch(
GatewayApplicationCommandPermissionsUpdateDispatch,
),
GatewayAutoModerationActionExecutionDispatch(GatewayAutoModerationActionExecutionDispatch),
GatewayAutoModerationRuleCreateDispatch(GatewayAutoModerationRuleCreateDispatch),
GatewayAutoModerationRuleDeleteDispatch(GatewayAutoModerationRuleDeleteDispatch),
GatewayAutoModerationRuleModifyDispatch(GatewayAutoModerationRuleModifyDispatch),
GatewayChannelModifyDispatch(GatewayChannelModifyDispatch),
GatewayChannelPinsUpdateDispatch(GatewayChannelPinsUpdateDispatch),
GatewayEntitlementModifyDispatch(GatewayEntitlementModifyDispatch),
GatewayGuildAuditLogEntryCreateDispatch(GatewayGuildAuditLogEntryCreateDispatch),
GatewayGuildBanModifyDispatch(GatewayGuildBanModifyDispatch),
GatewayGuildCreateDispatch(GatewayGuildCreateDispatch),
GatewayGuildDeleteDispatch(GatewayGuildDeleteDispatch),
GatewayGuildEmojisUpdateDispatch(GatewayGuildEmojisUpdateDispatch),
GatewayGuildIntegrationsUpdateDispatch(GatewayGuildIntegrationsUpdateDispatch),
GatewayGuildMemberAddDispatch(GatewayGuildMemberAddDispatch),
GatewayGuildMemberRemoveDispatch(GatewayGuildMemberRemoveDispatch),
GatewayGuildMembersChunkDispatch(GatewayGuildMembersChunkDispatch),
GatewayGuildMemberUpdateDispatch(GatewayGuildMemberUpdateDispatch),
GatewayGuildModifyDispatch(GatewayGuildModifyDispatch),
GatewayGuildRoleDeleteDispatch(GatewayGuildRoleDeleteDispatch),
GatewayGuildRoleModifyDispatch(GatewayGuildRoleModifyDispatch),
GatewayGuildScheduledEventCreateDispatch(GatewayGuildScheduledEventCreateDispatch),
GatewayGuildScheduledEventDeleteDispatch(GatewayGuildScheduledEventDeleteDispatch),
GatewayGuildScheduledEventUpdateDispatch(GatewayGuildScheduledEventUpdateDispatch),
GatewayGuildScheduledEventUserAddDispatch(GatewayGuildScheduledEventUserAddDispatch),
GatewayGuildScheduledEventUserRemoveDispatch(GatewayGuildScheduledEventUserRemoveDispatch),
GatewayGuildSoundboardSoundCreateDispatch(GatewayGuildSoundboardSoundCreateDispatch),
GatewayGuildSoundboardSoundDeleteDispatch(GatewayGuildSoundboardSoundDeleteDispatch),
GatewayGuildSoundboardSoundsUpdateDispatch(GatewayGuildSoundboardSoundsUpdateDispatch),
GatewayGuildSoundboardSoundUpdateDispatch(GatewayGuildSoundboardSoundUpdateDispatch),
GatewayGuildStickersUpdateDispatch(GatewayGuildStickersUpdateDispatch),
GatewayIntegrationCreateDispatch(GatewayIntegrationCreateDispatch),
GatewayIntegrationDeleteDispatch(GatewayIntegrationDeleteDispatch),
GatewayIntegrationUpdateDispatch(GatewayIntegrationUpdateDispatch),
GatewayInteractionCreateDispatch(GatewayInteractionCreateDispatch),
GatewayInviteCreateDispatch(GatewayInviteCreateDispatch),
GatewayInviteDeleteDispatch(GatewayInviteDeleteDispatch),
GatewayMessageCreateDispatch(GatewayMessageCreateDispatch),
GatewayMessageDeleteBulkDispatch(GatewayMessageDeleteBulkDispatch),
GatewayMessageDeleteDispatch(GatewayMessageDeleteDispatch),
GatewayMessagePollVoteAddDispatch(GatewayMessagePollVoteAddDispatch),
GatewayMessagePollVoteRemoveDispatch(GatewayMessagePollVoteRemoveDispatch),
GatewayMessageReactionAddDispatch(GatewayMessageReactionAddDispatch),
GatewayMessageReactionRemoveAllDispatch(GatewayMessageReactionRemoveAllDispatch),
GatewayMessageReactionRemoveDispatch(GatewayMessageReactionRemoveDispatch),
GatewayMessageReactionRemoveEmojiDispatch(GatewayMessageReactionRemoveEmojiDispatch),
GatewayMessageUpdateDispatch(GatewayMessageUpdateDispatch),
GatewayPresenceUpdateDispatch(GatewayPresenceUpdateDispatch),
GatewayReadyDispatch(GatewayReadyDispatch),
GatewayResumedDispatch(GatewayResumedDispatch),
GatewaySoundboardSoundsDispatch(GatewaySoundboardSoundsDispatch),
GatewayStageInstanceCreateDispatch(GatewayStageInstanceCreateDispatch),
GatewayStageInstanceDeleteDispatch(GatewayStageInstanceDeleteDispatch),
GatewayStageInstanceUpdateDispatch(GatewayStageInstanceUpdateDispatch),
GatewaySubscriptionModifyDispatch(GatewaySubscriptionModifyDispatch),
GatewayThreadCreateDispatch(GatewayThreadCreateDispatch),
GatewayThreadDeleteDispatch(GatewayThreadDeleteDispatch),
GatewayThreadListSyncDispatch(GatewayThreadListSyncDispatch),
GatewayThreadMembersUpdateDispatch(GatewayThreadMembersUpdateDispatch),
GatewayThreadMemberUpdateDispatch(GatewayThreadMemberUpdateDispatch),
GatewayThreadUpdateDispatch(GatewayThreadUpdateDispatch),
GatewayTypingStartDispatch(GatewayTypingStartDispatch),
GatewayUserUpdateDispatch(GatewayUserUpdateDispatch),
GatewayVoiceChannelEffectSendDispatch(GatewayVoiceChannelEffectSendDispatch),
GatewayVoiceServerUpdateDispatch(GatewayVoiceServerUpdateDispatch),
GatewayVoiceStateUpdateDispatch(GatewayVoiceStateUpdateDispatch),
GatewayWebhooksUpdateDispatch(GatewayWebhooksUpdateDispatch),
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct GatewayHello {
pub op: GatewayOpcodes,
pub d: GatewayHelloData,
pub t: Option<serde_json::Value>,
pub s: Option<serde_json::Value>,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct GatewayHelloData {
pub heartbeat_interval: i64,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct GatewayHeartbeatRequest {
pub op: GatewayOpcodes,
pub d: (),
pub t: Option<serde_json::Value>,
pub s: Option<serde_json::Value>,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct GatewayHeartbeatAck {
pub op: GatewayOpcodes,
pub d: (),
pub t: Option<serde_json::Value>,
pub s: Option<serde_json::Value>,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct GatewayInvalidSession {
pub op: GatewayOpcodes,
pub d: GatewayInvalidSessionData,
pub t: Option<serde_json::Value>,
pub s: Option<serde_json::Value>,
}
pub type GatewayInvalidSessionData = bool;
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct GatewayReconnect {
pub op: GatewayOpcodes,
pub d: (),
pub t: Option<serde_json::Value>,
pub s: Option<serde_json::Value>,
}
pub type GatewayReadyDispatch = _DataPayload<GatewayDispatchEvents, GatewayReadyDispatchData>;
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct GatewayReadyDispatchData {
pub v: i64,
pub user: APIUser,
pub guilds: Vec<APIUnavailableGuild>,
pub session_id: String,
pub resume_gateway_url: String,
pub shard: Option<(i64, i64)>,
pub application: GatewayReadyApplication,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct GatewayReadyApplication {
pub id: String,
pub flags: u64,
}
pub type GatewayResumedDispatch = _DataPayload<GatewayDispatchEvents, ()>;
pub type GatewayAutoModerationRuleModifyDispatch =
_DataPayload<GatewayDispatchEvents, GatewayAutoModerationRuleModifyDispatchData>;
pub type GatewayAutoModerationRuleModifyDispatchData = APIAutoModerationRule;
pub type GatewayAutoModerationRuleCreateDispatch = GatewayAutoModerationRuleModifyDispatch;
pub type GatewayAutoModerationRuleCreateDispatchData = GatewayAutoModerationRuleModifyDispatchData;
pub type GatewayAutoModerationRuleUpdateDispatch = GatewayAutoModerationRuleModifyDispatch;
pub type GatewayAutoModerationRuleUpdateDispatchData = GatewayAutoModerationRuleModifyDispatchData;
pub type GatewayAutoModerationRuleDeleteDispatch = GatewayAutoModerationRuleModifyDispatch;
pub type GatewayAutoModerationRuleDeleteDispatchData = GatewayAutoModerationRuleModifyDispatchData;
pub type GatewayAutoModerationActionExecutionDispatch =
_DataPayload<GatewayDispatchEvents, GatewayAutoModerationActionExecutionDispatchData>;
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct GatewayAutoModerationActionExecutionDispatchData {
pub guild_id: String,
pub action: APIAutoModerationAction,
pub rule_id: String,
pub rule_trigger_type: AutoModerationRuleTriggerType,
pub user_id: String,
pub channel_id: Option<String>,
pub message_id: Option<String>,
pub alert_system_message_id: Option<String>,
pub content: String,
pub matched_keyword: Option<String>,
pub matched_content: Option<String>,
}
pub type GatewayApplicationCommandPermissionsUpdateDispatch =
_DataPayload<GatewayDispatchEvents, GatewayApplicationCommandPermissionsUpdateDispatchData>;
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct GatewayApplicationCommandPermissionsUpdateDispatchData {
pub id: String,
pub application_id: String,
pub guild_id: String,
pub permissions: Vec<APIApplicationCommandPermission>,
}
pub type GatewaySubscriptionModifyDispatch =
_DataPayload<GatewayDispatchEvents, GatewaySubscriptionModifyDispatchData>;
pub type GatewaySubscriptionModifyDispatchData = APISubscription;
pub type GatewaySubscriptionCreateDispatch = GatewaySubscriptionModifyDispatch;
pub type GatewaySubscriptionCreateDispatchData = GatewaySubscriptionModifyDispatchData;
pub type GatewaySubscriptionUpdateDispatch = GatewaySubscriptionModifyDispatch;
pub type GatewaySubscriptionUpdateDispatchData = GatewaySubscriptionModifyDispatchData;
pub type GatewaySubscriptionDeleteDispatch = GatewaySubscriptionModifyDispatch;
pub type GatewaySubscriptionDeleteDispatchData = GatewaySubscriptionModifyDispatchData;
pub type GatewayChannelModifyDispatch =
_DataPayload<GatewayDispatchEvents, GatewayChannelModifyDispatchData>;
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct GatewayChannelModifyDispatchData {
pub guild_id: String,
#[serde(flatten)]
pub channel: APIChannel,
}
pub type GatewayChannelCreateDispatch = GatewayChannelModifyDispatch;
pub type GatewayChannelCreateDispatchData = GatewayChannelModifyDispatchData;
pub type GatewayChannelUpdateDispatch = GatewayChannelModifyDispatch;
pub type GatewayChannelUpdateDispatchData = GatewayChannelModifyDispatchData;
pub type GatewayChannelDeleteDispatch = GatewayChannelModifyDispatch;
pub type GatewayChannelDeleteDispatchData = GatewayChannelModifyDispatchData;
pub type GatewayChannelPinsUpdateDispatch =
_DataPayload<GatewayDispatchEvents, GatewayChannelPinsUpdateDispatchData>;
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct GatewayChannelPinsUpdateDispatchData {
pub guild_id: Option<String>,
pub channel_id: String,
pub last_pin_timestamp: Option<String>,
}
pub type GatewayEntitlementModifyDispatchData = APIEntitlement;
pub type GatewayEntitlementModifyDispatch =
_DataPayload<GatewayDispatchEvents, GatewayEntitlementModifyDispatchData>;
pub type GatewayEntitlementCreateDispatchData = GatewayEntitlementModifyDispatchData;
pub type GatewayEntitlementCreateDispatch = GatewayEntitlementModifyDispatch;
pub type GatewayEntitlementUpdateDispatchData = GatewayEntitlementModifyDispatchData;
pub type GatewayEntitlementUpdateDispatch = GatewayEntitlementModifyDispatch;
pub type GatewayEntitlementDeleteDispatchData = GatewayEntitlementModifyDispatchData;
pub type GatewayEntitlementDeleteDispatch = GatewayEntitlementModifyDispatch;
pub type GatewayGuildModifyDispatch =
_DataPayload<GatewayDispatchEvents, GatewayGuildModifyDispatchData>;
pub type GatewayGuildModifyDispatchData = APIGuild;
pub type GatewayGuildCreateDispatch =
_DataPayload<GatewayDispatchEvents, GatewayGuildCreateDispatchData>;
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct GatewayGuildCreateDispatchData {
pub joined_at: String,
pub large: bool,
pub unavailable: Option<bool>,
pub member_count: i64,
pub voice_states: Vec<APIBaseVoiceState>,
pub members: Vec<APIGuildMember>,
pub channels: Vec<APIChannel>,
pub threads: Vec<APIChannel>,
pub presences: Vec<GatewayPresenceUpdate>,
pub stage_instances: Vec<APIStageInstance>,
pub guild_scheduled_events: Vec<APIGuildScheduledEvent>,
pub soundboard_sounds: Vec<APISoundboardSound>,
#[serde(flatten)]
pub guild: APIGuild,
}
pub type GatewayGuildUpdateDispatch = GatewayGuildModifyDispatch;
pub type GatewayGuildUpdateDispatchData = GatewayGuildModifyDispatchData;
pub type GatewayGuildDeleteDispatch =
_DataPayload<GatewayDispatchEvents, GatewayGuildDeleteDispatchData>;
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct GatewayGuildDeleteDispatchData {
pub unavailable: Option<bool>,
#[serde(flatten)]
pub guild: APIBaseGuild,
}
pub type GatewayGuildBanModifyDispatch =
_DataPayload<GatewayDispatchEvents, GatewayGuildBanModifyDispatchData>;
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct GatewayGuildBanModifyDispatchData {
pub guild_id: String,
pub user: APIUser,
}
pub type GatewayGuildBanAddDispatch = GatewayGuildBanModifyDispatch;
pub type GatewayGuildBanAddDispatchData = GatewayGuildBanModifyDispatchData;
pub type GatewayGuildBanRemoveDispatch = GatewayGuildBanModifyDispatch;
pub type GatewayGuildBanRemoveDispatchData = GatewayGuildBanModifyDispatchData;
pub type GatewayGuildEmojisUpdateDispatch =
_DataPayload<GatewayDispatchEvents, GatewayGuildEmojisUpdateDispatchData>;
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct GatewayGuildEmojisUpdateDispatchData {
pub guild_id: String,
pub emojis: Vec<APIEmoji>,
}
pub type GatewayGuildStickersUpdateDispatch =
_DataPayload<GatewayDispatchEvents, GatewayGuildStickersUpdateDispatchData>;
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct GatewayGuildStickersUpdateDispatchData {
pub guild_id: String,
pub stickers: Vec<APISticker>,
}
pub type GatewayGuildIntegrationsUpdateDispatch =
_DataPayload<GatewayDispatchEvents, GatewayGuildIntegrationsUpdateDispatchData>;
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct GatewayGuildIntegrationsUpdateDispatchData {
pub guild_id: String,
}
pub type GatewayGuildMemberAddDispatch =
_DataPayload<GatewayDispatchEvents, GatewayGuildMemberAddDispatchData>;
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct GatewayGuildMemberAddDispatchData {
pub guild_id: String,
#[serde(flatten)]
pub member: APIGuildMember,
}
pub type GatewayGuildMemberRemoveDispatch =
_DataPayload<GatewayDispatchEvents, GatewayGuildMemberRemoveDispatchData>;
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct GatewayGuildMemberRemoveDispatchData {
pub guild_id: String,
pub user: APIUser,
}
pub type GatewayGuildMemberUpdateDispatch =
_DataPayload<GatewayDispatchEvents, GatewayGuildMemberUpdateDispatchData>;
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct GatewayGuildMemberUpdateDispatchData {
pub guild_id: String,
#[serde(flatten)]
pub joined: Option<APIGuildMemberJoined>,
#[serde(flatten)]
pub base: APIBaseGuildMember,
#[serde(flatten)]
pub voice: Option<APIBaseVoiceGuildMember>,
#[serde(flatten)]
pub flagged: Option<APIFlaggedGuildMember>,
#[serde(flatten)]
pub avatar: APIGuildMemberAvatar,
#[serde(flatten)]
pub user: APIGuildMemberUser,
}
pub type GatewayGuildMembersChunkDispatch =
_DataPayload<GatewayDispatchEvents, GatewayGuildMembersChunkDispatchData>;
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct GatewayGuildMembersChunkDispatchData {
pub guild_id: String,
pub members: Vec<APIGuildMember>,
pub chunk_index: i64,
pub chunk_count: i64,
pub not_found: Option<Vec<serde_json::Value>>,
pub presences: Option<Vec<GatewayGuildMembersChunkPresence>>,
pub nonce: Option<String>,
}
pub type GatewayGuildRoleModifyDispatch =
_DataPayload<GatewayDispatchEvents, GatewayGuildRoleModifyDispatchData>;
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct GatewayGuildRoleModifyDispatchData {
pub guild_id: String,
pub role: APIRole,
}
pub type GatewayGuildRoleCreateDispatch = GatewayGuildRoleModifyDispatch;
pub type GatewayGuildRoleCreateDispatchData = GatewayGuildRoleModifyDispatchData;
pub type GatewayGuildRoleUpdateDispatch = GatewayGuildRoleModifyDispatch;
pub type GatewayGuildRoleUpdateDispatchData = GatewayGuildRoleModifyDispatchData;
pub type GatewayGuildRoleDeleteDispatch =
_DataPayload<GatewayDispatchEvents, GatewayGuildRoleDeleteDispatchData>;
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct GatewayGuildRoleDeleteDispatchData {
pub guild_id: String,
pub role_id: String,
}
pub type GatewayGuildScheduledEventCreateDispatch =
_DataPayload<GatewayDispatchEvents, GatewayGuildScheduledEventCreateDispatchData>;
pub type GatewayGuildScheduledEventCreateDispatchData = APIGuildScheduledEvent;
pub type GatewayGuildScheduledEventUpdateDispatch =
_DataPayload<GatewayDispatchEvents, GatewayGuildScheduledEventUpdateDispatchData>;
pub type GatewayGuildScheduledEventUpdateDispatchData = APIGuildScheduledEvent;
pub type GatewayGuildScheduledEventDeleteDispatch =
_DataPayload<GatewayDispatchEvents, GatewayGuildScheduledEventDeleteDispatchData>;
pub type GatewayGuildScheduledEventDeleteDispatchData = APIGuildScheduledEvent;
pub type GatewayGuildScheduledEventUserAddDispatch =
_DataPayload<GatewayDispatchEvents, GatewayGuildScheduledEventUserAddDispatchData>;
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct GatewayGuildScheduledEventUserAddDispatchData {
pub guild_scheduled_event_id: String,
pub user_id: String,
pub guild_id: String,
}
pub type GatewayGuildScheduledEventUserRemoveDispatch =
_DataPayload<GatewayDispatchEvents, GatewayGuildScheduledEventUserAddDispatchData>;
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct GatewayGuildScheduledEventUserRemoveDispatchData {
pub guild_scheduled_event_id: String,
pub user_id: String,
pub guild_id: String,
}
pub type GatewayGuildSoundboardSoundCreateDispatch =
_DataPayload<GatewayDispatchEvents, GatewayGuildSoundboardSoundCreateDispatchData>;
pub type GatewayGuildSoundboardSoundCreateDispatchData = APISoundboardSound;
pub type GatewayGuildSoundboardSoundUpdateDispatch =
_DataPayload<GatewayDispatchEvents, GatewayGuildSoundboardSoundUpdateDispatchData>;
pub type GatewayGuildSoundboardSoundUpdateDispatchData = APISoundboardSound;
pub type GatewayGuildSoundboardSoundDeleteDispatch =
_DataPayload<GatewayDispatchEvents, GatewayGuildSoundboardSoundDeleteDispatchData>;
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct GatewayGuildSoundboardSoundDeleteDispatchData {
pub sound_id: String,
pub guild_id: String,
}
pub type GatewayGuildSoundboardSoundsUpdateDispatch =
_DataPayload<GatewayDispatchEvents, GatewayGuildSoundboardSoundsUpdateDispatchData>;
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct GatewayGuildSoundboardSoundsUpdateDispatchData {
pub soundboard_sounds: Vec<APISoundboardSound>,
pub guild_id: String,
}
pub type GatewaySoundboardSoundsDispatch =
_DataPayload<GatewayDispatchEvents, GatewaySoundboardSoundsDispatchData>;
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct GatewaySoundboardSoundsDispatchData {
pub soundboard_sounds: Vec<APISoundboardSound>,
pub guild_id: String,
}
pub type GatewayIntegrationCreateDispatch =
_DataPayload<GatewayDispatchEvents, GatewayIntegrationCreateDispatchData>;
pub type GatewayIntegrationCreateDispatchData = APIGuildIntegrationWithGuild;
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct APIGuildIntegrationWithGuild {
pub guild_id: String,
#[serde(flatten)]
pub integration: APIGuildIntegration,
}
pub type GatewayIntegrationUpdateDispatch =
_DataPayload<GatewayDispatchEvents, GatewayIntegrationUpdateDispatchData>;
pub type GatewayIntegrationUpdateDispatchData = APIGuildIntegrationWithGuild;
pub type GatewayIntegrationDeleteDispatch =
_DataPayload<GatewayDispatchEvents, GatewayIntegrationDeleteDispatchData>;
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct GatewayIntegrationDeleteDispatchData {
pub id: String,
pub guild_id: String,
pub application_id: Option<String>,
}
pub type GatewayInteractionCreateDispatch =
_DataPayload<GatewayDispatchEvents, GatewayInteractionCreateDispatchData>;
pub type GatewayInteractionCreateDispatchData = APIInteraction;
pub type GatewayInviteCreateDispatch =
_DataPayload<GatewayDispatchEvents, GatewayInviteCreateDispatchData>;
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct GatewayInviteCreateDispatchData {
pub channel_id: String,
pub code: String,
pub created_at: i64,
pub guild_id: Option<String>,
pub inviter: Option<APIUser>,
pub max_age: i64,
pub max_uses: i64,
pub target_type: Option<InviteTargetType>,
pub target_user: Option<APIUser>,
pub target_application: Option<APIApplication>,
pub temporary: bool,
pub uses: i64,
}
pub type GatewayInviteDeleteDispatch =
_DataPayload<GatewayDispatchEvents, GatewayInviteDeleteDispatchData>;
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct GatewayInviteDeleteDispatchData {
pub channel_id: String,
pub guild_id: Option<String>,
pub code: String,
}
pub type GatewayMessageCreateDispatch =
_DataPayload<GatewayDispatchEvents, GatewayMessageCreateDispatchData>;
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct GatewayMessageCreateDispatchData {
#[serde(flatten)]
pub extra: GatewayMessageEventExtraFields,
#[serde(flatten)]
pub message: APIBaseMessage,
}
impl GatewayMessageCreateDispatchData {
pub fn is_bot(&self) -> bool {
self.message.author.bot.unwrap_or(false)
}
}
pub type GatewayMessageUpdateDispatch =
_DataPayload<GatewayDispatchEvents, GatewayMessageUpdateDispatchData>;
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct GatewayMessageUpdateDispatchData {
#[serde(flatten)]
pub extra: GatewayMessageEventExtraFields,
#[serde(flatten)]
pub message: APIBaseMessage,
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct APIGuildMemberNoUser {
#[serde(flatten)]
pub base: APIBaseGuildMember,
#[serde(flatten)]
pub flagged: APIFlaggedGuildMember,
#[serde(flatten)]
pub avatar: APIGuildMemberAvatar,
#[serde(flatten)]
pub joined: APIGuildMemberJoined,
#[serde(flatten)]
pub voice: APIBaseVoiceGuildMember,
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct APIUserWithMember {
pub member: Option<APIGuildMemberNoUser>,
#[serde(flatten)]
pub user: APIUser,
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct GatewayMessageEventExtraFields {
pub guild_id: Option<String>,
pub member: Option<APIGuildMemberNoUser>,
pub mentions: Vec<APIUserWithMember>,
}
pub type GatewayMessageDeleteDispatch =
_DataPayload<GatewayDispatchEvents, GatewayMessageDeleteDispatchData>;
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct GatewayMessageDeleteDispatchData {
pub id: String,
pub channel_id: String,
pub guild_id: Option<String>,
}
pub type GatewayMessageDeleteBulkDispatch =
_DataPayload<GatewayDispatchEvents, GatewayMessageDeleteBulkDispatchData>;
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct GatewayMessageDeleteBulkDispatchData {
pub ids: Vec<String>,
pub channel_id: String,
pub guild_id: Option<String>,
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct GatewayMessageReactionAddDispatchData {
pub member: Option<APIGuildMember>,
pub message_author_id: Option<String>,
pub burst_colors: Option<Vec<String>>,
pub user_id: String,
pub channel_id: String,
pub message_id: String,
pub guild_id: Option<String>,
pub emoji: APIEmoji,
pub burst: bool,
pub r#type: u8,
}
pub type GatewayMessageReactionAddDispatch =
_DataPayload<GatewayDispatchEvents, GatewayMessageReactionAddDispatchData>;
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct GatewayMessageReactionRemoveDispatchData {
pub user_id: String,
pub channel_id: String,
pub message_id: String,
pub guild_id: Option<String>,
pub emoji: APIEmoji,
pub burst: bool,
pub r#type: u8,
}
pub type GatewayMessageReactionRemoveDispatch =
_DataPayload<GatewayDispatchEvents, GatewayMessageReactionRemoveDispatchData>;
pub type GatewayMessageReactionRemoveAllDispatch =
_DataPayload<GatewayDispatchEvents, GatewayMessageReactionRemoveAllDispatchData>;
pub type GatewayMessageReactionRemoveAllDispatchData = GatewayMessageReactionRemoveData;
pub type GatewayMessageReactionRemoveEmojiDispatch =
_DataPayload<GatewayDispatchEvents, GatewayMessageReactionRemoveEmojiDispatchData>;
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct GatewayMessageReactionRemoveEmojiDispatchData {
pub emoji: APIEmoji,
pub channel_id: String,
pub message_id: String,
pub guild_id: Option<String>,
}
pub type GatewayPresenceUpdateDispatch =
_DataPayload<GatewayDispatchEvents, GatewayPresenceUpdateDispatchData>;
pub type GatewayPresenceUpdateDispatchData = GatewayPresenceUpdate;
pub type GatewayStageInstanceCreateDispatch =
_DataPayload<GatewayDispatchEvents, GatewayStageInstanceCreateDispatchData>;
pub type GatewayStageInstanceCreateDispatchData = APIStageInstance;
pub type GatewayStageInstanceDeleteDispatch =
_DataPayload<GatewayDispatchEvents, GatewayStageInstanceDeleteDispatchData>;
pub type GatewayStageInstanceDeleteDispatchData = APIStageInstance;
pub type GatewayStageInstanceUpdateDispatch =
_DataPayload<GatewayDispatchEvents, GatewayStageInstanceUpdateDispatchData>;
pub type GatewayStageInstanceUpdateDispatchData = APIStageInstance;
pub type GatewayThreadListSyncDispatch =
_DataPayload<GatewayDispatchEvents, GatewayThreadListSyncDispatchData>;
pub type GatewayThreadListSyncDispatchData = GatewayThreadListSync;
pub type GatewayThreadMembersUpdateDispatch =
_DataPayload<GatewayDispatchEvents, GatewayThreadMembersUpdateDispatchData>;
pub type GatewayThreadMembersUpdateDispatchData = RawGatewayThreadMembersUpdate;
pub type GatewayThreadMemberUpdateDispatch =
_DataPayload<GatewayDispatchEvents, GatewayThreadMemberUpdateDispatchData>;
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct GatewayThreadMemberUpdateDispatchData {
pub guild_id: String,
#[serde(flatten)]
pub member: APIThreadMember,
}
pub type GatewayThreadModifyDispatch = _DataPayload<GatewayDispatchEvents, APIThreadChannel>;
pub type GatewayThreadCreateDispatch =
_DataPayload<GatewayDispatchEvents, GatewayThreadCreateDispatchData>;
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct GatewayThreadCreateDispatchData {
pub newly_created: Option<bool>,
#[serde(flatten)]
pub thread: APIThreadChannel,
}
pub type GatewayThreadUpdateDispatch =
_DataPayload<GatewayDispatchEvents, GatewayThreadUpdateDispatchData>;
pub type GatewayThreadUpdateDispatchData = APIThreadChannel;
pub type GatewayThreadDeleteDispatch =
_DataPayload<GatewayDispatchEvents, GatewayThreadDeleteDispatchData>;
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct GatewayThreadDeleteDispatchData {
pub id: String,
pub guild_id: String,
pub parent_id: String,
pub r#type: ChannelType,
}
pub type GatewayTypingStartDispatch =
_DataPayload<GatewayDispatchEvents, GatewayTypingStartDispatchData>;
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct GatewayTypingStartDispatchData {
pub channel_id: String,
pub guild_id: Option<String>,
pub user_id: String,
pub timestamp: i64,
pub member: Option<APIGuildMember>,
}
pub type GatewayUserUpdateDispatch =
_DataPayload<GatewayDispatchEvents, GatewayUserUpdateDispatchData>;
pub type GatewayUserUpdateDispatchData = APIUser;
pub type GatewayVoiceChannelEffectSendDispatch =
_DataPayload<GatewayDispatchEvents, GatewayVoiceChannelEffectSendDispatchData>;
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct GatewayVoiceChannelEffectSendDispatchData {
pub channel_id: String,
pub guild_id: String,
pub user_id: String,
pub emoji: Option<APIEmoji>,
pub animation_type: Option<VoiceChannelEffectSendAnimationType>,
pub animation_id: Option<i64>,
pub sound_id: Option<StringOrNumber>,
pub sound_volume: Option<f64>,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub enum VoiceChannelEffectSendAnimationType {
Premium,
Basic,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(untagged)]
pub enum StringOrNumber {
String(String),
Number(i64),
}
pub type GatewayVoiceStateUpdateDispatch =
_DataPayload<GatewayDispatchEvents, GatewayVoiceStateUpdateDispatchData>;
pub type GatewayVoiceStateUpdateDispatchData = APIVoiceState;
pub type GatewayVoiceServerUpdateDispatch =
_DataPayload<GatewayDispatchEvents, GatewayVoiceServerUpdateDispatchData>;
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct GatewayVoiceServerUpdateDispatchData {
pub token: String,
pub guild_id: String,
pub endpoint: Option<String>,
}
pub type GatewayWebhooksUpdateDispatch =
_DataPayload<GatewayDispatchEvents, GatewayWebhooksUpdateDispatchData>;
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct GatewayWebhooksUpdateDispatchData {
pub guild_id: String,
pub channel_id: String,
}
pub type GatewayGuildAuditLogEntryCreateDispatch =
_DataPayload<GatewayDispatchEvents, GatewayGuildAuditLogEntryCreateDispatchData>;
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct GatewayGuildAuditLogEntryCreateDispatchData {
pub guild_id: String,
#[serde(flatten)]
pub entry: APIAuditLogEntry,
}
pub type GatewayMessagePollVoteAddDispatch =
_DataPayload<GatewayDispatchEvents, GatewayMessagePollVoteDispatchData>;
pub type GatewayMessagePollVoteRemoveDispatch =
_DataPayload<GatewayDispatchEvents, GatewayMessagePollVoteDispatchData>;
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct GatewayMessagePollVoteDispatchData {
pub user_id: String,
pub channel_id: String,
pub message_id: String,
pub guild_id: Option<String>,
pub answer_id: i64,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct GatewayHeartbeat {
pub op: GatewayOpcodes,
pub d: GatewayHeartbeatData,
}
pub type GatewayHeartbeatData = Option<i64>;
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct GatewayIdentify {
pub op: GatewayOpcodes,
pub d: GatewayIdentifyData,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct GatewayIdentifyData {
pub token: String,
pub properties: GatewayIdentifyProperties,
pub compress: Option<bool>,
pub large_threshold: Option<i64>,
pub shard: Option<(i64, i64)>,
pub presence: Option<GatewayPresenceUpdateData>,
pub intents: i64,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct GatewayIdentifyProperties {
pub os: String,
pub browser: String,
pub device: String,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct GatewayResume {
pub op: GatewayOpcodes,
pub d: GatewayResumeData,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct GatewayResumeData {
pub token: String,
pub session_id: String,
pub seq: i64,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct GatewayRequestGuildMembers {
pub op: GatewayOpcodes,
pub d: GatewayRequestGuildMembersData,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct GatewayRequestGuildMembersDataBase {
pub guild_id: String,
pub presences: Option<bool>,
pub nonce: Option<String>,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct GatewayRequestGuildMembersDataWithUserIds {
#[serde(flatten)]
pub base: GatewayRequestGuildMembersDataBase,
pub user_ids: StringOrStrings,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(untagged)]
pub enum StringOrStrings {
One(String),
Many(Vec<String>),
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct GatewayRequestGuildMembersDataWithQuery {
#[serde(flatten)]
pub base: GatewayRequestGuildMembersDataBase,
pub query: String,
pub limit: i64,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GatewayRequestGuildMembersData {
WithQuery(GatewayRequestGuildMembersDataWithQuery),
WithUserIds(GatewayRequestGuildMembersDataWithUserIds),
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct GatewayRequestSoundboardSounds {
pub op: GatewayOpcodes,
pub d: GatewayRequestSoundboardSoundsData,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct GatewayRequestSoundboardSoundsData {
pub guild_ids: Vec<String>,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct GatewayVoiceStateUpdate {
pub op: GatewayOpcodes,
pub d: GatewayVoiceStateUpdateData,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct GatewayVoiceStateUpdateData {
pub guild_id: String,
pub channel_id: Option<String>,
pub self_mute: bool,
pub self_deaf: bool,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct GatewayUpdatePresence {
pub op: GatewayOpcodes,
pub d: GatewayPresenceUpdateData,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct GatewayPresenceUpdateData {
pub since: Option<i64>,
pub activities: Vec<GatewayActivityUpdateData>,
pub status: PresenceUpdateStatus,
pub afk: bool,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct GatewayActivityUpdateData {
pub name: Option<String>,
pub state: Option<String>,
#[serde(rename = "type")]
pub r#type: Option<i64>,
pub url: Option<String>,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct _BaseBasePayload {
pub op: GatewayOpcodes,
pub d: Option<serde_json::Value>,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct _BasePayload {
pub s: i64,
pub t: Option<String>,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct _NonDispatchPayload {
pub t: Option<serde_json::Value>,
pub s: Option<serde_json::Value>,
#[serde(flatten)]
pub base: _BaseBasePayload,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct _DataPayload<Event, D> {
pub op: GatewayOpcodes,
pub t: Event,
pub d: D,
pub s: i64,
}
pub type GatewayMessageReactionData<E> = _DataPayload<E, GatewayMessageReactionAddDispatchData>;
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct GatewayMessageReactionRemoveData {
pub channel_id: String,
pub message_id: String,
pub guild_id: Option<String>,
}