Set the command prefix

pull/20/head
pocketjawa 2019-08-05 20:57:23 -04:00
parent 05adff76d0
commit b9bc185650
1 changed files with 7 additions and 0 deletions

View File

@ -43,6 +43,13 @@ func main() {
Session.AddHandler(ready) Session.AddHandler(ready)
Session.AddHandler(Router.OnMessageCreate) Session.AddHandler(Router.OnMessageCreate)
//Set the command prefix
if os.Getenv("POCKETBOT_PREFIX") != "" {
Router.Prefix = os.Getenv("POCKETBOT_PREFIX")
} else {
Router.Prefix = "!"
}
// Register the build-in help command. // Register the build-in help command.
Router.Route("help", "Display this message.", Router.Help) Router.Route("help", "Display this message.", Router.Help)
Router.Route("swear", "Make me swear!", getSwear) Router.Route("swear", "Make me swear!", getSwear)