Svachan
Svachan is a Go Discord Bot. This bot is built on top of DiscordGo Multi purposes bot which can be extended
as much as you want, all you had to do is to register a handler in Svachan and
you are good to go!
Getting Started
Installing
This assumes you already have a working Go environment, if not please see
this page first.
go get
will always pull the latest tagged release from the master branch.
go get github.com/svakode/svachan
After you clone your project, you need to run
make copy-config
Open the generated application.yml
and fill in the required configuration
Build
You can build the binary file by simply running
make build
After the build is done, you can run it by
./out/svachan
Handler Extension
You can extend the bot to serve more command by registering it in the main.go
.
Register your handler in the handlers
variable. For example:
handlers = append(handlers, svachooseHandler.NewChooseHandler().Choose)
the handler need to implement
func (*discordgo.Session, *discordgo.MessageCreate) (bool, string, error)
Parameter
*discordgo.Session
Session from discord which will be passed to the handler
*discordgo.MessageCreate
Message from discord which will be passed to the handler
Return
- (bool) Is Executed indicator
- (string) Message which will be sent as response
- (error) Error indicator
Built-in Command
You can disable it as well by removing the handler from handlers
Extension Command
Credit
Hansen Edrick Harianto