svachan

command module
v1.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 21, 2020 License: MIT Imports: 11 Imported by: 0

README

Svachan

Build Status Go report

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

  1. *discordgo.Session Session from discord which will be passed to the handler
  2. *discordgo.MessageCreate Message from discord which will be passed to the handler

Return

  1. (bool) Is Executed indicator
  2. (string) Message which will be sent as response
  3. (error) Error indicator
Built-in Command

You can disable it as well by removing the handler from handlers

Extension Command

Credit

Hansen Edrick Harianto

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL