eventhandlers.go 44 KB

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