feat: split ignores into 'ignore messages' and 'ignore entities'

This commit is contained in:
sam 2024-11-18 00:47:27 +01:00
parent d48ab7e16e
commit 0cac964aa6
Signed by: sam
GPG key ID: 5F3C3C1B3166639D
32 changed files with 730 additions and 488 deletions

View file

@ -62,10 +62,14 @@ public static class GuildImport
GoGuild guild
)
{
var channels = new Guild.ChannelConfig
var messages = new Guild.MessageConfig
{
IgnoredChannels = guild.IgnoredChannels.ToList(),
IgnoredUsers = guild.IgnoredUsers.ToList(),
};
var channels = new Guild.ChannelConfig
{
GuildUpdate = guild.Channels.TryParse("GUILD_UPDATE"),
GuildEmojisUpdate = guild.Channels.TryParse("GUILD_EMOJIS_UPDATE"),
GuildRoleCreate = guild.Channels.TryParse("GUILD_ROLE_CREATE"),
@ -97,13 +101,14 @@ public static class GuildImport
await conn.ExecuteAsync(
"""
insert into guilds (id, channels, banned_systems, key_roles)
values (@Id, @Channels::jsonb, @BannedSystems, @KeyRoles)
insert into guilds (id, channels, messages, banned_systems, key_roles)
values (@Id, @channels::jsonb, @messages::jsonb, @BannedSystems, @KeyRoles)
""",
new
{
guild.Id,
Channels = channels,
messages,
channels,
guild.BannedSystems,
guild.KeyRoles,
},