added monday

This commit is contained in:
DutchEllie 2021-05-31 14:31:13 +02:00
parent c9e77f463e
commit 18aed75a59
2 changed files with 18 additions and 0 deletions

View File

@ -47,6 +47,8 @@ func (app *application) messageCreate(s *discordgo.Session, m *discordgo.Message
app.sendCringe(s, m) app.sendCringe(s, m)
case "gif": case "gif":
app.sendNigelGif(s, m) app.sendNigelGif(s, m)
case "monday":
app.sendMonday(s, m)
case "tuesday": case "tuesday":
app.sendTuesday(s, m) app.sendTuesday(s, m)
case "wednesday": case "wednesday":

View File

@ -69,6 +69,22 @@ func (app *application) sendNigelGif(s *discordgo.Session, m *discordgo.MessageC
} }
} }
func (app *application) sendMonday(s *discordgo.Session, m *discordgo.MessageCreate) {
if time.Now().Weekday().String() != "Monday" {
_, err := s.ChannelMessageSend(m.ChannelID, "This command only works on mondays")
if err != nil {
app.errorLog.Print(err)
return
}
return
}
_, err := s.ChannelMessageSend(m.ChannelID, "https://www.youtube.com/watch?v=EkALyaMjoXw")
if err != nil {
app.errorLog.Print(err)
return
}
}
func (app *application) sendTuesday(s *discordgo.Session, m *discordgo.MessageCreate) { func (app *application) sendTuesday(s *discordgo.Session, m *discordgo.MessageCreate) {
if time.Now().Weekday().String() != "Tuesday" { if time.Now().Weekday().String() != "Tuesday" {
_, err := s.ChannelMessageSend(m.ChannelID, "This command only works on tuesdays") _, err := s.ChannelMessageSend(m.ChannelID, "This command only works on tuesdays")