mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-05-23 14:01:37 +03:00
Merge branch 'master' of https://github.com/mctaylors/Boyfriend-CSharp
This commit is contained in:
commit
6b36e2c310
10 changed files with 475 additions and 34 deletions
Boyfriend/Commands
|
@ -26,8 +26,8 @@ public sealed class MuteCommand : ICommand {
|
|||
|
||||
var rolesRemoved = Boyfriend.GetRemovedRoles(cmd.Context.Guild.Id);
|
||||
|
||||
if (rolesRemoved.ContainsKey(toMute.Id)) {
|
||||
foreach (var roleId in rolesRemoved[toMute.Id]) await toMute.AddRoleAsync(roleId);
|
||||
if (rolesRemoved.TryGetValue(toMute.Id, out var mutedRemovedRoles)) {
|
||||
foreach (var roleId in mutedRemovedRoles) await toMute.AddRoleAsync(roleId);
|
||||
rolesRemoved.Remove(toMute.Id);
|
||||
cmd.ConfigWriteScheduled = true;
|
||||
cmd.Reply(Messages.RolesReturned, ":warning: ");
|
||||
|
|
|
@ -110,10 +110,9 @@ public sealed class SettingsCommand : ICommand {
|
|||
};
|
||||
|
||||
if (value is "reset" or "default") {
|
||||
if (selectedSetting is "WelcomeMessage")
|
||||
config[selectedSetting] = Messages.DefaultWelcomeMessage;
|
||||
else
|
||||
config[selectedSetting] = Boyfriend.DefaultConfig[selectedSetting];
|
||||
config[selectedSetting] = selectedSetting is "WelcomeMessage"
|
||||
? Messages.DefaultWelcomeMessage
|
||||
: Boyfriend.DefaultConfig[selectedSetting];
|
||||
} else {
|
||||
if (value == config[selectedSetting]) {
|
||||
cmd.Reply(string.Format(Messages.SettingsNothingChanged, localizedSelectedSetting, formattedValue),
|
||||
|
|
|
@ -23,8 +23,8 @@ public sealed class UnmuteCommand : ICommand {
|
|||
if (role != null && toUnmute.Roles.Contains(role)) {
|
||||
var rolesRemoved = Boyfriend.GetRemovedRoles(cmd.Context.Guild.Id);
|
||||
|
||||
if (rolesRemoved.ContainsKey(toUnmute.Id)) {
|
||||
await toUnmute.AddRolesAsync(rolesRemoved[toUnmute.Id]);
|
||||
if (rolesRemoved.TryGetValue(toUnmute.Id, out var unmutedRemovedRoles)) {
|
||||
await toUnmute.AddRolesAsync(unmutedRemovedRoles);
|
||||
rolesRemoved.Remove(toUnmute.Id);
|
||||
cmd.ConfigWriteScheduled = true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue