From 6acad26f07679491817a21999e862e6723416ac1 Mon Sep 17 00:00:00 2001 From: DutchEllie Date: Thu, 23 Sep 2021 13:24:50 +0200 Subject: [PATCH] Reduced links per spam --- discord/simple.go | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/discord/simple.go b/discord/simple.go index 189a980..e1b67c8 100644 --- a/discord/simple.go +++ b/discord/simple.go @@ -13,30 +13,7 @@ import ( ) func (app *application) getPepeLink() (string, error) { - /*resp, err := http.Get("http://bbwroller.com/random") - if err != nil { - return "", err - } - body, err := ioutil.ReadAll(resp.Body) - if err != nil { - return "", err - } - rep, err := regexp.Compile("/static.*\\.jpg") - if err != nil { - return "", err - } - pepes := rep.FindAllString(string(body), 200) - if pepes == nil { - return "", err - } - randomIndex := rand.Intn(35) - url := "https://bbwroller.com" - url += pepes[randomIndex]*/ - - // The above function is old and useless. The website bbwroller.com is down - // o7 url := "http://" + app.pepeServer + "/pepe" - app.infoLog.Printf("Request url: %s", url) resp, err := http.Get(url) if err != nil { return "", err @@ -202,7 +179,7 @@ func (app *application) sendManyPepes(s *discordgo.Session, m *discordgo.Message return } - if len(msg+link) > 1950 { + if len(msg+link) > 512 { s.ChannelMessageSend(m.ChannelID, msg) msg = "" time.Sleep(time.Millisecond * 500)