diff options
| author | uakci <git@uakci.space> | 2023-07-30 18:14:41 +0200 |
|---|---|---|
| committer | uakci <git@uakci.space> | 2023-07-30 18:14:41 +0200 |
| commit | cc55744ba0183b8bbff280ab4b5c13609259b1a1 (patch) | |
| tree | 2004b01a81efa2d84de7f26788764e1c1879f59d | |
| parent | ignore bot accounts (diff) | |
| download | nuogai-cc55744ba0183b8bbff280ab4b5c13609259b1a1.tar.gz nuogai-cc55744ba0183b8bbff280ab4b5c13609259b1a1.zip | |
tweak logic (bad code but am tired)
| -rw-r--r-- | bot.go | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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) |
