1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-05-03 12:39:54 +03:00

Begin adapting code to new guild data storage

This commit is contained in:
Octol1ttle 2022-12-30 00:47:02 +05:00
parent f5a81fba35
commit 163e3ac46b
Signed by: Octol1ttle
GPG key ID: B77C34313AEE1FFF
8 changed files with 56 additions and 167 deletions

View file

@ -10,7 +10,8 @@ public sealed class SettingsCommand : ICommand {
if (!cmd.HasPermission(GuildPermission.ManageGuild)) return Task.CompletedTask;
var guild = cmd.Context.Guild;
var config = Boyfriend.GetGuildConfig(guild.Id);
var data = GuildData.FromSocketGuild(guild);
var config = data.Preferences;
if (args.Length is 0) {
var currentSettings = Boyfriend.StringBuilder.AppendLine(Messages.CurrentSettings);
@ -132,7 +133,7 @@ public sealed class SettingsCommand : ICommand {
return Task.CompletedTask;
}
if (selectedSetting is "MuteRole") Utils.RemoveMuteRoleFromCache(ulong.Parse(config[selectedSetting]));
if (selectedSetting is "MuteRole") data.MuteRole = guild.GetRole(mention);
config[selectedSetting] = value;
}
@ -158,4 +159,3 @@ public sealed class SettingsCommand : ICommand {
return value is "true" or "false";
}
}