This repository has been archived by the owner on Jul 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 70
/
reactor_gen.go
910 lines (848 loc) · 26.3 KB
/
reactor_gen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
package disgord
// Code generated - This file has been automatically generated by generate/events/main.go - DO NOT EDIT.
// Warning: This file is overwritten at "go generate", instead adapt reactor.go and event/events.go and run `go generate`
//////////////////////////////////////////////////////
//
// Helper funcs
//
//////////////////////////////////////////////////////
func defineResource(evt string) (resource evtResource) {
switch evt {
case EvtChannelCreate:
resource = &ChannelCreate{}
case EvtChannelDelete:
resource = &ChannelDelete{}
case EvtChannelPinsUpdate:
resource = &ChannelPinsUpdate{}
case EvtChannelUpdate:
resource = &ChannelUpdate{}
case EvtGuildBanAdd:
resource = &GuildBanAdd{}
case EvtGuildBanRemove:
resource = &GuildBanRemove{}
case EvtGuildCreate:
resource = &GuildCreate{}
case EvtGuildDelete:
resource = &GuildDelete{}
case EvtGuildEmojisUpdate:
resource = &GuildEmojisUpdate{}
case EvtGuildIntegrationsUpdate:
resource = &GuildIntegrationsUpdate{}
case EvtGuildMemberAdd:
resource = &GuildMemberAdd{}
case EvtGuildMemberRemove:
resource = &GuildMemberRemove{}
case EvtGuildMemberUpdate:
resource = &GuildMemberUpdate{}
case EvtGuildMembersChunk:
resource = &GuildMembersChunk{}
case EvtGuildRoleCreate:
resource = &GuildRoleCreate{}
case EvtGuildRoleDelete:
resource = &GuildRoleDelete{}
case EvtGuildRoleUpdate:
resource = &GuildRoleUpdate{}
case EvtGuildScheduledEventCreate:
resource = &GuildScheduledEventCreate{}
case EvtGuildScheduledEventDelete:
resource = &GuildScheduledEventDelete{}
case EvtGuildScheduledEventUpdate:
resource = &GuildScheduledEventUpdate{}
case EvtGuildScheduledEventUserAdd:
resource = &GuildScheduledEventUserAdd{}
case EvtGuildScheduledEventUserRemove:
resource = &GuildScheduledEventUserRemove{}
case EvtGuildStickersUpdate:
resource = &GuildStickersUpdate{}
case EvtGuildUpdate:
resource = &GuildUpdate{}
case EvtInteractionCreate:
resource = &InteractionCreate{}
case EvtInviteCreate:
resource = &InviteCreate{}
case EvtInviteDelete:
resource = &InviteDelete{}
case EvtMessageCreate:
resource = &MessageCreate{}
case EvtMessageDelete:
resource = &MessageDelete{}
case EvtMessageDeleteBulk:
resource = &MessageDeleteBulk{}
case EvtMessageReactionAdd:
resource = &MessageReactionAdd{}
case EvtMessageReactionRemove:
resource = &MessageReactionRemove{}
case EvtMessageReactionRemoveAll:
resource = &MessageReactionRemoveAll{}
case EvtMessageReactionRemoveEmoji:
resource = &MessageReactionRemoveEmoji{}
case EvtMessageUpdate:
resource = &MessageUpdate{}
case EvtPresenceUpdate:
resource = &PresenceUpdate{}
case EvtReady:
resource = &Ready{}
case EvtResumed:
resource = &Resumed{}
case EvtThreadCreate:
resource = &ThreadCreate{}
case EvtThreadDelete:
resource = &ThreadDelete{}
case EvtThreadListSync:
resource = &ThreadListSync{}
case EvtThreadMemberUpdate:
resource = &ThreadMemberUpdate{}
case EvtThreadMembersUpdate:
resource = &ThreadMembersUpdate{}
case EvtThreadUpdate:
resource = &ThreadUpdate{}
case EvtTypingStart:
resource = &TypingStart{}
case EvtUserUpdate:
resource = &UserUpdate{}
case EvtVoiceServerUpdate:
resource = &VoiceServerUpdate{}
case EvtVoiceStateUpdate:
resource = &VoiceStateUpdate{}
case EvtWebhooksUpdate:
resource = &WebhooksUpdate{}
}
return resource
}
func isHandler(h Handler) (ok bool) {
switch h.(type) {
case HandlerSimple:
ok = true
case HandlerSimplest:
ok = true
case chan interface{}:
ok = true
case HandlerChannelCreate:
ok = true
case chan *ChannelCreate:
ok = true
case HandlerChannelDelete:
ok = true
case chan *ChannelDelete:
ok = true
case HandlerChannelPinsUpdate:
ok = true
case chan *ChannelPinsUpdate:
ok = true
case HandlerChannelUpdate:
ok = true
case chan *ChannelUpdate:
ok = true
case HandlerGuildBanAdd:
ok = true
case chan *GuildBanAdd:
ok = true
case HandlerGuildBanRemove:
ok = true
case chan *GuildBanRemove:
ok = true
case HandlerGuildCreate:
ok = true
case chan *GuildCreate:
ok = true
case HandlerGuildDelete:
ok = true
case chan *GuildDelete:
ok = true
case HandlerGuildEmojisUpdate:
ok = true
case chan *GuildEmojisUpdate:
ok = true
case HandlerGuildIntegrationsUpdate:
ok = true
case chan *GuildIntegrationsUpdate:
ok = true
case HandlerGuildMemberAdd:
ok = true
case chan *GuildMemberAdd:
ok = true
case HandlerGuildMemberRemove:
ok = true
case chan *GuildMemberRemove:
ok = true
case HandlerGuildMemberUpdate:
ok = true
case chan *GuildMemberUpdate:
ok = true
case HandlerGuildMembersChunk:
ok = true
case chan *GuildMembersChunk:
ok = true
case HandlerGuildRoleCreate:
ok = true
case chan *GuildRoleCreate:
ok = true
case HandlerGuildRoleDelete:
ok = true
case chan *GuildRoleDelete:
ok = true
case HandlerGuildRoleUpdate:
ok = true
case chan *GuildRoleUpdate:
ok = true
case HandlerGuildScheduledEventCreate:
ok = true
case chan *GuildScheduledEventCreate:
ok = true
case HandlerGuildScheduledEventDelete:
ok = true
case chan *GuildScheduledEventDelete:
ok = true
case HandlerGuildScheduledEventUpdate:
ok = true
case chan *GuildScheduledEventUpdate:
ok = true
case HandlerGuildScheduledEventUserAdd:
ok = true
case chan *GuildScheduledEventUserAdd:
ok = true
case HandlerGuildScheduledEventUserRemove:
ok = true
case chan *GuildScheduledEventUserRemove:
ok = true
case HandlerGuildStickersUpdate:
ok = true
case chan *GuildStickersUpdate:
ok = true
case HandlerGuildUpdate:
ok = true
case chan *GuildUpdate:
ok = true
case HandlerInteractionCreate:
ok = true
case chan *InteractionCreate:
ok = true
case HandlerInviteCreate:
ok = true
case chan *InviteCreate:
ok = true
case HandlerInviteDelete:
ok = true
case chan *InviteDelete:
ok = true
case HandlerMessageCreate:
ok = true
case chan *MessageCreate:
ok = true
case HandlerMessageDelete:
ok = true
case chan *MessageDelete:
ok = true
case HandlerMessageDeleteBulk:
ok = true
case chan *MessageDeleteBulk:
ok = true
case HandlerMessageReactionAdd:
ok = true
case chan *MessageReactionAdd:
ok = true
case HandlerMessageReactionRemove:
ok = true
case chan *MessageReactionRemove:
ok = true
case HandlerMessageReactionRemoveAll:
ok = true
case chan *MessageReactionRemoveAll:
ok = true
case HandlerMessageReactionRemoveEmoji:
ok = true
case chan *MessageReactionRemoveEmoji:
ok = true
case HandlerMessageUpdate:
ok = true
case chan *MessageUpdate:
ok = true
case HandlerPresenceUpdate:
ok = true
case chan *PresenceUpdate:
ok = true
case HandlerReady:
ok = true
case chan *Ready:
ok = true
case HandlerResumed:
ok = true
case chan *Resumed:
ok = true
case HandlerThreadCreate:
ok = true
case chan *ThreadCreate:
ok = true
case HandlerThreadDelete:
ok = true
case chan *ThreadDelete:
ok = true
case HandlerThreadListSync:
ok = true
case chan *ThreadListSync:
ok = true
case HandlerThreadMemberUpdate:
ok = true
case chan *ThreadMemberUpdate:
ok = true
case HandlerThreadMembersUpdate:
ok = true
case chan *ThreadMembersUpdate:
ok = true
case HandlerThreadUpdate:
ok = true
case chan *ThreadUpdate:
ok = true
case HandlerTypingStart:
ok = true
case chan *TypingStart:
ok = true
case HandlerUserUpdate:
ok = true
case chan *UserUpdate:
ok = true
case HandlerVoiceServerUpdate:
ok = true
case chan *VoiceServerUpdate:
ok = true
case HandlerVoiceStateUpdate:
ok = true
case chan *VoiceStateUpdate:
ok = true
case HandlerWebhooksUpdate:
ok = true
case chan *WebhooksUpdate:
ok = true
}
return ok
}
func closeChannel(channel interface{}) {
switch t := channel.(type) {
case chan interface{}:
close(t)
case chan *ChannelCreate:
close(t)
case chan *ChannelDelete:
close(t)
case chan *ChannelPinsUpdate:
close(t)
case chan *ChannelUpdate:
close(t)
case chan *GuildBanAdd:
close(t)
case chan *GuildBanRemove:
close(t)
case chan *GuildCreate:
close(t)
case chan *GuildDelete:
close(t)
case chan *GuildEmojisUpdate:
close(t)
case chan *GuildIntegrationsUpdate:
close(t)
case chan *GuildMemberAdd:
close(t)
case chan *GuildMemberRemove:
close(t)
case chan *GuildMemberUpdate:
close(t)
case chan *GuildMembersChunk:
close(t)
case chan *GuildRoleCreate:
close(t)
case chan *GuildRoleDelete:
close(t)
case chan *GuildRoleUpdate:
close(t)
case chan *GuildScheduledEventCreate:
close(t)
case chan *GuildScheduledEventDelete:
close(t)
case chan *GuildScheduledEventUpdate:
close(t)
case chan *GuildScheduledEventUserAdd:
close(t)
case chan *GuildScheduledEventUserRemove:
close(t)
case chan *GuildStickersUpdate:
close(t)
case chan *GuildUpdate:
close(t)
case chan *InteractionCreate:
close(t)
case chan *InviteCreate:
close(t)
case chan *InviteDelete:
close(t)
case chan *MessageCreate:
close(t)
case chan *MessageDelete:
close(t)
case chan *MessageDeleteBulk:
close(t)
case chan *MessageReactionAdd:
close(t)
case chan *MessageReactionRemove:
close(t)
case chan *MessageReactionRemoveAll:
close(t)
case chan *MessageReactionRemoveEmoji:
close(t)
case chan *MessageUpdate:
close(t)
case chan *PresenceUpdate:
close(t)
case chan *Ready:
close(t)
case chan *Resumed:
close(t)
case chan *ThreadCreate:
close(t)
case chan *ThreadDelete:
close(t)
case chan *ThreadListSync:
close(t)
case chan *ThreadMemberUpdate:
close(t)
case chan *ThreadMembersUpdate:
close(t)
case chan *ThreadUpdate:
close(t)
case chan *TypingStart:
close(t)
case chan *UserUpdate:
close(t)
case chan *VoiceServerUpdate:
close(t)
case chan *VoiceStateUpdate:
close(t)
case chan *WebhooksUpdate:
close(t)
}
}
//////////////////////////////////////////////////////
//
// Dispatcher: contructor + repetitive methods
//
//////////////////////////////////////////////////////
// newDispatcher construct a Dispatch object for reacting to web socket events
// from discord
func newDispatcher() *dispatcher {
d := &dispatcher{
handlerSpecs: make(map[string][]*handlerSpec),
shutdown: make(chan struct{}),
}
return d
}
func (d *dispatcher) trigger(h Handler, evt resource) {
switch t := h.(type) {
case HandlerSimple:
t(d.session)
case HandlerSimplest:
t()
case chan interface{}:
t <- evt
case chan<- interface{}:
t <- evt
case HandlerChannelCreate:
t(d.session, evt.(*ChannelCreate))
case chan *ChannelCreate:
t <- evt.(*ChannelCreate)
case chan<- *ChannelCreate:
t <- evt.(*ChannelCreate)
case HandlerChannelDelete:
t(d.session, evt.(*ChannelDelete))
case chan *ChannelDelete:
t <- evt.(*ChannelDelete)
case chan<- *ChannelDelete:
t <- evt.(*ChannelDelete)
case HandlerChannelPinsUpdate:
t(d.session, evt.(*ChannelPinsUpdate))
case chan *ChannelPinsUpdate:
t <- evt.(*ChannelPinsUpdate)
case chan<- *ChannelPinsUpdate:
t <- evt.(*ChannelPinsUpdate)
case HandlerChannelUpdate:
t(d.session, evt.(*ChannelUpdate))
case chan *ChannelUpdate:
t <- evt.(*ChannelUpdate)
case chan<- *ChannelUpdate:
t <- evt.(*ChannelUpdate)
case HandlerGuildBanAdd:
t(d.session, evt.(*GuildBanAdd))
case chan *GuildBanAdd:
t <- evt.(*GuildBanAdd)
case chan<- *GuildBanAdd:
t <- evt.(*GuildBanAdd)
case HandlerGuildBanRemove:
t(d.session, evt.(*GuildBanRemove))
case chan *GuildBanRemove:
t <- evt.(*GuildBanRemove)
case chan<- *GuildBanRemove:
t <- evt.(*GuildBanRemove)
case HandlerGuildCreate:
t(d.session, evt.(*GuildCreate))
case chan *GuildCreate:
t <- evt.(*GuildCreate)
case chan<- *GuildCreate:
t <- evt.(*GuildCreate)
case HandlerGuildDelete:
t(d.session, evt.(*GuildDelete))
case chan *GuildDelete:
t <- evt.(*GuildDelete)
case chan<- *GuildDelete:
t <- evt.(*GuildDelete)
case HandlerGuildEmojisUpdate:
t(d.session, evt.(*GuildEmojisUpdate))
case chan *GuildEmojisUpdate:
t <- evt.(*GuildEmojisUpdate)
case chan<- *GuildEmojisUpdate:
t <- evt.(*GuildEmojisUpdate)
case HandlerGuildIntegrationsUpdate:
t(d.session, evt.(*GuildIntegrationsUpdate))
case chan *GuildIntegrationsUpdate:
t <- evt.(*GuildIntegrationsUpdate)
case chan<- *GuildIntegrationsUpdate:
t <- evt.(*GuildIntegrationsUpdate)
case HandlerGuildMemberAdd:
t(d.session, evt.(*GuildMemberAdd))
case chan *GuildMemberAdd:
t <- evt.(*GuildMemberAdd)
case chan<- *GuildMemberAdd:
t <- evt.(*GuildMemberAdd)
case HandlerGuildMemberRemove:
t(d.session, evt.(*GuildMemberRemove))
case chan *GuildMemberRemove:
t <- evt.(*GuildMemberRemove)
case chan<- *GuildMemberRemove:
t <- evt.(*GuildMemberRemove)
case HandlerGuildMemberUpdate:
t(d.session, evt.(*GuildMemberUpdate))
case chan *GuildMemberUpdate:
t <- evt.(*GuildMemberUpdate)
case chan<- *GuildMemberUpdate:
t <- evt.(*GuildMemberUpdate)
case HandlerGuildMembersChunk:
t(d.session, evt.(*GuildMembersChunk))
case chan *GuildMembersChunk:
t <- evt.(*GuildMembersChunk)
case chan<- *GuildMembersChunk:
t <- evt.(*GuildMembersChunk)
case HandlerGuildRoleCreate:
t(d.session, evt.(*GuildRoleCreate))
case chan *GuildRoleCreate:
t <- evt.(*GuildRoleCreate)
case chan<- *GuildRoleCreate:
t <- evt.(*GuildRoleCreate)
case HandlerGuildRoleDelete:
t(d.session, evt.(*GuildRoleDelete))
case chan *GuildRoleDelete:
t <- evt.(*GuildRoleDelete)
case chan<- *GuildRoleDelete:
t <- evt.(*GuildRoleDelete)
case HandlerGuildRoleUpdate:
t(d.session, evt.(*GuildRoleUpdate))
case chan *GuildRoleUpdate:
t <- evt.(*GuildRoleUpdate)
case chan<- *GuildRoleUpdate:
t <- evt.(*GuildRoleUpdate)
case HandlerGuildScheduledEventCreate:
t(d.session, evt.(*GuildScheduledEventCreate))
case chan *GuildScheduledEventCreate:
t <- evt.(*GuildScheduledEventCreate)
case chan<- *GuildScheduledEventCreate:
t <- evt.(*GuildScheduledEventCreate)
case HandlerGuildScheduledEventDelete:
t(d.session, evt.(*GuildScheduledEventDelete))
case chan *GuildScheduledEventDelete:
t <- evt.(*GuildScheduledEventDelete)
case chan<- *GuildScheduledEventDelete:
t <- evt.(*GuildScheduledEventDelete)
case HandlerGuildScheduledEventUpdate:
t(d.session, evt.(*GuildScheduledEventUpdate))
case chan *GuildScheduledEventUpdate:
t <- evt.(*GuildScheduledEventUpdate)
case chan<- *GuildScheduledEventUpdate:
t <- evt.(*GuildScheduledEventUpdate)
case HandlerGuildScheduledEventUserAdd:
t(d.session, evt.(*GuildScheduledEventUserAdd))
case chan *GuildScheduledEventUserAdd:
t <- evt.(*GuildScheduledEventUserAdd)
case chan<- *GuildScheduledEventUserAdd:
t <- evt.(*GuildScheduledEventUserAdd)
case HandlerGuildScheduledEventUserRemove:
t(d.session, evt.(*GuildScheduledEventUserRemove))
case chan *GuildScheduledEventUserRemove:
t <- evt.(*GuildScheduledEventUserRemove)
case chan<- *GuildScheduledEventUserRemove:
t <- evt.(*GuildScheduledEventUserRemove)
case HandlerGuildStickersUpdate:
t(d.session, evt.(*GuildStickersUpdate))
case chan *GuildStickersUpdate:
t <- evt.(*GuildStickersUpdate)
case chan<- *GuildStickersUpdate:
t <- evt.(*GuildStickersUpdate)
case HandlerGuildUpdate:
t(d.session, evt.(*GuildUpdate))
case chan *GuildUpdate:
t <- evt.(*GuildUpdate)
case chan<- *GuildUpdate:
t <- evt.(*GuildUpdate)
case HandlerInteractionCreate:
t(d.session, evt.(*InteractionCreate))
case chan *InteractionCreate:
t <- evt.(*InteractionCreate)
case chan<- *InteractionCreate:
t <- evt.(*InteractionCreate)
case HandlerInviteCreate:
t(d.session, evt.(*InviteCreate))
case chan *InviteCreate:
t <- evt.(*InviteCreate)
case chan<- *InviteCreate:
t <- evt.(*InviteCreate)
case HandlerInviteDelete:
t(d.session, evt.(*InviteDelete))
case chan *InviteDelete:
t <- evt.(*InviteDelete)
case chan<- *InviteDelete:
t <- evt.(*InviteDelete)
case HandlerMessageCreate:
t(d.session, evt.(*MessageCreate))
case chan *MessageCreate:
t <- evt.(*MessageCreate)
case chan<- *MessageCreate:
t <- evt.(*MessageCreate)
case HandlerMessageDelete:
t(d.session, evt.(*MessageDelete))
case chan *MessageDelete:
t <- evt.(*MessageDelete)
case chan<- *MessageDelete:
t <- evt.(*MessageDelete)
case HandlerMessageDeleteBulk:
t(d.session, evt.(*MessageDeleteBulk))
case chan *MessageDeleteBulk:
t <- evt.(*MessageDeleteBulk)
case chan<- *MessageDeleteBulk:
t <- evt.(*MessageDeleteBulk)
case HandlerMessageReactionAdd:
t(d.session, evt.(*MessageReactionAdd))
case chan *MessageReactionAdd:
t <- evt.(*MessageReactionAdd)
case chan<- *MessageReactionAdd:
t <- evt.(*MessageReactionAdd)
case HandlerMessageReactionRemove:
t(d.session, evt.(*MessageReactionRemove))
case chan *MessageReactionRemove:
t <- evt.(*MessageReactionRemove)
case chan<- *MessageReactionRemove:
t <- evt.(*MessageReactionRemove)
case HandlerMessageReactionRemoveAll:
t(d.session, evt.(*MessageReactionRemoveAll))
case chan *MessageReactionRemoveAll:
t <- evt.(*MessageReactionRemoveAll)
case chan<- *MessageReactionRemoveAll:
t <- evt.(*MessageReactionRemoveAll)
case HandlerMessageReactionRemoveEmoji:
t(d.session, evt.(*MessageReactionRemoveEmoji))
case chan *MessageReactionRemoveEmoji:
t <- evt.(*MessageReactionRemoveEmoji)
case chan<- *MessageReactionRemoveEmoji:
t <- evt.(*MessageReactionRemoveEmoji)
case HandlerMessageUpdate:
t(d.session, evt.(*MessageUpdate))
case chan *MessageUpdate:
t <- evt.(*MessageUpdate)
case chan<- *MessageUpdate:
t <- evt.(*MessageUpdate)
case HandlerPresenceUpdate:
t(d.session, evt.(*PresenceUpdate))
case chan *PresenceUpdate:
t <- evt.(*PresenceUpdate)
case chan<- *PresenceUpdate:
t <- evt.(*PresenceUpdate)
case HandlerReady:
t(d.session, evt.(*Ready))
case chan *Ready:
t <- evt.(*Ready)
case chan<- *Ready:
t <- evt.(*Ready)
case HandlerResumed:
t(d.session, evt.(*Resumed))
case chan *Resumed:
t <- evt.(*Resumed)
case chan<- *Resumed:
t <- evt.(*Resumed)
case HandlerThreadCreate:
t(d.session, evt.(*ThreadCreate))
case chan *ThreadCreate:
t <- evt.(*ThreadCreate)
case chan<- *ThreadCreate:
t <- evt.(*ThreadCreate)
case HandlerThreadDelete:
t(d.session, evt.(*ThreadDelete))
case chan *ThreadDelete:
t <- evt.(*ThreadDelete)
case chan<- *ThreadDelete:
t <- evt.(*ThreadDelete)
case HandlerThreadListSync:
t(d.session, evt.(*ThreadListSync))
case chan *ThreadListSync:
t <- evt.(*ThreadListSync)
case chan<- *ThreadListSync:
t <- evt.(*ThreadListSync)
case HandlerThreadMemberUpdate:
t(d.session, evt.(*ThreadMemberUpdate))
case chan *ThreadMemberUpdate:
t <- evt.(*ThreadMemberUpdate)
case chan<- *ThreadMemberUpdate:
t <- evt.(*ThreadMemberUpdate)
case HandlerThreadMembersUpdate:
t(d.session, evt.(*ThreadMembersUpdate))
case chan *ThreadMembersUpdate:
t <- evt.(*ThreadMembersUpdate)
case chan<- *ThreadMembersUpdate:
t <- evt.(*ThreadMembersUpdate)
case HandlerThreadUpdate:
t(d.session, evt.(*ThreadUpdate))
case chan *ThreadUpdate:
t <- evt.(*ThreadUpdate)
case chan<- *ThreadUpdate:
t <- evt.(*ThreadUpdate)
case HandlerTypingStart:
t(d.session, evt.(*TypingStart))
case chan *TypingStart:
t <- evt.(*TypingStart)
case chan<- *TypingStart:
t <- evt.(*TypingStart)
case HandlerUserUpdate:
t(d.session, evt.(*UserUpdate))
case chan *UserUpdate:
t <- evt.(*UserUpdate)
case chan<- *UserUpdate:
t <- evt.(*UserUpdate)
case HandlerVoiceServerUpdate:
t(d.session, evt.(*VoiceServerUpdate))
case chan *VoiceServerUpdate:
t <- evt.(*VoiceServerUpdate)
case chan<- *VoiceServerUpdate:
t <- evt.(*VoiceServerUpdate)
case HandlerVoiceStateUpdate:
t(d.session, evt.(*VoiceStateUpdate))
case chan *VoiceStateUpdate:
t <- evt.(*VoiceStateUpdate)
case chan<- *VoiceStateUpdate:
t <- evt.(*VoiceStateUpdate)
case HandlerWebhooksUpdate:
t(d.session, evt.(*WebhooksUpdate))
case chan *WebhooksUpdate:
t <- evt.(*WebhooksUpdate)
case chan<- *WebhooksUpdate:
t <- evt.(*WebhooksUpdate)
}
}
//////////////////////////////////////////////////////
//
// Handler Signatures
//
//////////////////////////////////////////////////////
// these "simple" handler can be used, if you don't care about the actual event data
type HandlerSimplest = func()
type HandlerSimple = func(Session)
// HandlerChannelCreate is triggered by ChannelCreate events
type HandlerChannelCreate = func(s Session, h *ChannelCreate)
// HandlerChannelDelete is triggered by ChannelDelete events
type HandlerChannelDelete = func(s Session, h *ChannelDelete)
// HandlerChannelPinsUpdate is triggered by ChannelPinsUpdate events
type HandlerChannelPinsUpdate = func(s Session, h *ChannelPinsUpdate)
// HandlerChannelUpdate is triggered by ChannelUpdate events
type HandlerChannelUpdate = func(s Session, h *ChannelUpdate)
// HandlerGuildBanAdd is triggered by GuildBanAdd events
type HandlerGuildBanAdd = func(s Session, h *GuildBanAdd)
// HandlerGuildBanRemove is triggered by GuildBanRemove events
type HandlerGuildBanRemove = func(s Session, h *GuildBanRemove)
// HandlerGuildCreate is triggered by GuildCreate events
type HandlerGuildCreate = func(s Session, h *GuildCreate)
// HandlerGuildDelete is triggered by GuildDelete events
type HandlerGuildDelete = func(s Session, h *GuildDelete)
// HandlerGuildEmojisUpdate is triggered by GuildEmojisUpdate events
type HandlerGuildEmojisUpdate = func(s Session, h *GuildEmojisUpdate)
// HandlerGuildIntegrationsUpdate is triggered by GuildIntegrationsUpdate events
type HandlerGuildIntegrationsUpdate = func(s Session, h *GuildIntegrationsUpdate)
// HandlerGuildMemberAdd is triggered by GuildMemberAdd events
type HandlerGuildMemberAdd = func(s Session, h *GuildMemberAdd)
// HandlerGuildMemberRemove is triggered by GuildMemberRemove events
type HandlerGuildMemberRemove = func(s Session, h *GuildMemberRemove)
// HandlerGuildMemberUpdate is triggered by GuildMemberUpdate events
type HandlerGuildMemberUpdate = func(s Session, h *GuildMemberUpdate)
// HandlerGuildMembersChunk is triggered by GuildMembersChunk events
type HandlerGuildMembersChunk = func(s Session, h *GuildMembersChunk)
// HandlerGuildRoleCreate is triggered by GuildRoleCreate events
type HandlerGuildRoleCreate = func(s Session, h *GuildRoleCreate)
// HandlerGuildRoleDelete is triggered by GuildRoleDelete events
type HandlerGuildRoleDelete = func(s Session, h *GuildRoleDelete)
// HandlerGuildRoleUpdate is triggered by GuildRoleUpdate events
type HandlerGuildRoleUpdate = func(s Session, h *GuildRoleUpdate)
// HandlerGuildScheduledEventCreate is triggered by GuildScheduledEventCreate events
type HandlerGuildScheduledEventCreate = func(s Session, h *GuildScheduledEventCreate)
// HandlerGuildScheduledEventDelete is triggered by GuildScheduledEventDelete events
type HandlerGuildScheduledEventDelete = func(s Session, h *GuildScheduledEventDelete)
// HandlerGuildScheduledEventUpdate is triggered by GuildScheduledEventUpdate events
type HandlerGuildScheduledEventUpdate = func(s Session, h *GuildScheduledEventUpdate)
// HandlerGuildScheduledEventUserAdd is triggered by GuildScheduledEventUserAdd events
type HandlerGuildScheduledEventUserAdd = func(s Session, h *GuildScheduledEventUserAdd)
// HandlerGuildScheduledEventUserRemove is triggered by GuildScheduledEventUserRemove events
type HandlerGuildScheduledEventUserRemove = func(s Session, h *GuildScheduledEventUserRemove)
// HandlerGuildStickersUpdate is triggered by GuildStickersUpdate events
type HandlerGuildStickersUpdate = func(s Session, h *GuildStickersUpdate)
// HandlerGuildUpdate is triggered by GuildUpdate events
type HandlerGuildUpdate = func(s Session, h *GuildUpdate)
// HandlerInteractionCreate is triggered by InteractionCreate events
type HandlerInteractionCreate = func(s Session, h *InteractionCreate)
// HandlerInviteCreate is triggered by InviteCreate events
type HandlerInviteCreate = func(s Session, h *InviteCreate)
// HandlerInviteDelete is triggered by InviteDelete events
type HandlerInviteDelete = func(s Session, h *InviteDelete)
// HandlerMessageCreate is triggered by MessageCreate events
type HandlerMessageCreate = func(s Session, h *MessageCreate)
// HandlerMessageDelete is triggered by MessageDelete events
type HandlerMessageDelete = func(s Session, h *MessageDelete)
// HandlerMessageDeleteBulk is triggered by MessageDeleteBulk events
type HandlerMessageDeleteBulk = func(s Session, h *MessageDeleteBulk)
// HandlerMessageReactionAdd is triggered by MessageReactionAdd events
type HandlerMessageReactionAdd = func(s Session, h *MessageReactionAdd)
// HandlerMessageReactionRemove is triggered by MessageReactionRemove events
type HandlerMessageReactionRemove = func(s Session, h *MessageReactionRemove)
// HandlerMessageReactionRemoveAll is triggered by MessageReactionRemoveAll events
type HandlerMessageReactionRemoveAll = func(s Session, h *MessageReactionRemoveAll)
// HandlerMessageReactionRemoveEmoji is triggered by MessageReactionRemoveEmoji events
type HandlerMessageReactionRemoveEmoji = func(s Session, h *MessageReactionRemoveEmoji)
// HandlerMessageUpdate is triggered by MessageUpdate events
type HandlerMessageUpdate = func(s Session, h *MessageUpdate)
// HandlerPresenceUpdate is triggered by PresenceUpdate events
type HandlerPresenceUpdate = func(s Session, h *PresenceUpdate)
// HandlerReady is triggered by Ready events
type HandlerReady = func(s Session, h *Ready)
// HandlerResumed is triggered by Resumed events
type HandlerResumed = func(s Session, h *Resumed)
// HandlerThreadCreate is triggered by ThreadCreate events
type HandlerThreadCreate = func(s Session, h *ThreadCreate)
// HandlerThreadDelete is triggered by ThreadDelete events
type HandlerThreadDelete = func(s Session, h *ThreadDelete)
// HandlerThreadListSync is triggered by ThreadListSync events
type HandlerThreadListSync = func(s Session, h *ThreadListSync)
// HandlerThreadMemberUpdate is triggered by ThreadMemberUpdate events
type HandlerThreadMemberUpdate = func(s Session, h *ThreadMemberUpdate)
// HandlerThreadMembersUpdate is triggered by ThreadMembersUpdate events
type HandlerThreadMembersUpdate = func(s Session, h *ThreadMembersUpdate)
// HandlerThreadUpdate is triggered by ThreadUpdate events
type HandlerThreadUpdate = func(s Session, h *ThreadUpdate)
// HandlerTypingStart is triggered by TypingStart events
type HandlerTypingStart = func(s Session, h *TypingStart)
// HandlerUserUpdate is triggered by UserUpdate events
type HandlerUserUpdate = func(s Session, h *UserUpdate)
// HandlerVoiceServerUpdate is triggered by VoiceServerUpdate events
type HandlerVoiceServerUpdate = func(s Session, h *VoiceServerUpdate)
// HandlerVoiceStateUpdate is triggered by VoiceStateUpdate events
type HandlerVoiceStateUpdate = func(s Session, h *VoiceStateUpdate)
// HandlerWebhooksUpdate is triggered by WebhooksUpdate events
type HandlerWebhooksUpdate = func(s Session, h *WebhooksUpdate)