Set the command prefix
parent
05adff76d0
commit
b9bc185650
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue