feat: split ignores into 'ignore messages' and 'ignore entities'
This commit is contained in:
parent
d48ab7e16e
commit
0cac964aa6
32 changed files with 730 additions and 488 deletions
|
|
@ -131,24 +131,31 @@ public class GuildRepository(ILogger logger, DatabaseConnection conn)
|
|||
new { GuildId = guildId.Value, RoleId = roleId.Value }
|
||||
);
|
||||
|
||||
public async Task UpdateChannelConfigAsync(Snowflake id, Guild.ChannelConfig config) =>
|
||||
public async Task UpdateChannelConfigAsync(Snowflake id, Guild config) =>
|
||||
await conn.ExecuteAsync(
|
||||
"update guilds set channels = @Channels::jsonb where id = @Id",
|
||||
new { Id = id.Value, Channels = config }
|
||||
"update guilds set channels = @Channels::jsonb, messages = @Messages::jsonb where id = @Id",
|
||||
new
|
||||
{
|
||||
Id = id.Value,
|
||||
config.Channels,
|
||||
config.Messages,
|
||||
}
|
||||
);
|
||||
|
||||
public async Task ImportConfigAsync(
|
||||
ulong id,
|
||||
Guild.ChannelConfig channels,
|
||||
Guild.MessageConfig messages,
|
||||
string[] bannedSystems,
|
||||
ulong[] keyRoles
|
||||
) =>
|
||||
await conn.ExecuteAsync(
|
||||
"update guilds set channels = @channels::jsonb, banned_systems = @bannedSystems, key_roles = @keyRoles where id = @id",
|
||||
"update guilds set channels = @channels::jsonb, messages = @messages::jsonb, banned_systems = @bannedSystems, key_roles = @keyRoles where id = @id",
|
||||
new
|
||||
{
|
||||
id,
|
||||
channels,
|
||||
messages,
|
||||
bannedSystems,
|
||||
keyRoles,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue