Compare commits

...

3 Commits

Author SHA1 Message Date
DutchEllie b1f9b721fd Edit messages for proper/based 2021-12-17 15:44:52 +01:00
DutchEllie 3cd6421a52 Added proper 2021-12-17 15:38:34 +01:00
DutchEllie a7f2016ae0 Added pepe friday 2021-12-17 15:09:23 +01:00
2 changed files with 35 additions and 0 deletions

View File

@ -53,10 +53,14 @@ func (app *application) messageCreate(s *discordgo.Session, m *discordgo.Message
app.sendTuesday(s, m)
case "wednesday":
app.sendWednesday(s, m)
case "friday":
app.sendFriday(s, m)
case "github", "source":
app.sendGithub(s, m)
case "peski", "rotterdam":
app.sendPeski(s, m)
case "proper", "based":
app.sendProper(s, m)
/* --- Bot commands for words --- */
case "spam":
app.sendManyPepes(s, m, splitCommand)

View File

@ -4,6 +4,7 @@ import (
"errors"
"fmt"
"io"
"math/rand"
"net/http"
"strconv"
"strings"
@ -115,6 +116,22 @@ func (app *application) sendWednesday(s *discordgo.Session, m *discordgo.Message
}
}
func (app *application) sendFriday(s *discordgo.Session, m *discordgo.MessageCreate) {
if time.Now().Weekday().String() != "Friday" {
_, err := s.ChannelMessageSend(m.ChannelID, "This command only works on fridays")
if err != nil {
app.errorLog.Print(err)
return
}
return
}
_, err := s.ChannelMessageSend(m.ChannelID, "https://www.youtube.com/watch?v=kfVsfOSbJY0")
if err != nil {
app.errorLog.Print(err)
return
}
}
func (app *application) sendGithub(s *discordgo.Session, m *discordgo.MessageCreate) {
_, err := s.ChannelMessageSend(m.ChannelID, "My code is hosted publicly over at https://github.com/DutchEllie/pepebot")
if err != nil {
@ -131,6 +148,20 @@ func (app *application) sendPeski(s *discordgo.Session, m *discordgo.MessageCrea
}
}
func (app *application) sendProper(s *discordgo.Session, m *discordgo.MessageCreate) {
responseList := []string{"That's proper", "I use Gentoo", "So based", "That's best practice", "Emacs is the best", "Lisp is so fucking based", "My website is here https://forestofunix.xyz\nIt's written in Lisp. It's so based!"}
source := rand.NewSource(time.Now().UnixNano())
rng := rand.New(source)
index := rng.Intn(len(responseList))
_, err := s.ChannelMessageSend(m.ChannelID, fmt.Sprintf("\"%s\"\n-Sebastiaan", responseList[index]))
if err != nil {
app.errorLog.Print(err)
return
}
}
func (app *application) sendManyPepes(s *discordgo.Session, m *discordgo.MessageCreate, splitCommand []string) {
override := false