feat: import/export settings, send backup of settings when leaving guild
This commit is contained in:
parent
e6d68338db
commit
db5d7bb4f8
18 changed files with 392 additions and 39 deletions
|
|
@ -137,6 +137,23 @@ public class GuildRepository(ILogger logger, DatabaseConnection conn)
|
|||
new { Id = id.Value, Channels = config }
|
||||
);
|
||||
|
||||
public async Task ImportConfigAsync(
|
||||
ulong id,
|
||||
Guild.ChannelConfig channels,
|
||||
string[] bannedSystems,
|
||||
ulong[] keyRoles
|
||||
) =>
|
||||
await conn.ExecuteAsync(
|
||||
"update guilds set channels = @channels::jsonb, banned_systems = @bannedSystems, key_roles = @keyRoles where id = @id",
|
||||
new
|
||||
{
|
||||
id,
|
||||
channels,
|
||||
bannedSystems,
|
||||
keyRoles,
|
||||
}
|
||||
);
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
conn.Dispose();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue