mirror of
https://github.com/diamondburned/arikawa.git
synced 2024-12-11 16:05:00 +00:00
28 lines
705 B
Cheetah
28 lines
705 B
Cheetah
|
// Code generated by genevent. DO NOT EDIT.
|
||
|
|
||
|
package {{ .PackageName }}
|
||
|
|
||
|
import "github.com/diamondburned/arikawa/v3/utils/ws"
|
||
|
|
||
|
func init() {
|
||
|
OpUnmarshalers.Add(
|
||
|
{{ range .EventTypes -}}
|
||
|
func() ws.Event { return new({{ .StructName }}) },
|
||
|
{{ end -}}
|
||
|
)
|
||
|
}
|
||
|
|
||
|
{{ range .EventTypes }}
|
||
|
|
||
|
{{ if .IsDispatch }}
|
||
|
// Op implements Event. It always returns 0.
|
||
|
func (*{{ .StructName }}) Op() ws.OpCode { return dispatchOp }
|
||
|
{{ else if (gt .OpCode -1) }}
|
||
|
// Op implements Event. It always returns Op {{ .OpCode }}.
|
||
|
func (*{{ .StructName }}) Op() ws.OpCode { return {{ .OpCode }} }
|
||
|
{{ end }}
|
||
|
|
||
|
// EventType implements Event.
|
||
|
func (*{{ .StructName }}) EventType() ws.EventType { return "{{ .EventName }}" }
|
||
|
{{ end }}
|