2018-07-10 15:46:17 +00:00
|
|
|
package commands
|
|
|
|
|
|
|
|
import (
|
|
|
|
"strings"
|
|
|
|
|
2019-06-05 05:56:12 +00:00
|
|
|
"github.com/akyoto/color"
|
2018-07-10 15:46:17 +00:00
|
|
|
"github.com/bwmarrin/discordgo"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Play changes the status of the bot.
|
|
|
|
func Play(s *discordgo.Session, msg *discordgo.MessageCreate) bool {
|
2018-07-10 16:04:58 +00:00
|
|
|
if !strings.HasPrefix(msg.Content, "!play ") {
|
2018-07-10 15:46:17 +00:00
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
2019-06-05 05:56:12 +00:00
|
|
|
err := s.UpdateStatus(0, msg.Content[len("!play "):])
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
color.Red(err.Error())
|
|
|
|
}
|
|
|
|
|
2018-07-10 15:46:17 +00:00
|
|
|
return true
|
|
|
|
}
|