|
|
|
@ -15,6 +15,7 @@ type CommandFunction func(s *discordgo.Session, m *discordgo.MessageCreate)
|
|
|
|
|
func InitCommands(s *discordgo.Session) {
|
|
|
|
|
s.AddHandler(commandHandler("greet", greetCommand))
|
|
|
|
|
s.AddHandler(commandHandler("dadjoke", dadJokeCommand))
|
|
|
|
|
s.AddHandler(commandHandler("hibub", hiBubCommand))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func commandHandler(commandName string, handler CommandFunction) func(s *discordgo.Session, m *discordgo.MessageCreate) {
|
|
|
|
@ -61,3 +62,10 @@ func dadJokeCommand(s *discordgo.Session, m *discordgo.MessageCreate) {
|
|
|
|
|
log.Println(joke)
|
|
|
|
|
s.ChannelMessageSend(m.ChannelID, joke)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func hiBubCommand(s *discordgo.Session, m *discordgo.MessageCreate) {
|
|
|
|
|
user := m.Author
|
|
|
|
|
hibub := "Hi " + user.Username + " it's Bub from the Hubbub, how are you?"
|
|
|
|
|
log.Println(hibub)
|
|
|
|
|
s.ChannelMessageSend(m.ChannelID, hibub)
|
|
|
|
|
}
|
|
|
|
|