123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269 |
- package discordgo
- import (
- "encoding/json"
- )
- // This file contains all the possible structs that can be
- // handled by AddHandler/EventHandler.
- // DO NOT ADD ANYTHING BUT EVENT HANDLER STRUCTS TO THIS FILE.
- //go:generate go run tools/cmd/eventhandlers/main.go
- // Connect is the data for a Connect event.
- // This is a synthetic event and is not dispatched by Discord.
- type Connect struct{}
- // Disconnect is the data for a Disconnect event.
- // This is a synthetic event and is not dispatched by Discord.
- type Disconnect struct{}
- // RateLimit is the data for a RateLimit event.
- // This is a synthetic event and is not dispatched by Discord.
- type RateLimit struct {
- *TooManyRequests
- URL string
- }
- // Event provides a basic initial struct for all websocket events.
- type Event struct {
- Operation int `json:"op"`
- Sequence int64 `json:"s"`
- Type string `json:"t"`
- RawData json.RawMessage `json:"d"`
- // Struct contains one of the other types in this file.
- Struct interface{} `json:"-"`
- }
- // A Ready stores all data for the websocket READY event.
- type Ready struct {
- Version int `json:"v"`
- SessionID string `json:"session_id"`
- User *User `json:"user"`
- ReadState []*ReadState `json:"read_state"`
- PrivateChannels []*Channel `json:"private_channels"`
- Guilds []*Guild `json:"guilds"`
- // Undocumented fields
- Settings *Settings `json:"user_settings"`
- UserGuildSettings []*UserGuildSettings `json:"user_guild_settings"`
- Relationships []*Relationship `json:"relationships"`
- Presences []*Presence `json:"presences"`
- Notes map[string]string `json:"notes"`
- }
- // ChannelCreate is the data for a ChannelCreate event.
- type ChannelCreate struct {
- *Channel
- }
- // ChannelUpdate is the data for a ChannelUpdate event.
- type ChannelUpdate struct {
- *Channel
- }
- // ChannelDelete is the data for a ChannelDelete event.
- type ChannelDelete struct {
- *Channel
- }
- // ChannelPinsUpdate stores data for a ChannelPinsUpdate event.
- type ChannelPinsUpdate struct {
- LastPinTimestamp string `json:"last_pin_timestamp"`
- ChannelID string `json:"channel_id"`
- GuildID string `json:"guild_id,omitempty"`
- }
- // GuildCreate is the data for a GuildCreate event.
- type GuildCreate struct {
- *Guild
- }
- // GuildUpdate is the data for a GuildUpdate event.
- type GuildUpdate struct {
- *Guild
- }
- // GuildDelete is the data for a GuildDelete event.
- type GuildDelete struct {
- *Guild
- }
- // GuildBanAdd is the data for a GuildBanAdd event.
- type GuildBanAdd struct {
- User *User `json:"user"`
- GuildID string `json:"guild_id"`
- }
- // GuildBanRemove is the data for a GuildBanRemove event.
- type GuildBanRemove struct {
- User *User `json:"user"`
- GuildID string `json:"guild_id"`
- }
- // GuildMemberAdd is the data for a GuildMemberAdd event.
- type GuildMemberAdd struct {
- *Member
- }
- // GuildMemberUpdate is the data for a GuildMemberUpdate event.
- type GuildMemberUpdate struct {
- *Member
- }
- // GuildMemberRemove is the data for a GuildMemberRemove event.
- type GuildMemberRemove struct {
- *Member
- }
- // GuildRoleCreate is the data for a GuildRoleCreate event.
- type GuildRoleCreate struct {
- *GuildRole
- }
- // GuildRoleUpdate is the data for a GuildRoleUpdate event.
- type GuildRoleUpdate struct {
- *GuildRole
- }
- // A GuildRoleDelete is the data for a GuildRoleDelete event.
- type GuildRoleDelete struct {
- RoleID string `json:"role_id"`
- GuildID string `json:"guild_id"`
- }
- // A GuildEmojisUpdate is the data for a guild emoji update event.
- type GuildEmojisUpdate struct {
- GuildID string `json:"guild_id"`
- Emojis []*Emoji `json:"emojis"`
- }
- // A GuildMembersChunk is the data for a GuildMembersChunk event.
- type GuildMembersChunk struct {
- GuildID string `json:"guild_id"`
- Members []*Member `json:"members"`
- ChunkIndex int `json:"chunk_index"`
- ChunkCount int `json:"chunk_count"`
- Presences []*Presence `json:"presences,omitempty"`
- }
- // GuildIntegrationsUpdate is the data for a GuildIntegrationsUpdate event.
- type GuildIntegrationsUpdate struct {
- GuildID string `json:"guild_id"`
- }
- // MessageAck is the data for a MessageAck event.
- type MessageAck struct {
- MessageID string `json:"message_id"`
- ChannelID string `json:"channel_id"`
- }
- // MessageCreate is the data for a MessageCreate event.
- type MessageCreate struct {
- *Message
- }
- // MessageUpdate is the data for a MessageUpdate event.
- type MessageUpdate struct {
- *Message
- // BeforeUpdate will be nil if the Message was not previously cached in the state cache.
- BeforeUpdate *Message `json:"-"`
- }
- // MessageDelete is the data for a MessageDelete event.
- type MessageDelete struct {
- *Message
- BeforeDelete *Message `json:"-"`
- }
- // MessageReactionAdd is the data for a MessageReactionAdd event.
- type MessageReactionAdd struct {
- *MessageReaction
- }
- // MessageReactionRemove is the data for a MessageReactionRemove event.
- type MessageReactionRemove struct {
- *MessageReaction
- }
- // MessageReactionRemoveAll is the data for a MessageReactionRemoveAll event.
- type MessageReactionRemoveAll struct {
- *MessageReaction
- }
- // PresencesReplace is the data for a PresencesReplace event.
- type PresencesReplace []*Presence
- // PresenceUpdate is the data for a PresenceUpdate event.
- type PresenceUpdate struct {
- Presence
- GuildID string `json:"guild_id"`
- }
- // Resumed is the data for a Resumed event.
- type Resumed struct {
- Trace []string `json:"_trace"`
- }
- // RelationshipAdd is the data for a RelationshipAdd event.
- type RelationshipAdd struct {
- *Relationship
- }
- // RelationshipRemove is the data for a RelationshipRemove event.
- type RelationshipRemove struct {
- *Relationship
- }
- // TypingStart is the data for a TypingStart event.
- type TypingStart struct {
- UserID string `json:"user_id"`
- ChannelID string `json:"channel_id"`
- GuildID string `json:"guild_id,omitempty"`
- Timestamp int `json:"timestamp"`
- }
- // UserUpdate is the data for a UserUpdate event.
- type UserUpdate struct {
- *User
- }
- // UserSettingsUpdate is the data for a UserSettingsUpdate event.
- type UserSettingsUpdate map[string]interface{}
- // UserGuildSettingsUpdate is the data for a UserGuildSettingsUpdate event.
- type UserGuildSettingsUpdate struct {
- *UserGuildSettings
- }
- // UserNoteUpdate is the data for a UserNoteUpdate event.
- type UserNoteUpdate struct {
- ID string `json:"id"`
- Note string `json:"note"`
- }
- // VoiceServerUpdate is the data for a VoiceServerUpdate event.
- type VoiceServerUpdate struct {
- Token string `json:"token"`
- GuildID string `json:"guild_id"`
- Endpoint string `json:"endpoint"`
- }
- // VoiceStateUpdate is the data for a VoiceStateUpdate event.
- type VoiceStateUpdate struct {
- *VoiceState
- // BeforeUpdate will be nil if the VoiceState was not previously cached in the state cache.
- BeforeUpdate *VoiceState `json:"-"`
- }
- // MessageDeleteBulk is the data for a MessageDeleteBulk event
- type MessageDeleteBulk struct {
- Messages []string `json:"ids"`
- ChannelID string `json:"channel_id"`
- GuildID string `json:"guild_id"`
- }
- // WebhooksUpdate is the data for a WebhooksUpdate event
- type WebhooksUpdate struct {
- GuildID string `json:"guild_id"`
- ChannelID string `json:"channel_id"`
- }
|