style(messages,threads): format code

This commit is contained in:
Gustavo "Guz" L. de Mello
2024-08-30 14:44:42 -03:00
parent bb4051876a
commit 034fd9e905
3 changed files with 14 additions and 11 deletions

View File

@@ -65,6 +65,9 @@ func (c channelsInfo) Info() *dgo.ApplicationCommand {
Description: "The channel to manage", Description: "The channel to manage",
ChannelTypes: []dgo.ChannelType{ ChannelTypes: []dgo.ChannelType{
dgo.ChannelTypeGuildText, dgo.ChannelTypeGuildText,
dgo.ChannelTypeGuildForum,
dgo.ChannelTypeGuildPublicThread,
dgo.ChannelTypeGuildPrivateThread,
}, },
}}, }},
} }
@@ -264,6 +267,9 @@ func (c channelsSetLang) Info() *dgo.ApplicationCommand {
Description: "The channel to change the language", Description: "The channel to change the language",
ChannelTypes: []dgo.ChannelType{ ChannelTypes: []dgo.ChannelType{
dgo.ChannelTypeGuildText, dgo.ChannelTypeGuildText,
dgo.ChannelTypeGuildForum,
dgo.ChannelTypeGuildPublicThread,
dgo.ChannelTypeGuildPrivateThread,
}, },
}}, }},
} }

View File

@@ -1,14 +1,15 @@
package events package events
import ( import (
e "errors"
"log/slog"
"slices"
"dislate/internals/discord/bot/errors" "dislate/internals/discord/bot/errors"
"dislate/internals/discord/bot/gconf" "dislate/internals/discord/bot/gconf"
"dislate/internals/guilddb" "dislate/internals/guilddb"
"dislate/internals/translator" "dislate/internals/translator"
"dislate/internals/translator/lang" "dislate/internals/translator/lang"
e "errors"
"log/slog"
"slices"
dgo "github.com/bwmarrin/discordgo" dgo "github.com/bwmarrin/discordgo"
) )

View File

@@ -1,13 +1,14 @@
package events package events
import ( import (
e "errors"
"log/slog"
"sync"
"dislate/internals/discord/bot/errors" "dislate/internals/discord/bot/errors"
"dislate/internals/discord/bot/gconf" "dislate/internals/discord/bot/gconf"
gdb "dislate/internals/guilddb" gdb "dislate/internals/guilddb"
"dislate/internals/translator" "dislate/internals/translator"
e "errors"
"log/slog"
"sync"
dgo "github.com/bwmarrin/discordgo" dgo "github.com/bwmarrin/discordgo"
) )
@@ -25,11 +26,6 @@ func (h ThreadCreate) Serve(s *dgo.Session, ev *dgo.ThreadCreate) {
log := gconf.GetLogger(ev.GuildID, s, h.db) log := gconf.GetLogger(ev.GuildID, s, h.db)
log.Debug("Thread created!", slog.String("parent", ev.ParentID), slog.String("thread", ev.ID)) log.Debug("Thread created!", slog.String("parent", ev.ParentID), slog.String("thread", ev.ID))
if len(ev.AppliedTags) > 0 {
log.Debug("New thread is in forum, unimplemented, ignoring")
return
}
// INFO: Threads have the same ID as the origin message of them // INFO: Threads have the same ID as the origin message of them
threadMsg, err := h.db.Message(ev.GuildID, ev.ParentID, ev.ID) threadMsg, err := h.db.Message(ev.GuildID, ev.ParentID, ev.ID)
if e.Is(err, gdb.ErrNotFound) { if e.Is(err, gdb.ErrNotFound) {