eventhandlers.go 41 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270
  1. // Code generated by \"eventhandlers\"; DO NOT EDIT
  2. // See events.go
  3. package discordgo
  4. // Following are all the event types.
  5. // Event type values are used to match the events returned by Discord.
  6. // EventTypes surrounded by __ are synthetic and are internal to DiscordGo.
  7. const (
  8. channelCreateEventType = "CHANNEL_CREATE"
  9. channelDeleteEventType = "CHANNEL_DELETE"
  10. channelPinsUpdateEventType = "CHANNEL_PINS_UPDATE"
  11. channelUpdateEventType = "CHANNEL_UPDATE"
  12. connectEventType = "__CONNECT__"
  13. disconnectEventType = "__DISCONNECT__"
  14. eventEventType = "__EVENT__"
  15. guildBanAddEventType = "GUILD_BAN_ADD"
  16. guildBanRemoveEventType = "GUILD_BAN_REMOVE"
  17. guildCreateEventType = "GUILD_CREATE"
  18. guildDeleteEventType = "GUILD_DELETE"
  19. guildEmojisUpdateEventType = "GUILD_EMOJIS_UPDATE"
  20. guildIntegrationsUpdateEventType = "GUILD_INTEGRATIONS_UPDATE"
  21. guildMemberAddEventType = "GUILD_MEMBER_ADD"
  22. guildMemberRemoveEventType = "GUILD_MEMBER_REMOVE"
  23. guildMemberUpdateEventType = "GUILD_MEMBER_UPDATE"
  24. guildMembersChunkEventType = "GUILD_MEMBERS_CHUNK"
  25. guildRoleCreateEventType = "GUILD_ROLE_CREATE"
  26. guildRoleDeleteEventType = "GUILD_ROLE_DELETE"
  27. guildRoleUpdateEventType = "GUILD_ROLE_UPDATE"
  28. guildUpdateEventType = "GUILD_UPDATE"
  29. interactionCreateEventType = "INTERACTION_CREATE"
  30. inviteCreateEventType = "INVITE_CREATE"
  31. inviteDeleteEventType = "INVITE_DELETE"
  32. messageAckEventType = "MESSAGE_ACK"
  33. messageCreateEventType = "MESSAGE_CREATE"
  34. messageDeleteEventType = "MESSAGE_DELETE"
  35. messageDeleteBulkEventType = "MESSAGE_DELETE_BULK"
  36. messageReactionAddEventType = "MESSAGE_REACTION_ADD"
  37. messageReactionRemoveEventType = "MESSAGE_REACTION_REMOVE"
  38. messageReactionRemoveAllEventType = "MESSAGE_REACTION_REMOVE_ALL"
  39. messageUpdateEventType = "MESSAGE_UPDATE"
  40. presenceUpdateEventType = "PRESENCE_UPDATE"
  41. presencesReplaceEventType = "PRESENCES_REPLACE"
  42. rateLimitEventType = "__RATE_LIMIT__"
  43. readyEventType = "READY"
  44. relationshipAddEventType = "RELATIONSHIP_ADD"
  45. relationshipRemoveEventType = "RELATIONSHIP_REMOVE"
  46. resumedEventType = "RESUMED"
  47. threadCreateEventType = "THREAD_CREATE"
  48. threadDeleteEventType = "THREAD_DELETE"
  49. threadListSyncEventType = "THREAD_LIST_SYNC"
  50. threadMemberUpdateEventType = "THREAD_MEMBER_UPDATE"
  51. threadMembersUpdateEventType = "THREAD_MEMBERS_UPDATE"
  52. threadUpdateEventType = "THREAD_UPDATE"
  53. typingStartEventType = "TYPING_START"
  54. userGuildSettingsUpdateEventType = "USER_GUILD_SETTINGS_UPDATE"
  55. userNoteUpdateEventType = "USER_NOTE_UPDATE"
  56. userSettingsUpdateEventType = "USER_SETTINGS_UPDATE"
  57. userUpdateEventType = "USER_UPDATE"
  58. voiceServerUpdateEventType = "VOICE_SERVER_UPDATE"
  59. voiceStateUpdateEventType = "VOICE_STATE_UPDATE"
  60. webhooksUpdateEventType = "WEBHOOKS_UPDATE"
  61. )
  62. // channelCreateEventHandler is an event handler for ChannelCreate events.
  63. type channelCreateEventHandler func(*Session, *ChannelCreate)
  64. // Type returns the event type for ChannelCreate events.
  65. func (eh channelCreateEventHandler) Type() string {
  66. return channelCreateEventType
  67. }
  68. // New returns a new instance of ChannelCreate.
  69. func (eh channelCreateEventHandler) New() interface{} {
  70. return &ChannelCreate{}
  71. }
  72. // Handle is the handler for ChannelCreate events.
  73. func (eh channelCreateEventHandler) Handle(s *Session, i interface{}) {
  74. if t, ok := i.(*ChannelCreate); ok {
  75. eh(s, t)
  76. }
  77. }
  78. // channelDeleteEventHandler is an event handler for ChannelDelete events.
  79. type channelDeleteEventHandler func(*Session, *ChannelDelete)
  80. // Type returns the event type for ChannelDelete events.
  81. func (eh channelDeleteEventHandler) Type() string {
  82. return channelDeleteEventType
  83. }
  84. // New returns a new instance of ChannelDelete.
  85. func (eh channelDeleteEventHandler) New() interface{} {
  86. return &ChannelDelete{}
  87. }
  88. // Handle is the handler for ChannelDelete events.
  89. func (eh channelDeleteEventHandler) Handle(s *Session, i interface{}) {
  90. if t, ok := i.(*ChannelDelete); ok {
  91. eh(s, t)
  92. }
  93. }
  94. // channelPinsUpdateEventHandler is an event handler for ChannelPinsUpdate events.
  95. type channelPinsUpdateEventHandler func(*Session, *ChannelPinsUpdate)
  96. // Type returns the event type for ChannelPinsUpdate events.
  97. func (eh channelPinsUpdateEventHandler) Type() string {
  98. return channelPinsUpdateEventType
  99. }
  100. // New returns a new instance of ChannelPinsUpdate.
  101. func (eh channelPinsUpdateEventHandler) New() interface{} {
  102. return &ChannelPinsUpdate{}
  103. }
  104. // Handle is the handler for ChannelPinsUpdate events.
  105. func (eh channelPinsUpdateEventHandler) Handle(s *Session, i interface{}) {
  106. if t, ok := i.(*ChannelPinsUpdate); ok {
  107. eh(s, t)
  108. }
  109. }
  110. // channelUpdateEventHandler is an event handler for ChannelUpdate events.
  111. type channelUpdateEventHandler func(*Session, *ChannelUpdate)
  112. // Type returns the event type for ChannelUpdate events.
  113. func (eh channelUpdateEventHandler) Type() string {
  114. return channelUpdateEventType
  115. }
  116. // New returns a new instance of ChannelUpdate.
  117. func (eh channelUpdateEventHandler) New() interface{} {
  118. return &ChannelUpdate{}
  119. }
  120. // Handle is the handler for ChannelUpdate events.
  121. func (eh channelUpdateEventHandler) Handle(s *Session, i interface{}) {
  122. if t, ok := i.(*ChannelUpdate); ok {
  123. eh(s, t)
  124. }
  125. }
  126. // connectEventHandler is an event handler for Connect events.
  127. type connectEventHandler func(*Session, *Connect)
  128. // Type returns the event type for Connect events.
  129. func (eh connectEventHandler) Type() string {
  130. return connectEventType
  131. }
  132. // Handle is the handler for Connect events.
  133. func (eh connectEventHandler) Handle(s *Session, i interface{}) {
  134. if t, ok := i.(*Connect); ok {
  135. eh(s, t)
  136. }
  137. }
  138. // disconnectEventHandler is an event handler for Disconnect events.
  139. type disconnectEventHandler func(*Session, *Disconnect)
  140. // Type returns the event type for Disconnect events.
  141. func (eh disconnectEventHandler) Type() string {
  142. return disconnectEventType
  143. }
  144. // Handle is the handler for Disconnect events.
  145. func (eh disconnectEventHandler) Handle(s *Session, i interface{}) {
  146. if t, ok := i.(*Disconnect); ok {
  147. eh(s, t)
  148. }
  149. }
  150. // eventEventHandler is an event handler for Event events.
  151. type eventEventHandler func(*Session, *Event)
  152. // Type returns the event type for Event events.
  153. func (eh eventEventHandler) Type() string {
  154. return eventEventType
  155. }
  156. // Handle is the handler for Event events.
  157. func (eh eventEventHandler) Handle(s *Session, i interface{}) {
  158. if t, ok := i.(*Event); ok {
  159. eh(s, t)
  160. }
  161. }
  162. // guildBanAddEventHandler is an event handler for GuildBanAdd events.
  163. type guildBanAddEventHandler func(*Session, *GuildBanAdd)
  164. // Type returns the event type for GuildBanAdd events.
  165. func (eh guildBanAddEventHandler) Type() string {
  166. return guildBanAddEventType
  167. }
  168. // New returns a new instance of GuildBanAdd.
  169. func (eh guildBanAddEventHandler) New() interface{} {
  170. return &GuildBanAdd{}
  171. }
  172. // Handle is the handler for GuildBanAdd events.
  173. func (eh guildBanAddEventHandler) Handle(s *Session, i interface{}) {
  174. if t, ok := i.(*GuildBanAdd); ok {
  175. eh(s, t)
  176. }
  177. }
  178. // guildBanRemoveEventHandler is an event handler for GuildBanRemove events.
  179. type guildBanRemoveEventHandler func(*Session, *GuildBanRemove)
  180. // Type returns the event type for GuildBanRemove events.
  181. func (eh guildBanRemoveEventHandler) Type() string {
  182. return guildBanRemoveEventType
  183. }
  184. // New returns a new instance of GuildBanRemove.
  185. func (eh guildBanRemoveEventHandler) New() interface{} {
  186. return &GuildBanRemove{}
  187. }
  188. // Handle is the handler for GuildBanRemove events.
  189. func (eh guildBanRemoveEventHandler) Handle(s *Session, i interface{}) {
  190. if t, ok := i.(*GuildBanRemove); ok {
  191. eh(s, t)
  192. }
  193. }
  194. // guildCreateEventHandler is an event handler for GuildCreate events.
  195. type guildCreateEventHandler func(*Session, *GuildCreate)
  196. // Type returns the event type for GuildCreate events.
  197. func (eh guildCreateEventHandler) Type() string {
  198. return guildCreateEventType
  199. }
  200. // New returns a new instance of GuildCreate.
  201. func (eh guildCreateEventHandler) New() interface{} {
  202. return &GuildCreate{}
  203. }
  204. // Handle is the handler for GuildCreate events.
  205. func (eh guildCreateEventHandler) Handle(s *Session, i interface{}) {
  206. if t, ok := i.(*GuildCreate); ok {
  207. eh(s, t)
  208. }
  209. }
  210. // guildDeleteEventHandler is an event handler for GuildDelete events.
  211. type guildDeleteEventHandler func(*Session, *GuildDelete)
  212. // Type returns the event type for GuildDelete events.
  213. func (eh guildDeleteEventHandler) Type() string {
  214. return guildDeleteEventType
  215. }
  216. // New returns a new instance of GuildDelete.
  217. func (eh guildDeleteEventHandler) New() interface{} {
  218. return &GuildDelete{}
  219. }
  220. // Handle is the handler for GuildDelete events.
  221. func (eh guildDeleteEventHandler) Handle(s *Session, i interface{}) {
  222. if t, ok := i.(*GuildDelete); ok {
  223. eh(s, t)
  224. }
  225. }
  226. // guildEmojisUpdateEventHandler is an event handler for GuildEmojisUpdate events.
  227. type guildEmojisUpdateEventHandler func(*Session, *GuildEmojisUpdate)
  228. // Type returns the event type for GuildEmojisUpdate events.
  229. func (eh guildEmojisUpdateEventHandler) Type() string {
  230. return guildEmojisUpdateEventType
  231. }
  232. // New returns a new instance of GuildEmojisUpdate.
  233. func (eh guildEmojisUpdateEventHandler) New() interface{} {
  234. return &GuildEmojisUpdate{}
  235. }
  236. // Handle is the handler for GuildEmojisUpdate events.
  237. func (eh guildEmojisUpdateEventHandler) Handle(s *Session, i interface{}) {
  238. if t, ok := i.(*GuildEmojisUpdate); ok {
  239. eh(s, t)
  240. }
  241. }
  242. // guildIntegrationsUpdateEventHandler is an event handler for GuildIntegrationsUpdate events.
  243. type guildIntegrationsUpdateEventHandler func(*Session, *GuildIntegrationsUpdate)
  244. // Type returns the event type for GuildIntegrationsUpdate events.
  245. func (eh guildIntegrationsUpdateEventHandler) Type() string {
  246. return guildIntegrationsUpdateEventType
  247. }
  248. // New returns a new instance of GuildIntegrationsUpdate.
  249. func (eh guildIntegrationsUpdateEventHandler) New() interface{} {
  250. return &GuildIntegrationsUpdate{}
  251. }
  252. // Handle is the handler for GuildIntegrationsUpdate events.
  253. func (eh guildIntegrationsUpdateEventHandler) Handle(s *Session, i interface{}) {
  254. if t, ok := i.(*GuildIntegrationsUpdate); ok {
  255. eh(s, t)
  256. }
  257. }
  258. // guildMemberAddEventHandler is an event handler for GuildMemberAdd events.
  259. type guildMemberAddEventHandler func(*Session, *GuildMemberAdd)
  260. // Type returns the event type for GuildMemberAdd events.
  261. func (eh guildMemberAddEventHandler) Type() string {
  262. return guildMemberAddEventType
  263. }
  264. // New returns a new instance of GuildMemberAdd.
  265. func (eh guildMemberAddEventHandler) New() interface{} {
  266. return &GuildMemberAdd{}
  267. }
  268. // Handle is the handler for GuildMemberAdd events.
  269. func (eh guildMemberAddEventHandler) Handle(s *Session, i interface{}) {
  270. if t, ok := i.(*GuildMemberAdd); ok {
  271. eh(s, t)
  272. }
  273. }
  274. // guildMemberRemoveEventHandler is an event handler for GuildMemberRemove events.
  275. type guildMemberRemoveEventHandler func(*Session, *GuildMemberRemove)
  276. // Type returns the event type for GuildMemberRemove events.
  277. func (eh guildMemberRemoveEventHandler) Type() string {
  278. return guildMemberRemoveEventType
  279. }
  280. // New returns a new instance of GuildMemberRemove.
  281. func (eh guildMemberRemoveEventHandler) New() interface{} {
  282. return &GuildMemberRemove{}
  283. }
  284. // Handle is the handler for GuildMemberRemove events.
  285. func (eh guildMemberRemoveEventHandler) Handle(s *Session, i interface{}) {
  286. if t, ok := i.(*GuildMemberRemove); ok {
  287. eh(s, t)
  288. }
  289. }
  290. // guildMemberUpdateEventHandler is an event handler for GuildMemberUpdate events.
  291. type guildMemberUpdateEventHandler func(*Session, *GuildMemberUpdate)
  292. // Type returns the event type for GuildMemberUpdate events.
  293. func (eh guildMemberUpdateEventHandler) Type() string {
  294. return guildMemberUpdateEventType
  295. }
  296. // New returns a new instance of GuildMemberUpdate.
  297. func (eh guildMemberUpdateEventHandler) New() interface{} {
  298. return &GuildMemberUpdate{}
  299. }
  300. // Handle is the handler for GuildMemberUpdate events.
  301. func (eh guildMemberUpdateEventHandler) Handle(s *Session, i interface{}) {
  302. if t, ok := i.(*GuildMemberUpdate); ok {
  303. eh(s, t)
  304. }
  305. }
  306. // guildMembersChunkEventHandler is an event handler for GuildMembersChunk events.
  307. type guildMembersChunkEventHandler func(*Session, *GuildMembersChunk)
  308. // Type returns the event type for GuildMembersChunk events.
  309. func (eh guildMembersChunkEventHandler) Type() string {
  310. return guildMembersChunkEventType
  311. }
  312. // New returns a new instance of GuildMembersChunk.
  313. func (eh guildMembersChunkEventHandler) New() interface{} {
  314. return &GuildMembersChunk{}
  315. }
  316. // Handle is the handler for GuildMembersChunk events.
  317. func (eh guildMembersChunkEventHandler) Handle(s *Session, i interface{}) {
  318. if t, ok := i.(*GuildMembersChunk); ok {
  319. eh(s, t)
  320. }
  321. }
  322. // guildRoleCreateEventHandler is an event handler for GuildRoleCreate events.
  323. type guildRoleCreateEventHandler func(*Session, *GuildRoleCreate)
  324. // Type returns the event type for GuildRoleCreate events.
  325. func (eh guildRoleCreateEventHandler) Type() string {
  326. return guildRoleCreateEventType
  327. }
  328. // New returns a new instance of GuildRoleCreate.
  329. func (eh guildRoleCreateEventHandler) New() interface{} {
  330. return &GuildRoleCreate{}
  331. }
  332. // Handle is the handler for GuildRoleCreate events.
  333. func (eh guildRoleCreateEventHandler) Handle(s *Session, i interface{}) {
  334. if t, ok := i.(*GuildRoleCreate); ok {
  335. eh(s, t)
  336. }
  337. }
  338. // guildRoleDeleteEventHandler is an event handler for GuildRoleDelete events.
  339. type guildRoleDeleteEventHandler func(*Session, *GuildRoleDelete)
  340. // Type returns the event type for GuildRoleDelete events.
  341. func (eh guildRoleDeleteEventHandler) Type() string {
  342. return guildRoleDeleteEventType
  343. }
  344. // New returns a new instance of GuildRoleDelete.
  345. func (eh guildRoleDeleteEventHandler) New() interface{} {
  346. return &GuildRoleDelete{}
  347. }
  348. // Handle is the handler for GuildRoleDelete events.
  349. func (eh guildRoleDeleteEventHandler) Handle(s *Session, i interface{}) {
  350. if t, ok := i.(*GuildRoleDelete); ok {
  351. eh(s, t)
  352. }
  353. }
  354. // guildRoleUpdateEventHandler is an event handler for GuildRoleUpdate events.
  355. type guildRoleUpdateEventHandler func(*Session, *GuildRoleUpdate)
  356. // Type returns the event type for GuildRoleUpdate events.
  357. func (eh guildRoleUpdateEventHandler) Type() string {
  358. return guildRoleUpdateEventType
  359. }
  360. // New returns a new instance of GuildRoleUpdate.
  361. func (eh guildRoleUpdateEventHandler) New() interface{} {
  362. return &GuildRoleUpdate{}
  363. }
  364. // Handle is the handler for GuildRoleUpdate events.
  365. func (eh guildRoleUpdateEventHandler) Handle(s *Session, i interface{}) {
  366. if t, ok := i.(*GuildRoleUpdate); ok {
  367. eh(s, t)
  368. }
  369. }
  370. // guildUpdateEventHandler is an event handler for GuildUpdate events.
  371. type guildUpdateEventHandler func(*Session, *GuildUpdate)
  372. // Type returns the event type for GuildUpdate events.
  373. func (eh guildUpdateEventHandler) Type() string {
  374. return guildUpdateEventType
  375. }
  376. // New returns a new instance of GuildUpdate.
  377. func (eh guildUpdateEventHandler) New() interface{} {
  378. return &GuildUpdate{}
  379. }
  380. // Handle is the handler for GuildUpdate events.
  381. func (eh guildUpdateEventHandler) Handle(s *Session, i interface{}) {
  382. if t, ok := i.(*GuildUpdate); ok {
  383. eh(s, t)
  384. }
  385. }
  386. // interactionCreateEventHandler is an event handler for InteractionCreate events.
  387. type interactionCreateEventHandler func(*Session, *InteractionCreate)
  388. // Type returns the event type for InteractionCreate events.
  389. func (eh interactionCreateEventHandler) Type() string {
  390. return interactionCreateEventType
  391. }
  392. // New returns a new instance of InteractionCreate.
  393. func (eh interactionCreateEventHandler) New() interface{} {
  394. return &InteractionCreate{}
  395. }
  396. // Handle is the handler for InteractionCreate events.
  397. func (eh interactionCreateEventHandler) Handle(s *Session, i interface{}) {
  398. if t, ok := i.(*InteractionCreate); ok {
  399. eh(s, t)
  400. }
  401. }
  402. // inviteCreateEventHandler is an event handler for InviteCreate events.
  403. type inviteCreateEventHandler func(*Session, *InviteCreate)
  404. // Type returns the event type for InviteCreate events.
  405. func (eh inviteCreateEventHandler) Type() string {
  406. return inviteCreateEventType
  407. }
  408. // New returns a new instance of InviteCreate.
  409. func (eh inviteCreateEventHandler) New() interface{} {
  410. return &InviteCreate{}
  411. }
  412. // Handle is the handler for InviteCreate events.
  413. func (eh inviteCreateEventHandler) Handle(s *Session, i interface{}) {
  414. if t, ok := i.(*InviteCreate); ok {
  415. eh(s, t)
  416. }
  417. }
  418. // inviteDeleteEventHandler is an event handler for InviteDelete events.
  419. type inviteDeleteEventHandler func(*Session, *InviteDelete)
  420. // Type returns the event type for InviteDelete events.
  421. func (eh inviteDeleteEventHandler) Type() string {
  422. return inviteDeleteEventType
  423. }
  424. // New returns a new instance of InviteDelete.
  425. func (eh inviteDeleteEventHandler) New() interface{} {
  426. return &InviteDelete{}
  427. }
  428. // Handle is the handler for InviteDelete events.
  429. func (eh inviteDeleteEventHandler) Handle(s *Session, i interface{}) {
  430. if t, ok := i.(*InviteDelete); ok {
  431. eh(s, t)
  432. }
  433. }
  434. // messageAckEventHandler is an event handler for MessageAck events.
  435. type messageAckEventHandler func(*Session, *MessageAck)
  436. // Type returns the event type for MessageAck events.
  437. func (eh messageAckEventHandler) Type() string {
  438. return messageAckEventType
  439. }
  440. // New returns a new instance of MessageAck.
  441. func (eh messageAckEventHandler) New() interface{} {
  442. return &MessageAck{}
  443. }
  444. // Handle is the handler for MessageAck events.
  445. func (eh messageAckEventHandler) Handle(s *Session, i interface{}) {
  446. if t, ok := i.(*MessageAck); ok {
  447. eh(s, t)
  448. }
  449. }
  450. // messageCreateEventHandler is an event handler for MessageCreate events.
  451. type messageCreateEventHandler func(*Session, *MessageCreate)
  452. // Type returns the event type for MessageCreate events.
  453. func (eh messageCreateEventHandler) Type() string {
  454. return messageCreateEventType
  455. }
  456. // New returns a new instance of MessageCreate.
  457. func (eh messageCreateEventHandler) New() interface{} {
  458. return &MessageCreate{}
  459. }
  460. // Handle is the handler for MessageCreate events.
  461. func (eh messageCreateEventHandler) Handle(s *Session, i interface{}) {
  462. if t, ok := i.(*MessageCreate); ok {
  463. eh(s, t)
  464. }
  465. }
  466. // messageDeleteEventHandler is an event handler for MessageDelete events.
  467. type messageDeleteEventHandler func(*Session, *MessageDelete)
  468. // Type returns the event type for MessageDelete events.
  469. func (eh messageDeleteEventHandler) Type() string {
  470. return messageDeleteEventType
  471. }
  472. // New returns a new instance of MessageDelete.
  473. func (eh messageDeleteEventHandler) New() interface{} {
  474. return &MessageDelete{}
  475. }
  476. // Handle is the handler for MessageDelete events.
  477. func (eh messageDeleteEventHandler) Handle(s *Session, i interface{}) {
  478. if t, ok := i.(*MessageDelete); ok {
  479. eh(s, t)
  480. }
  481. }
  482. // messageDeleteBulkEventHandler is an event handler for MessageDeleteBulk events.
  483. type messageDeleteBulkEventHandler func(*Session, *MessageDeleteBulk)
  484. // Type returns the event type for MessageDeleteBulk events.
  485. func (eh messageDeleteBulkEventHandler) Type() string {
  486. return messageDeleteBulkEventType
  487. }
  488. // New returns a new instance of MessageDeleteBulk.
  489. func (eh messageDeleteBulkEventHandler) New() interface{} {
  490. return &MessageDeleteBulk{}
  491. }
  492. // Handle is the handler for MessageDeleteBulk events.
  493. func (eh messageDeleteBulkEventHandler) Handle(s *Session, i interface{}) {
  494. if t, ok := i.(*MessageDeleteBulk); ok {
  495. eh(s, t)
  496. }
  497. }
  498. // messageReactionAddEventHandler is an event handler for MessageReactionAdd events.
  499. type messageReactionAddEventHandler func(*Session, *MessageReactionAdd)
  500. // Type returns the event type for MessageReactionAdd events.
  501. func (eh messageReactionAddEventHandler) Type() string {
  502. return messageReactionAddEventType
  503. }
  504. // New returns a new instance of MessageReactionAdd.
  505. func (eh messageReactionAddEventHandler) New() interface{} {
  506. return &MessageReactionAdd{}
  507. }
  508. // Handle is the handler for MessageReactionAdd events.
  509. func (eh messageReactionAddEventHandler) Handle(s *Session, i interface{}) {
  510. if t, ok := i.(*MessageReactionAdd); ok {
  511. eh(s, t)
  512. }
  513. }
  514. // messageReactionRemoveEventHandler is an event handler for MessageReactionRemove events.
  515. type messageReactionRemoveEventHandler func(*Session, *MessageReactionRemove)
  516. // Type returns the event type for MessageReactionRemove events.
  517. func (eh messageReactionRemoveEventHandler) Type() string {
  518. return messageReactionRemoveEventType
  519. }
  520. // New returns a new instance of MessageReactionRemove.
  521. func (eh messageReactionRemoveEventHandler) New() interface{} {
  522. return &MessageReactionRemove{}
  523. }
  524. // Handle is the handler for MessageReactionRemove events.
  525. func (eh messageReactionRemoveEventHandler) Handle(s *Session, i interface{}) {
  526. if t, ok := i.(*MessageReactionRemove); ok {
  527. eh(s, t)
  528. }
  529. }
  530. // messageReactionRemoveAllEventHandler is an event handler for MessageReactionRemoveAll events.
  531. type messageReactionRemoveAllEventHandler func(*Session, *MessageReactionRemoveAll)
  532. // Type returns the event type for MessageReactionRemoveAll events.
  533. func (eh messageReactionRemoveAllEventHandler) Type() string {
  534. return messageReactionRemoveAllEventType
  535. }
  536. // New returns a new instance of MessageReactionRemoveAll.
  537. func (eh messageReactionRemoveAllEventHandler) New() interface{} {
  538. return &MessageReactionRemoveAll{}
  539. }
  540. // Handle is the handler for MessageReactionRemoveAll events.
  541. func (eh messageReactionRemoveAllEventHandler) Handle(s *Session, i interface{}) {
  542. if t, ok := i.(*MessageReactionRemoveAll); ok {
  543. eh(s, t)
  544. }
  545. }
  546. // messageUpdateEventHandler is an event handler for MessageUpdate events.
  547. type messageUpdateEventHandler func(*Session, *MessageUpdate)
  548. // Type returns the event type for MessageUpdate events.
  549. func (eh messageUpdateEventHandler) Type() string {
  550. return messageUpdateEventType
  551. }
  552. // New returns a new instance of MessageUpdate.
  553. func (eh messageUpdateEventHandler) New() interface{} {
  554. return &MessageUpdate{}
  555. }
  556. // Handle is the handler for MessageUpdate events.
  557. func (eh messageUpdateEventHandler) Handle(s *Session, i interface{}) {
  558. if t, ok := i.(*MessageUpdate); ok {
  559. eh(s, t)
  560. }
  561. }
  562. // presenceUpdateEventHandler is an event handler for PresenceUpdate events.
  563. type presenceUpdateEventHandler func(*Session, *PresenceUpdate)
  564. // Type returns the event type for PresenceUpdate events.
  565. func (eh presenceUpdateEventHandler) Type() string {
  566. return presenceUpdateEventType
  567. }
  568. // New returns a new instance of PresenceUpdate.
  569. func (eh presenceUpdateEventHandler) New() interface{} {
  570. return &PresenceUpdate{}
  571. }
  572. // Handle is the handler for PresenceUpdate events.
  573. func (eh presenceUpdateEventHandler) Handle(s *Session, i interface{}) {
  574. if t, ok := i.(*PresenceUpdate); ok {
  575. eh(s, t)
  576. }
  577. }
  578. // presencesReplaceEventHandler is an event handler for PresencesReplace events.
  579. type presencesReplaceEventHandler func(*Session, *PresencesReplace)
  580. // Type returns the event type for PresencesReplace events.
  581. func (eh presencesReplaceEventHandler) Type() string {
  582. return presencesReplaceEventType
  583. }
  584. // New returns a new instance of PresencesReplace.
  585. func (eh presencesReplaceEventHandler) New() interface{} {
  586. return &PresencesReplace{}
  587. }
  588. // Handle is the handler for PresencesReplace events.
  589. func (eh presencesReplaceEventHandler) Handle(s *Session, i interface{}) {
  590. if t, ok := i.(*PresencesReplace); ok {
  591. eh(s, t)
  592. }
  593. }
  594. // rateLimitEventHandler is an event handler for RateLimit events.
  595. type rateLimitEventHandler func(*Session, *RateLimit)
  596. // Type returns the event type for RateLimit events.
  597. func (eh rateLimitEventHandler) Type() string {
  598. return rateLimitEventType
  599. }
  600. // Handle is the handler for RateLimit events.
  601. func (eh rateLimitEventHandler) Handle(s *Session, i interface{}) {
  602. if t, ok := i.(*RateLimit); ok {
  603. eh(s, t)
  604. }
  605. }
  606. // readyEventHandler is an event handler for Ready events.
  607. type readyEventHandler func(*Session, *Ready)
  608. // Type returns the event type for Ready events.
  609. func (eh readyEventHandler) Type() string {
  610. return readyEventType
  611. }
  612. // New returns a new instance of Ready.
  613. func (eh readyEventHandler) New() interface{} {
  614. return &Ready{}
  615. }
  616. // Handle is the handler for Ready events.
  617. func (eh readyEventHandler) Handle(s *Session, i interface{}) {
  618. if t, ok := i.(*Ready); ok {
  619. eh(s, t)
  620. }
  621. }
  622. // relationshipAddEventHandler is an event handler for RelationshipAdd events.
  623. type relationshipAddEventHandler func(*Session, *RelationshipAdd)
  624. // Type returns the event type for RelationshipAdd events.
  625. func (eh relationshipAddEventHandler) Type() string {
  626. return relationshipAddEventType
  627. }
  628. // New returns a new instance of RelationshipAdd.
  629. func (eh relationshipAddEventHandler) New() interface{} {
  630. return &RelationshipAdd{}
  631. }
  632. // Handle is the handler for RelationshipAdd events.
  633. func (eh relationshipAddEventHandler) Handle(s *Session, i interface{}) {
  634. if t, ok := i.(*RelationshipAdd); ok {
  635. eh(s, t)
  636. }
  637. }
  638. // relationshipRemoveEventHandler is an event handler for RelationshipRemove events.
  639. type relationshipRemoveEventHandler func(*Session, *RelationshipRemove)
  640. // Type returns the event type for RelationshipRemove events.
  641. func (eh relationshipRemoveEventHandler) Type() string {
  642. return relationshipRemoveEventType
  643. }
  644. // New returns a new instance of RelationshipRemove.
  645. func (eh relationshipRemoveEventHandler) New() interface{} {
  646. return &RelationshipRemove{}
  647. }
  648. // Handle is the handler for RelationshipRemove events.
  649. func (eh relationshipRemoveEventHandler) Handle(s *Session, i interface{}) {
  650. if t, ok := i.(*RelationshipRemove); ok {
  651. eh(s, t)
  652. }
  653. }
  654. // resumedEventHandler is an event handler for Resumed events.
  655. type resumedEventHandler func(*Session, *Resumed)
  656. // Type returns the event type for Resumed events.
  657. func (eh resumedEventHandler) Type() string {
  658. return resumedEventType
  659. }
  660. // New returns a new instance of Resumed.
  661. func (eh resumedEventHandler) New() interface{} {
  662. return &Resumed{}
  663. }
  664. // Handle is the handler for Resumed events.
  665. func (eh resumedEventHandler) Handle(s *Session, i interface{}) {
  666. if t, ok := i.(*Resumed); ok {
  667. eh(s, t)
  668. }
  669. }
  670. // threadCreateEventHandler is an event handler for ThreadCreate events.
  671. type threadCreateEventHandler func(*Session, *ThreadCreate)
  672. // Type returns the event type for ThreadCreate events.
  673. func (eh threadCreateEventHandler) Type() string {
  674. return threadCreateEventType
  675. }
  676. // New returns a new instance of ThreadCreate.
  677. func (eh threadCreateEventHandler) New() interface{} {
  678. return &ThreadCreate{}
  679. }
  680. // Handle is the handler for ThreadCreate events.
  681. func (eh threadCreateEventHandler) Handle(s *Session, i interface{}) {
  682. if t, ok := i.(*ThreadCreate); ok {
  683. eh(s, t)
  684. }
  685. }
  686. // threadDeleteEventHandler is an event handler for ThreadDelete events.
  687. type threadDeleteEventHandler func(*Session, *ThreadDelete)
  688. // Type returns the event type for ThreadDelete events.
  689. func (eh threadDeleteEventHandler) Type() string {
  690. return threadDeleteEventType
  691. }
  692. // New returns a new instance of ThreadDelete.
  693. func (eh threadDeleteEventHandler) New() interface{} {
  694. return &ThreadDelete{}
  695. }
  696. // Handle is the handler for ThreadDelete events.
  697. func (eh threadDeleteEventHandler) Handle(s *Session, i interface{}) {
  698. if t, ok := i.(*ThreadDelete); ok {
  699. eh(s, t)
  700. }
  701. }
  702. // threadListSyncEventHandler is an event handler for ThreadListSync events.
  703. type threadListSyncEventHandler func(*Session, *ThreadListSync)
  704. // Type returns the event type for ThreadListSync events.
  705. func (eh threadListSyncEventHandler) Type() string {
  706. return threadListSyncEventType
  707. }
  708. // New returns a new instance of ThreadListSync.
  709. func (eh threadListSyncEventHandler) New() interface{} {
  710. return &ThreadListSync{}
  711. }
  712. // Handle is the handler for ThreadListSync events.
  713. func (eh threadListSyncEventHandler) Handle(s *Session, i interface{}) {
  714. if t, ok := i.(*ThreadListSync); ok {
  715. eh(s, t)
  716. }
  717. }
  718. // threadMemberUpdateEventHandler is an event handler for ThreadMemberUpdate events.
  719. type threadMemberUpdateEventHandler func(*Session, *ThreadMemberUpdate)
  720. // Type returns the event type for ThreadMemberUpdate events.
  721. func (eh threadMemberUpdateEventHandler) Type() string {
  722. return threadMemberUpdateEventType
  723. }
  724. // New returns a new instance of ThreadMemberUpdate.
  725. func (eh threadMemberUpdateEventHandler) New() interface{} {
  726. return &ThreadMemberUpdate{}
  727. }
  728. // Handle is the handler for ThreadMemberUpdate events.
  729. func (eh threadMemberUpdateEventHandler) Handle(s *Session, i interface{}) {
  730. if t, ok := i.(*ThreadMemberUpdate); ok {
  731. eh(s, t)
  732. }
  733. }
  734. // threadMembersUpdateEventHandler is an event handler for ThreadMembersUpdate events.
  735. type threadMembersUpdateEventHandler func(*Session, *ThreadMembersUpdate)
  736. // Type returns the event type for ThreadMembersUpdate events.
  737. func (eh threadMembersUpdateEventHandler) Type() string {
  738. return threadMembersUpdateEventType
  739. }
  740. // New returns a new instance of ThreadMembersUpdate.
  741. func (eh threadMembersUpdateEventHandler) New() interface{} {
  742. return &ThreadMembersUpdate{}
  743. }
  744. // Handle is the handler for ThreadMembersUpdate events.
  745. func (eh threadMembersUpdateEventHandler) Handle(s *Session, i interface{}) {
  746. if t, ok := i.(*ThreadMembersUpdate); ok {
  747. eh(s, t)
  748. }
  749. }
  750. // threadUpdateEventHandler is an event handler for ThreadUpdate events.
  751. type threadUpdateEventHandler func(*Session, *ThreadUpdate)
  752. // Type returns the event type for ThreadUpdate events.
  753. func (eh threadUpdateEventHandler) Type() string {
  754. return threadUpdateEventType
  755. }
  756. // New returns a new instance of ThreadUpdate.
  757. func (eh threadUpdateEventHandler) New() interface{} {
  758. return &ThreadUpdate{}
  759. }
  760. // Handle is the handler for ThreadUpdate events.
  761. func (eh threadUpdateEventHandler) Handle(s *Session, i interface{}) {
  762. if t, ok := i.(*ThreadUpdate); ok {
  763. eh(s, t)
  764. }
  765. }
  766. // typingStartEventHandler is an event handler for TypingStart events.
  767. type typingStartEventHandler func(*Session, *TypingStart)
  768. // Type returns the event type for TypingStart events.
  769. func (eh typingStartEventHandler) Type() string {
  770. return typingStartEventType
  771. }
  772. // New returns a new instance of TypingStart.
  773. func (eh typingStartEventHandler) New() interface{} {
  774. return &TypingStart{}
  775. }
  776. // Handle is the handler for TypingStart events.
  777. func (eh typingStartEventHandler) Handle(s *Session, i interface{}) {
  778. if t, ok := i.(*TypingStart); ok {
  779. eh(s, t)
  780. }
  781. }
  782. // userGuildSettingsUpdateEventHandler is an event handler for UserGuildSettingsUpdate events.
  783. type userGuildSettingsUpdateEventHandler func(*Session, *UserGuildSettingsUpdate)
  784. // Type returns the event type for UserGuildSettingsUpdate events.
  785. func (eh userGuildSettingsUpdateEventHandler) Type() string {
  786. return userGuildSettingsUpdateEventType
  787. }
  788. // New returns a new instance of UserGuildSettingsUpdate.
  789. func (eh userGuildSettingsUpdateEventHandler) New() interface{} {
  790. return &UserGuildSettingsUpdate{}
  791. }
  792. // Handle is the handler for UserGuildSettingsUpdate events.
  793. func (eh userGuildSettingsUpdateEventHandler) Handle(s *Session, i interface{}) {
  794. if t, ok := i.(*UserGuildSettingsUpdate); ok {
  795. eh(s, t)
  796. }
  797. }
  798. // userNoteUpdateEventHandler is an event handler for UserNoteUpdate events.
  799. type userNoteUpdateEventHandler func(*Session, *UserNoteUpdate)
  800. // Type returns the event type for UserNoteUpdate events.
  801. func (eh userNoteUpdateEventHandler) Type() string {
  802. return userNoteUpdateEventType
  803. }
  804. // New returns a new instance of UserNoteUpdate.
  805. func (eh userNoteUpdateEventHandler) New() interface{} {
  806. return &UserNoteUpdate{}
  807. }
  808. // Handle is the handler for UserNoteUpdate events.
  809. func (eh userNoteUpdateEventHandler) Handle(s *Session, i interface{}) {
  810. if t, ok := i.(*UserNoteUpdate); ok {
  811. eh(s, t)
  812. }
  813. }
  814. // userSettingsUpdateEventHandler is an event handler for UserSettingsUpdate events.
  815. type userSettingsUpdateEventHandler func(*Session, *UserSettingsUpdate)
  816. // Type returns the event type for UserSettingsUpdate events.
  817. func (eh userSettingsUpdateEventHandler) Type() string {
  818. return userSettingsUpdateEventType
  819. }
  820. // New returns a new instance of UserSettingsUpdate.
  821. func (eh userSettingsUpdateEventHandler) New() interface{} {
  822. return &UserSettingsUpdate{}
  823. }
  824. // Handle is the handler for UserSettingsUpdate events.
  825. func (eh userSettingsUpdateEventHandler) Handle(s *Session, i interface{}) {
  826. if t, ok := i.(*UserSettingsUpdate); ok {
  827. eh(s, t)
  828. }
  829. }
  830. // userUpdateEventHandler is an event handler for UserUpdate events.
  831. type userUpdateEventHandler func(*Session, *UserUpdate)
  832. // Type returns the event type for UserUpdate events.
  833. func (eh userUpdateEventHandler) Type() string {
  834. return userUpdateEventType
  835. }
  836. // New returns a new instance of UserUpdate.
  837. func (eh userUpdateEventHandler) New() interface{} {
  838. return &UserUpdate{}
  839. }
  840. // Handle is the handler for UserUpdate events.
  841. func (eh userUpdateEventHandler) Handle(s *Session, i interface{}) {
  842. if t, ok := i.(*UserUpdate); ok {
  843. eh(s, t)
  844. }
  845. }
  846. // voiceServerUpdateEventHandler is an event handler for VoiceServerUpdate events.
  847. type voiceServerUpdateEventHandler func(*Session, *VoiceServerUpdate)
  848. // Type returns the event type for VoiceServerUpdate events.
  849. func (eh voiceServerUpdateEventHandler) Type() string {
  850. return voiceServerUpdateEventType
  851. }
  852. // New returns a new instance of VoiceServerUpdate.
  853. func (eh voiceServerUpdateEventHandler) New() interface{} {
  854. return &VoiceServerUpdate{}
  855. }
  856. // Handle is the handler for VoiceServerUpdate events.
  857. func (eh voiceServerUpdateEventHandler) Handle(s *Session, i interface{}) {
  858. if t, ok := i.(*VoiceServerUpdate); ok {
  859. eh(s, t)
  860. }
  861. }
  862. // voiceStateUpdateEventHandler is an event handler for VoiceStateUpdate events.
  863. type voiceStateUpdateEventHandler func(*Session, *VoiceStateUpdate)
  864. // Type returns the event type for VoiceStateUpdate events.
  865. func (eh voiceStateUpdateEventHandler) Type() string {
  866. return voiceStateUpdateEventType
  867. }
  868. // New returns a new instance of VoiceStateUpdate.
  869. func (eh voiceStateUpdateEventHandler) New() interface{} {
  870. return &VoiceStateUpdate{}
  871. }
  872. // Handle is the handler for VoiceStateUpdate events.
  873. func (eh voiceStateUpdateEventHandler) Handle(s *Session, i interface{}) {
  874. if t, ok := i.(*VoiceStateUpdate); ok {
  875. eh(s, t)
  876. }
  877. }
  878. // webhooksUpdateEventHandler is an event handler for WebhooksUpdate events.
  879. type webhooksUpdateEventHandler func(*Session, *WebhooksUpdate)
  880. // Type returns the event type for WebhooksUpdate events.
  881. func (eh webhooksUpdateEventHandler) Type() string {
  882. return webhooksUpdateEventType
  883. }
  884. // New returns a new instance of WebhooksUpdate.
  885. func (eh webhooksUpdateEventHandler) New() interface{} {
  886. return &WebhooksUpdate{}
  887. }
  888. // Handle is the handler for WebhooksUpdate events.
  889. func (eh webhooksUpdateEventHandler) Handle(s *Session, i interface{}) {
  890. if t, ok := i.(*WebhooksUpdate); ok {
  891. eh(s, t)
  892. }
  893. }
  894. func handlerForInterface(handler interface{}) EventHandler {
  895. switch v := handler.(type) {
  896. case func(*Session, interface{}):
  897. return interfaceEventHandler(v)
  898. case func(*Session, *ChannelCreate):
  899. return channelCreateEventHandler(v)
  900. case func(*Session, *ChannelDelete):
  901. return channelDeleteEventHandler(v)
  902. case func(*Session, *ChannelPinsUpdate):
  903. return channelPinsUpdateEventHandler(v)
  904. case func(*Session, *ChannelUpdate):
  905. return channelUpdateEventHandler(v)
  906. case func(*Session, *Connect):
  907. return connectEventHandler(v)
  908. case func(*Session, *Disconnect):
  909. return disconnectEventHandler(v)
  910. case func(*Session, *Event):
  911. return eventEventHandler(v)
  912. case func(*Session, *GuildBanAdd):
  913. return guildBanAddEventHandler(v)
  914. case func(*Session, *GuildBanRemove):
  915. return guildBanRemoveEventHandler(v)
  916. case func(*Session, *GuildCreate):
  917. return guildCreateEventHandler(v)
  918. case func(*Session, *GuildDelete):
  919. return guildDeleteEventHandler(v)
  920. case func(*Session, *GuildEmojisUpdate):
  921. return guildEmojisUpdateEventHandler(v)
  922. case func(*Session, *GuildIntegrationsUpdate):
  923. return guildIntegrationsUpdateEventHandler(v)
  924. case func(*Session, *GuildMemberAdd):
  925. return guildMemberAddEventHandler(v)
  926. case func(*Session, *GuildMemberRemove):
  927. return guildMemberRemoveEventHandler(v)
  928. case func(*Session, *GuildMemberUpdate):
  929. return guildMemberUpdateEventHandler(v)
  930. case func(*Session, *GuildMembersChunk):
  931. return guildMembersChunkEventHandler(v)
  932. case func(*Session, *GuildRoleCreate):
  933. return guildRoleCreateEventHandler(v)
  934. case func(*Session, *GuildRoleDelete):
  935. return guildRoleDeleteEventHandler(v)
  936. case func(*Session, *GuildRoleUpdate):
  937. return guildRoleUpdateEventHandler(v)
  938. case func(*Session, *GuildUpdate):
  939. return guildUpdateEventHandler(v)
  940. case func(*Session, *InteractionCreate):
  941. return interactionCreateEventHandler(v)
  942. case func(*Session, *InviteCreate):
  943. return inviteCreateEventHandler(v)
  944. case func(*Session, *InviteDelete):
  945. return inviteDeleteEventHandler(v)
  946. case func(*Session, *MessageAck):
  947. return messageAckEventHandler(v)
  948. case func(*Session, *MessageCreate):
  949. return messageCreateEventHandler(v)
  950. case func(*Session, *MessageDelete):
  951. return messageDeleteEventHandler(v)
  952. case func(*Session, *MessageDeleteBulk):
  953. return messageDeleteBulkEventHandler(v)
  954. case func(*Session, *MessageReactionAdd):
  955. return messageReactionAddEventHandler(v)
  956. case func(*Session, *MessageReactionRemove):
  957. return messageReactionRemoveEventHandler(v)
  958. case func(*Session, *MessageReactionRemoveAll):
  959. return messageReactionRemoveAllEventHandler(v)
  960. case func(*Session, *MessageUpdate):
  961. return messageUpdateEventHandler(v)
  962. case func(*Session, *PresenceUpdate):
  963. return presenceUpdateEventHandler(v)
  964. case func(*Session, *PresencesReplace):
  965. return presencesReplaceEventHandler(v)
  966. case func(*Session, *RateLimit):
  967. return rateLimitEventHandler(v)
  968. case func(*Session, *Ready):
  969. return readyEventHandler(v)
  970. case func(*Session, *RelationshipAdd):
  971. return relationshipAddEventHandler(v)
  972. case func(*Session, *RelationshipRemove):
  973. return relationshipRemoveEventHandler(v)
  974. case func(*Session, *Resumed):
  975. return resumedEventHandler(v)
  976. case func(*Session, *ThreadCreate):
  977. return threadCreateEventHandler(v)
  978. case func(*Session, *ThreadDelete):
  979. return threadDeleteEventHandler(v)
  980. case func(*Session, *ThreadListSync):
  981. return threadListSyncEventHandler(v)
  982. case func(*Session, *ThreadMemberUpdate):
  983. return threadMemberUpdateEventHandler(v)
  984. case func(*Session, *ThreadMembersUpdate):
  985. return threadMembersUpdateEventHandler(v)
  986. case func(*Session, *ThreadUpdate):
  987. return threadUpdateEventHandler(v)
  988. case func(*Session, *TypingStart):
  989. return typingStartEventHandler(v)
  990. case func(*Session, *UserGuildSettingsUpdate):
  991. return userGuildSettingsUpdateEventHandler(v)
  992. case func(*Session, *UserNoteUpdate):
  993. return userNoteUpdateEventHandler(v)
  994. case func(*Session, *UserSettingsUpdate):
  995. return userSettingsUpdateEventHandler(v)
  996. case func(*Session, *UserUpdate):
  997. return userUpdateEventHandler(v)
  998. case func(*Session, *VoiceServerUpdate):
  999. return voiceServerUpdateEventHandler(v)
  1000. case func(*Session, *VoiceStateUpdate):
  1001. return voiceStateUpdateEventHandler(v)
  1002. case func(*Session, *WebhooksUpdate):
  1003. return webhooksUpdateEventHandler(v)
  1004. }
  1005. return nil
  1006. }
  1007. func init() {
  1008. registerInterfaceProvider(channelCreateEventHandler(nil))
  1009. registerInterfaceProvider(channelDeleteEventHandler(nil))
  1010. registerInterfaceProvider(channelPinsUpdateEventHandler(nil))
  1011. registerInterfaceProvider(channelUpdateEventHandler(nil))
  1012. registerInterfaceProvider(guildBanAddEventHandler(nil))
  1013. registerInterfaceProvider(guildBanRemoveEventHandler(nil))
  1014. registerInterfaceProvider(guildCreateEventHandler(nil))
  1015. registerInterfaceProvider(guildDeleteEventHandler(nil))
  1016. registerInterfaceProvider(guildEmojisUpdateEventHandler(nil))
  1017. registerInterfaceProvider(guildIntegrationsUpdateEventHandler(nil))
  1018. registerInterfaceProvider(guildMemberAddEventHandler(nil))
  1019. registerInterfaceProvider(guildMemberRemoveEventHandler(nil))
  1020. registerInterfaceProvider(guildMemberUpdateEventHandler(nil))
  1021. registerInterfaceProvider(guildMembersChunkEventHandler(nil))
  1022. registerInterfaceProvider(guildRoleCreateEventHandler(nil))
  1023. registerInterfaceProvider(guildRoleDeleteEventHandler(nil))
  1024. registerInterfaceProvider(guildRoleUpdateEventHandler(nil))
  1025. registerInterfaceProvider(guildUpdateEventHandler(nil))
  1026. registerInterfaceProvider(interactionCreateEventHandler(nil))
  1027. registerInterfaceProvider(inviteCreateEventHandler(nil))
  1028. registerInterfaceProvider(inviteDeleteEventHandler(nil))
  1029. registerInterfaceProvider(messageAckEventHandler(nil))
  1030. registerInterfaceProvider(messageCreateEventHandler(nil))
  1031. registerInterfaceProvider(messageDeleteEventHandler(nil))
  1032. registerInterfaceProvider(messageDeleteBulkEventHandler(nil))
  1033. registerInterfaceProvider(messageReactionAddEventHandler(nil))
  1034. registerInterfaceProvider(messageReactionRemoveEventHandler(nil))
  1035. registerInterfaceProvider(messageReactionRemoveAllEventHandler(nil))
  1036. registerInterfaceProvider(messageUpdateEventHandler(nil))
  1037. registerInterfaceProvider(presenceUpdateEventHandler(nil))
  1038. registerInterfaceProvider(presencesReplaceEventHandler(nil))
  1039. registerInterfaceProvider(readyEventHandler(nil))
  1040. registerInterfaceProvider(relationshipAddEventHandler(nil))
  1041. registerInterfaceProvider(relationshipRemoveEventHandler(nil))
  1042. registerInterfaceProvider(resumedEventHandler(nil))
  1043. registerInterfaceProvider(threadCreateEventHandler(nil))
  1044. registerInterfaceProvider(threadDeleteEventHandler(nil))
  1045. registerInterfaceProvider(threadListSyncEventHandler(nil))
  1046. registerInterfaceProvider(threadMemberUpdateEventHandler(nil))
  1047. registerInterfaceProvider(threadMembersUpdateEventHandler(nil))
  1048. registerInterfaceProvider(threadUpdateEventHandler(nil))
  1049. registerInterfaceProvider(typingStartEventHandler(nil))
  1050. registerInterfaceProvider(userGuildSettingsUpdateEventHandler(nil))
  1051. registerInterfaceProvider(userNoteUpdateEventHandler(nil))
  1052. registerInterfaceProvider(userSettingsUpdateEventHandler(nil))
  1053. registerInterfaceProvider(userUpdateEventHandler(nil))
  1054. registerInterfaceProvider(voiceServerUpdateEventHandler(nil))
  1055. registerInterfaceProvider(voiceStateUpdateEventHandler(nil))
  1056. registerInterfaceProvider(webhooksUpdateEventHandler(nil))
  1057. }