Skip to content

auroradevllc/handler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Handler

An event handler for Go, originally included as a sub-package of arikawa which you should also check out.

It has been split into this package for use elsewhere and made into an interface type. Test cases have been adapted to not use any Discord specific code, allowing this package to exist without any external dependencies.

Usage

The usage is the same as Arikawa. A handler function expects a single, typed argument. For instance, if you're expecting a Ping event, you'd add a handler as follows:

h.AddHandler(func(p Ping) {
	// do something with Ping here
})

When emitting events of type Ping, this handler will be called.

TODO: Add more documentation here.

About

Go Event Handler using reflect, forked from diamondburned/arikawa

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages