Added proper

This commit is contained in:
DutchEllie 2021-12-17 15:38:34 +01:00
parent a7f2016ae0
commit 3cd6421a52
2 changed files with 17 additions and 0 deletions

View File

@ -59,6 +59,8 @@ func (app *application) messageCreate(s *discordgo.Session, m *discordgo.Message
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"
@ -147,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{"Proper", "Gentoo", "Based", "Best practice", "Tiled WM", "Emacs", "Lisp"}
source := rand.NewSource(time.Now().UnixNano())
rng := rand.New(source)
index := rng.Intn(len(responseList))
_, err := s.ChannelMessageSend(m.ChannelID, responseList[index])
if err != nil {
app.errorLog.Print(err)
return
}
}
func (app *application) sendManyPepes(s *discordgo.Session, m *discordgo.MessageCreate, splitCommand []string) {
override := false