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:
parent
f5a81fba35
commit
163e3ac46b
8 changed files with 56 additions and 167 deletions
|
@ -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";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue