add wednesday

This commit is contained in:
DutchEllie 2021-05-18 12:54:04 +02:00
parent 6d79e8d9a0
commit 322087f6a1
2 changed files with 26 additions and 0 deletions

View File

@ -33,6 +33,8 @@ func (app *application) messageCreate(s *discordgo.Session, m *discordgo.Message
app.sendNigelGif(s, m)
case "tuesday":
app.sendTuesday(s, m)
case "wednesday":
app.sendWednesday(s, m)
/* --- Bot commands for words --- */
/* --- Bot commands, but only admins --- */
case "addword":

View File

@ -76,6 +76,30 @@ func (app *application) sendTuesday(s *discordgo.Session, m *discordgo.MessageCr
}
}
func (app *application) sendWednesday(s *discordgo.Session, m *discordgo.MessageCreate) {
if time.Now().Weekday().String() != "Wednesday" {
_, err := s.ChannelMessageSend(m.ChannelID, "This command only works on wednesdays")
if err != nil {
app.errorLog.Print(err)
return
}
}
_, month, day := time.Now().Date()
if month.String() == "May" && day == 18 {
_, err := s.ChannelMessageSend(m.ChannelID, "https://www.youtube.com/watch?v=z21HOwUk5oM")
if err != nil {
app.errorLog.Print(err)
return
}
return
}
_, err := s.ChannelMessageSend(m.ChannelID, "https://www.youtube.com/watch?v=du-TY1GUFGk")
if err != nil {
app.errorLog.Print(err)
return
}
}
func (app *application) findTrigger(s *discordgo.Session, m *discordgo.MessageCreate) {
/* Finding for every word in the allBadWords map of string slices
Check if the message contains that word