d
· 7.0 KiB · D
Orginalformat
type EventHandlers struct {
// Not an actual revolt event, this is a sink that allows you to provide a function for raw event handling
RawSinkFunc func(w *GatewayClient, data []byte, typ string)
// An error occurred which meant you couldn't authenticate.
//
// <Note that grevolt handles these for you in general, but you can provide additional logic here>
Error func(w *GatewayClient, ctx *EventContext, e *events.Error)
// The server has authenticated your connection and you will shortly start receiving data.
Authenticated func(w *GatewayClient, ctx *EventContext, e *events.Authenticated)
// Several events have been sent, process each item of v as its own event.
//
// <Note that grevolt handles these for you in general, but you can provide additional logic here>
Bulk func(w *GatewayClient, ctx *EventContext, e *events.Bulk)
// Ping response from the server.
//
// <Note that grevolt handles these for you in general, but you can provide additional logic here>
Pong func(w *GatewayClient, ctx *EventContext, e *events.Pong)
// Data for use by client, data structures match the API specification
Ready func(w *GatewayClient, ctx *EventContext, e *events.Ready)
// Message received, the event object has the same schema as the Message object in the API with the addition of an event type.
Message func(w *GatewayClient, ctx *EventContext, e *events.Message)
// Message edited or otherwise updated.
MessageUpdate func(w *GatewayClient, ctx *EventContext, e *events.MessageUpdate)
// Message has data being appended to it.
MessageAppend func(w *GatewayClient, ctx *EventContext, e *events.MessageAppend)
// Message has been deleted.
MessageDelete func(w *GatewayClient, ctx *EventContext, e *events.MessageDelete)
// A reaction has been added to a message.
MessageReact func(w *GatewayClient, ctx *EventContext, e *events.MessageReact)
// A reaction has been removed from a message.
MessageUnreact func(w *GatewayClient, ctx *EventContext, e *events.MessageUnreact)
// A certain reaction has been removed from the message.
//
// <the difference between this and MessageUnreact is that
// this event is sent when a user with manage messages removes
// a reaction while MessageUnreact is sent when a user removes
// their own reaction>
MessageRemoveReaction func(w *GatewayClient, ctx *EventContext, e *events.MessageRemoveReaction)
// Channel created, the event object has the same schema as the Channel object in the API with the addition of an event type.
ChannelCreate func(w *GatewayClient, ctx *EventContext, e *events.ChannelCreate)
// Channel details updated.
ChannelUpdate func(w *GatewayClient, ctx *EventContext, e *events.ChannelUpdate)
// Channel has been deleted.
ChannelDelete func(w *GatewayClient, ctx *EventContext, e *events.ChannelDelete)
// A user has joined the group.
ChannelGroupJoin func(w *GatewayClient, ctx *EventContext, e *events.ChannelGroupJoin)
// A user has left the group.
ChannelGroupLeave func(w *GatewayClient, ctx *EventContext, e *events.ChannelGroupLeave)
// A user has started typing in this channel.
ChannelStartTyping func(w *GatewayClient, ctx *EventContext, e *events.ChannelStartTyping)
// A user has stopped typing in this channel.
ChannelStopTyping func(w *GatewayClient, ctx *EventContext, e *events.ChannelStopTyping)
// You have acknowledged new messages in this channel up to this message ID.
//
// <official docs say the above, but it should be 'A user' instead of 'you'?>
ChannelAck func(w *GatewayClient, ctx *EventContext, e *events.ChannelAck)
// Server created, the event object has the same schema as the SERVER object in the API with the addition of an event type.
ServerCreate func(w *GatewayClient, ctx *EventContext, e *events.ServerCreate)
// Server details updated.
ServerUpdate func(w *GatewayClient, ctx *EventContext, e *events.ServerUpdate)
// Server has been deleted.
ServerDelete func(w *GatewayClient, ctx *EventContext, e *events.ServerDelete)
// Server member details updated.
ServerMemberUpdate func(w *GatewayClient, ctx *EventContext, e *events.ServerMemberUpdate)
// A user has joined the group.
//
// <this should be server, not group>
ServerMemberJoin func(w *GatewayClient, ctx *EventContext, e *events.ServerMemberJoin)
// A user has left the group.
//
// <this should be server, not group>
ServerMemberLeave func(w *GatewayClient, ctx *EventContext, e *events.ServerMemberLeave)
// Server role has been updated or created.
ServerRoleUpdate func(w *GatewayClient, ctx *EventContext, e *events.ServerRoleUpdate)
// Server role has been deleted.
ServerRoleDelete func(w *GatewayClient, ctx *EventContext, e *events.ServerRoleDelete)
// User has been updated.
UserUpdate func(w *GatewayClient, ctx *EventContext, e *events.UserUpdate)
// Your relationship with another user has changed.
UserRelationship func(w *GatewayClient, ctx *EventContext, e *events.UserRelationship)
// Settings updated remotely
//
// <undocumented, will likely be available in a future release>
UserSettingsUpdate func(w *GatewayClient, ctx *EventContext, e *events.UserSettingsUpdate)
// User has been platform banned or deleted their account
//
// Clients should remove the following associated data:
// - Messages
// - DM Channels
// - Relationships
// - Server Memberships
//
// User flags are specified to explain why a wipe is occurring though not all reasons will necessarily ever appear.
UserPlatformWipe func(w *GatewayClient, ctx *EventContext, e *events.UserPlatformWipe)
// Emoji created, the event object has the same schema as the Emoji object in the API with the addition of an event type.
EmojiCreate func(w *GatewayClient, ctx *EventContext, e *events.EmojiCreate)
// Emoji has been deleted.
EmojiDelete func(w *GatewayClient, ctx *EventContext, e *events.EmojiDelete)
// New report
//
// <undocumented, will likely be available in a future release>
ReportCreate func(w *GatewayClient, ctx *EventContext, e *events.ReportCreate)
// Forwarded events from rAuth, currently only session deletion events are forwarded.
//
// <this event is special, you likely want AuthDeleteSession and AuthDeleteAllSessions instead>
Auth func(w *GatewayClient, ctx *EventContext, e *events.Auth)
// A session has been deleted.
//
// Eq: Auth->DeleteSession
AuthDeleteSession func(w *GatewayClient, ctx *EventContext, e *events.AuthDeleteSession)
// All sessions for this account have been deleted, optionally excluding a given ID.
//
// Eq: Auth->DeleteAllSessions
AuthDeleteAllSessions func(w *GatewayClient, ctx *EventContext, e *events.AuthDeleteAllSessions)
// New webhook
//
// <undocumented, will likely be available in a future release>
WebhookCreate func(w *GatewayClient, ctx *EventContext, e *events.WebhookCreate)
// Update existing webhook
//
// <undocumented, will likely be available in a future release>
WebhookUpdate func(w *GatewayClient, ctx *EventContext, e *events.WebhookUpdate)
// Delete existing webhook
//
// <undocumented, will likely be available in a future release>
WebhookDelete func(w *GatewayClient, ctx *EventContext, e *events.WebhookDelete)
}
1 | type EventHandlers struct { |
2 | // Not an actual revolt event, this is a sink that allows you to provide a function for raw event handling |
3 | RawSinkFunc func(w *GatewayClient, data []byte, typ string) |
4 | |
5 | // An error occurred which meant you couldn't authenticate. |
6 | // |
7 | // <Note that grevolt handles these for you in general, but you can provide additional logic here> |
8 | Error func(w *GatewayClient, ctx *EventContext, e *events.Error) |
9 | |
10 | // The server has authenticated your connection and you will shortly start receiving data. |
11 | Authenticated func(w *GatewayClient, ctx *EventContext, e *events.Authenticated) |
12 | |
13 | // Several events have been sent, process each item of v as its own event. |
14 | // |
15 | // <Note that grevolt handles these for you in general, but you can provide additional logic here> |
16 | Bulk func(w *GatewayClient, ctx *EventContext, e *events.Bulk) |
17 | |
18 | // Ping response from the server. |
19 | // |
20 | // <Note that grevolt handles these for you in general, but you can provide additional logic here> |
21 | Pong func(w *GatewayClient, ctx *EventContext, e *events.Pong) |
22 | |
23 | // Data for use by client, data structures match the API specification |
24 | Ready func(w *GatewayClient, ctx *EventContext, e *events.Ready) |
25 | |
26 | // Message received, the event object has the same schema as the Message object in the API with the addition of an event type. |
27 | Message func(w *GatewayClient, ctx *EventContext, e *events.Message) |
28 | |
29 | // Message edited or otherwise updated. |
30 | MessageUpdate func(w *GatewayClient, ctx *EventContext, e *events.MessageUpdate) |
31 | |
32 | // Message has data being appended to it. |
33 | MessageAppend func(w *GatewayClient, ctx *EventContext, e *events.MessageAppend) |
34 | |
35 | // Message has been deleted. |
36 | MessageDelete func(w *GatewayClient, ctx *EventContext, e *events.MessageDelete) |
37 | |
38 | // A reaction has been added to a message. |
39 | MessageReact func(w *GatewayClient, ctx *EventContext, e *events.MessageReact) |
40 | |
41 | // A reaction has been removed from a message. |
42 | MessageUnreact func(w *GatewayClient, ctx *EventContext, e *events.MessageUnreact) |
43 | |
44 | // A certain reaction has been removed from the message. |
45 | // |
46 | // <the difference between this and MessageUnreact is that |
47 | // this event is sent when a user with manage messages removes |
48 | // a reaction while MessageUnreact is sent when a user removes |
49 | // their own reaction> |
50 | MessageRemoveReaction func(w *GatewayClient, ctx *EventContext, e *events.MessageRemoveReaction) |
51 | |
52 | // Channel created, the event object has the same schema as the Channel object in the API with the addition of an event type. |
53 | ChannelCreate func(w *GatewayClient, ctx *EventContext, e *events.ChannelCreate) |
54 | |
55 | // Channel details updated. |
56 | ChannelUpdate func(w *GatewayClient, ctx *EventContext, e *events.ChannelUpdate) |
57 | |
58 | // Channel has been deleted. |
59 | ChannelDelete func(w *GatewayClient, ctx *EventContext, e *events.ChannelDelete) |
60 | |
61 | // A user has joined the group. |
62 | ChannelGroupJoin func(w *GatewayClient, ctx *EventContext, e *events.ChannelGroupJoin) |
63 | |
64 | // A user has left the group. |
65 | ChannelGroupLeave func(w *GatewayClient, ctx *EventContext, e *events.ChannelGroupLeave) |
66 | |
67 | // A user has started typing in this channel. |
68 | ChannelStartTyping func(w *GatewayClient, ctx *EventContext, e *events.ChannelStartTyping) |
69 | |
70 | // A user has stopped typing in this channel. |
71 | ChannelStopTyping func(w *GatewayClient, ctx *EventContext, e *events.ChannelStopTyping) |
72 | |
73 | // You have acknowledged new messages in this channel up to this message ID. |
74 | // |
75 | // <official docs say the above, but it should be 'A user' instead of 'you'?> |
76 | ChannelAck func(w *GatewayClient, ctx *EventContext, e *events.ChannelAck) |
77 | |
78 | // Server created, the event object has the same schema as the SERVER object in the API with the addition of an event type. |
79 | ServerCreate func(w *GatewayClient, ctx *EventContext, e *events.ServerCreate) |
80 | |
81 | // Server details updated. |
82 | ServerUpdate func(w *GatewayClient, ctx *EventContext, e *events.ServerUpdate) |
83 | |
84 | // Server has been deleted. |
85 | ServerDelete func(w *GatewayClient, ctx *EventContext, e *events.ServerDelete) |
86 | |
87 | // Server member details updated. |
88 | ServerMemberUpdate func(w *GatewayClient, ctx *EventContext, e *events.ServerMemberUpdate) |
89 | |
90 | // A user has joined the group. |
91 | // |
92 | // <this should be server, not group> |
93 | ServerMemberJoin func(w *GatewayClient, ctx *EventContext, e *events.ServerMemberJoin) |
94 | |
95 | // A user has left the group. |
96 | // |
97 | // <this should be server, not group> |
98 | ServerMemberLeave func(w *GatewayClient, ctx *EventContext, e *events.ServerMemberLeave) |
99 | |
100 | // Server role has been updated or created. |
101 | ServerRoleUpdate func(w *GatewayClient, ctx *EventContext, e *events.ServerRoleUpdate) |
102 | |
103 | // Server role has been deleted. |
104 | ServerRoleDelete func(w *GatewayClient, ctx *EventContext, e *events.ServerRoleDelete) |
105 | |
106 | // User has been updated. |
107 | UserUpdate func(w *GatewayClient, ctx *EventContext, e *events.UserUpdate) |
108 | |
109 | // Your relationship with another user has changed. |
110 | UserRelationship func(w *GatewayClient, ctx *EventContext, e *events.UserRelationship) |
111 | |
112 | // Settings updated remotely |
113 | // |
114 | // <undocumented, will likely be available in a future release> |
115 | UserSettingsUpdate func(w *GatewayClient, ctx *EventContext, e *events.UserSettingsUpdate) |
116 | |
117 | // User has been platform banned or deleted their account |
118 | // |
119 | // Clients should remove the following associated data: |
120 | // - Messages |
121 | // - DM Channels |
122 | // - Relationships |
123 | // - Server Memberships |
124 | // |
125 | // User flags are specified to explain why a wipe is occurring though not all reasons will necessarily ever appear. |
126 | UserPlatformWipe func(w *GatewayClient, ctx *EventContext, e *events.UserPlatformWipe) |
127 | |
128 | // Emoji created, the event object has the same schema as the Emoji object in the API with the addition of an event type. |
129 | EmojiCreate func(w *GatewayClient, ctx *EventContext, e *events.EmojiCreate) |
130 | |
131 | // Emoji has been deleted. |
132 | EmojiDelete func(w *GatewayClient, ctx *EventContext, e *events.EmojiDelete) |
133 | |
134 | // New report |
135 | // |
136 | // <undocumented, will likely be available in a future release> |
137 | ReportCreate func(w *GatewayClient, ctx *EventContext, e *events.ReportCreate) |
138 | |
139 | // Forwarded events from rAuth, currently only session deletion events are forwarded. |
140 | // |
141 | // <this event is special, you likely want AuthDeleteSession and AuthDeleteAllSessions instead> |
142 | Auth func(w *GatewayClient, ctx *EventContext, e *events.Auth) |
143 | |
144 | // A session has been deleted. |
145 | // |
146 | // Eq: Auth->DeleteSession |
147 | AuthDeleteSession func(w *GatewayClient, ctx *EventContext, e *events.AuthDeleteSession) |
148 | |
149 | // All sessions for this account have been deleted, optionally excluding a given ID. |
150 | // |
151 | // Eq: Auth->DeleteAllSessions |
152 | AuthDeleteAllSessions func(w *GatewayClient, ctx *EventContext, e *events.AuthDeleteAllSessions) |
153 | |
154 | // New webhook |
155 | // |
156 | // <undocumented, will likely be available in a future release> |
157 | WebhookCreate func(w *GatewayClient, ctx *EventContext, e *events.WebhookCreate) |
158 | |
159 | // Update existing webhook |
160 | // |
161 | // <undocumented, will likely be available in a future release> |
162 | WebhookUpdate func(w *GatewayClient, ctx *EventContext, e *events.WebhookUpdate) |
163 | |
164 | // Delete existing webhook |
165 | // |
166 | // <undocumented, will likely be available in a future release> |
167 | WebhookDelete func(w *GatewayClient, ctx *EventContext, e *events.WebhookDelete) |
168 | } |
169 |