Skip to content

Commit 6028fa6

Browse files
committed
internals: add automatic generation
Closes #754 Closes #755
1 parent 3cd3caa commit 6028fa6

File tree

4 files changed

+802
-26
lines changed

4 files changed

+802
-26
lines changed

client.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import (
3737
)
3838

3939
// EventHandler is a function that can handle events from WhatsApp.
40-
type EventHandler func(evt interface{})
40+
type EventHandler func(evt any)
4141
type nodeHandler func(node *waBinary.Node)
4242

4343
var nextHandlerID uint32
@@ -778,7 +778,7 @@ func (cli *Client) sendNode(node waBinary.Node) error {
778778
return err
779779
}
780780

781-
func (cli *Client) dispatchEvent(evt interface{}) {
781+
func (cli *Client) dispatchEvent(evt any) {
782782
cli.eventHandlersLock.RLock()
783783
defer func() {
784784
cli.eventHandlersLock.RUnlock()

group.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,7 @@ Outer:
863863
cli.groupParticipantsCache[evt.JID] = cached
864864
}
865865

866-
func (cli *Client) parseGroupNotification(node *waBinary.Node) (interface{}, error) {
866+
func (cli *Client) parseGroupNotification(node *waBinary.Node) (any, error) {
867867
children := node.GetChildren()
868868
if len(children) == 1 && children[0].Tag == "create" {
869869
return cli.parseGroupCreate(&children[0])

0 commit comments

Comments
 (0)