Refactor bot command invocation
This commit is contained in:
17
bots/discord/commands/Play.go
Normal file
17
bots/discord/commands/Play.go
Normal file
@ -0,0 +1,17 @@
|
||||
package commands
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/bwmarrin/discordgo"
|
||||
)
|
||||
|
||||
// Play changes the status of the bot.
|
||||
func Play(s *discordgo.Session, msg *discordgo.MessageCreate) bool {
|
||||
if strings.HasPrefix(msg.Content, "!play ") {
|
||||
return false
|
||||
}
|
||||
|
||||
s.UpdateStatus(0, msg.Content[len("!play "):])
|
||||
return true
|
||||
}
|
Reference in New Issue
Block a user