Add setplaying command
parent
73e90c8e48
commit
3d6d093e87
18
commands.go
18
commands.go
|
@ -13,6 +13,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
//Check member roles
|
//Check member roles
|
||||||
|
@ -145,3 +146,20 @@ func goToSleep(s *discordgo.Session, m *discordgo.Message, ctx *mux.Context) {
|
||||||
}
|
}
|
||||||
s.ChannelMessageSendEmbed(m.ChannelID, embed)
|
s.ChannelMessageSendEmbed(m.ChannelID, embed)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func setNowPlaying(s *discordgo.Session, m *discordgo.Message, ctx *mux.Context) {
|
||||||
|
if !checkRole(s, m, ctx, bot_admin_role) {
|
||||||
|
resp := "OwO you aren't my daddy..."
|
||||||
|
s.ChannelMessageSend(m.ChannelID, resp)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var resp string
|
||||||
|
if len(ctx.Fields) > 1 {
|
||||||
|
arg := strings.Join(ctx.Fields[1:], " ")
|
||||||
|
s.UpdateStatus(0, arg)
|
||||||
|
resp = "Now playing: " + arg
|
||||||
|
} else {
|
||||||
|
resp = "random"
|
||||||
|
}
|
||||||
|
s.ChannelMessageSend(m.ChannelID, resp)
|
||||||
|
}
|
||||||
|
|
|
@ -68,6 +68,7 @@ func main() {
|
||||||
Router.Route("restart", "Restart the bot.", restartBot)
|
Router.Route("restart", "Restart the bot.", restartBot)
|
||||||
Router.Route("kill", "Restart the bot.", restartBot)
|
Router.Route("kill", "Restart the bot.", restartBot)
|
||||||
Router.Route("sleep", "Something about sleeping...", goToSleep)
|
Router.Route("sleep", "Something about sleeping...", goToSleep)
|
||||||
|
Router.Route("setplaying", "Set the nowplaying message for the bot.", setNowPlaying)
|
||||||
|
|
||||||
//Open a connection to Discord
|
//Open a connection to Discord
|
||||||
err = Session.Open()
|
err = Session.Open()
|
||||||
|
|
Loading…
Reference in New Issue