Compare commits
3 Commits
95c1d2cca5
...
b1f9b721fd
Author | SHA1 | Date | |
---|---|---|---|
b1f9b721fd | |||
3cd6421a52 | |||
a7f2016ae0 |
discord
@ -53,10 +53,14 @@ func (app *application) messageCreate(s *discordgo.Session, m *discordgo.Message
|
|||||||
app.sendTuesday(s, m)
|
app.sendTuesday(s, m)
|
||||||
case "wednesday":
|
case "wednesday":
|
||||||
app.sendWednesday(s, m)
|
app.sendWednesday(s, m)
|
||||||
|
case "friday":
|
||||||
|
app.sendFriday(s, m)
|
||||||
case "github", "source":
|
case "github", "source":
|
||||||
app.sendGithub(s, m)
|
app.sendGithub(s, m)
|
||||||
case "peski", "rotterdam":
|
case "peski", "rotterdam":
|
||||||
app.sendPeski(s, m)
|
app.sendPeski(s, m)
|
||||||
|
case "proper", "based":
|
||||||
|
app.sendProper(s, m)
|
||||||
/* --- Bot commands for words --- */
|
/* --- Bot commands for words --- */
|
||||||
case "spam":
|
case "spam":
|
||||||
app.sendManyPepes(s, m, splitCommand)
|
app.sendManyPepes(s, m, splitCommand)
|
||||||
|
@ -4,6 +4,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
"math/rand"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"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) {
|
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")
|
_, err := s.ChannelMessageSend(m.ChannelID, "My code is hosted publicly over at https://github.com/DutchEllie/pepebot")
|
||||||
if err != nil {
|
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) {
|
func (app *application) sendManyPepes(s *discordgo.Session, m *discordgo.MessageCreate, splitCommand []string) {
|
||||||
override := false
|
override := false
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user