fix: actually store ignored channels/roles

This commit is contained in:
sam 2024-11-18 20:47:58 +01:00
parent 19d9f33454
commit e12bd6194b
Signed by: sam
GPG key ID: 5F3C3C1B3166639D
12 changed files with 37 additions and 25 deletions

View file

@ -261,7 +261,7 @@ public class ChannelCommandsComponents(
throw new ArgumentOutOfRangeException();
}
await guildRepository.UpdateChannelConfigAsync(guildId, guildConfig);
await guildRepository.UpdateConfigAsync(guildId, guildConfig);
goto case "return";
case "return":
var (e, c) = ChannelCommands.BuildRootMenu(guildChannels, guild, guildConfig);
@ -384,7 +384,7 @@ public class ChannelCommandsComponents(
throw new ArgumentOutOfRangeException();
}
await guildRepository.UpdateChannelConfigAsync(guildId, guildConfig);
await guildRepository.UpdateConfigAsync(guildId, guildConfig);
List<IEmbed> embeds =
[

View file

@ -75,7 +75,7 @@ public partial class IgnoreMessageCommands : CommandGroup
);
guildConfig.Messages.IgnoredChannels.Add(channel.ID.Value);
await guildRepository.UpdateChannelConfigAsync(guildId, guildConfig);
await guildRepository.UpdateConfigAsync(guildId, guildConfig);
return await feedbackService.ReplyAsync(
$"Successfully added {(channel.Type == ChannelType.GuildCategory ? channel.Name : $"<#{channel.ID}>")} to the list of ignored channels."
@ -98,7 +98,7 @@ public partial class IgnoreMessageCommands : CommandGroup
);
guildConfig.Messages.IgnoredChannels.Remove(channel.ID.Value);
await guildRepository.UpdateChannelConfigAsync(guildId, guildConfig);
await guildRepository.UpdateConfigAsync(guildId, guildConfig);
return await feedbackService.ReplyAsync(
$"Successfully removed {(channel.Type == ChannelType.GuildCategory ? channel.Name : $"<#{channel.ID}>")} from the list of ignored channels."

View file

@ -54,7 +54,7 @@ public partial class IgnoreMessageCommands
);
guildConfig.Messages.IgnoredRoles.Add(role.ID.Value);
await guildRepository.UpdateChannelConfigAsync(guildId, guildConfig);
await guildRepository.UpdateConfigAsync(guildId, guildConfig);
return await feedbackService.ReplyAsync(
$"Successfully added {role.Name} to the list of ignored roles."
@ -77,7 +77,7 @@ public partial class IgnoreMessageCommands
);
guildConfig.Messages.IgnoredRoles.Remove(role.ID.Value);
await guildRepository.UpdateChannelConfigAsync(guildId, guildConfig);
await guildRepository.UpdateConfigAsync(guildId, guildConfig);
return await feedbackService.ReplyAsync(
$"Successfully removed {role.Name} from the list of ignored roles."

View file

@ -58,7 +58,7 @@ public partial class IgnoreMessageCommands
);
guildConfig.Messages.IgnoredUsers.Add(user.ID.Value);
await guildRepository.UpdateChannelConfigAsync(guildId, guildConfig);
await guildRepository.UpdateConfigAsync(guildId, guildConfig);
return await feedbackService.ReplyAsync(
$"Successfully added {user.PrettyFormat()} to the list of ignored users."
@ -81,7 +81,7 @@ public partial class IgnoreMessageCommands
);
guildConfig.Messages.IgnoredUsers.Remove(user.ID.Value);
await guildRepository.UpdateChannelConfigAsync(guildId, guildConfig);
await guildRepository.UpdateConfigAsync(guildId, guildConfig);
return await feedbackService.ReplyAsync(
$"Successfully removed {user.PrettyFormat()} from the list of ignored users."

View file

@ -61,7 +61,7 @@ public class RedirectCommands(
var (_, guildId) = contextInjectionService.GetUserAndGuild();
var guildConfig = await guildRepository.GetAsync(guildId);
guildConfig.Channels.Redirects[source.ID.Value] = target.ID.Value;
await guildRepository.UpdateChannelConfigAsync(guildId, guildConfig);
await guildRepository.UpdateConfigAsync(guildId, guildConfig);
var output =
$"Success! Edited and deleted messages from {FormatChannel(source)} will now be redirected to <#{target.ID}>.";
@ -101,7 +101,7 @@ public class RedirectCommands(
var guildConfig = await guildRepository.GetAsync(guildId);
var wasSet = guildConfig.Channels.Redirects.Remove(source.ID.Value);
await guildRepository.UpdateChannelConfigAsync(guildId, guildConfig);
await guildRepository.UpdateConfigAsync(guildId, guildConfig);
var output = wasSet
? $"Removed the redirect for {FormatChannel(source)}! Message logs from"