From cc55744ba0183b8bbff280ab4b5c13609259b1a1 Mon Sep 17 00:00:00 2001 From: uakci Date: Sun, 30 Jul 2023 18:14:41 +0200 Subject: tweak logic (bad code but am tired) --- bot.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'bot.go') diff --git a/bot.go b/bot.go index abd41e0..1172f10 100644 --- a/bot.go +++ b/bot.go @@ -97,18 +97,19 @@ type Response struct { } func Respond(dg *discordgo.Session, ms *discordgo.MessageCreate) { - if ms.Message.Content == "" { + if ms.Message.Content == "" || (ms.Author.Bot && ms.Author.ID != dg.State.User.ID) { return } - own := ms.Author.ID == dg.State.User.ID + sigil := ">" - if own { + if ms.Author.Bot { sigil = "<" } log.Printf("\n%s %s", sigil, strings.Join(strings.Split(ms.Message.Content, "\n"), "\n ")) - if own || ms.Author.Bot { + if ms.Author.Bot { return } + respond(ms.Message.Content, func(r Response) { files := make([]*discordgo.File, 0, 1) -- cgit v1.2.3