mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-04-30 02:59:54 +03:00
Seal all possible classes, add LICENSE, follow async naming conventions
This commit is contained in:
parent
ac63719a0b
commit
e767205c1a
20 changed files with 873 additions and 123 deletions
|
@ -2,10 +2,10 @@
|
|||
|
||||
namespace Boyfriend.Commands;
|
||||
|
||||
public class SettingsCommand : Command {
|
||||
public override string[] Aliases { get; } = { "settings", "config", "настройки", "конфиг" };
|
||||
public sealed class SettingsCommand : ICommand {
|
||||
public string[] Aliases { get; } = { "settings", "config", "настройки", "конфиг" };
|
||||
|
||||
public override Task Run(CommandProcessor cmd, string[] args) {
|
||||
public Task RunAsync(CommandProcessor cmd, string[] args, string[] cleanArgs) {
|
||||
if (!cmd.HasPermission(GuildPermission.ManageGuild)) return Task.CompletedTask;
|
||||
|
||||
var guild = cmd.Context.Guild;
|
||||
|
@ -48,7 +48,7 @@ public class SettingsCommand : Command {
|
|||
|
||||
var exists = false;
|
||||
// ReSharper disable once ForeachCanBePartlyConvertedToQueryUsingAnotherGetEnumerator
|
||||
// The performance impact is not worth it
|
||||
// Too many allocations
|
||||
foreach (var setting in Boyfriend.DefaultConfig.Keys) {
|
||||
if (selectedSetting != setting.ToLower()) continue;
|
||||
selectedSetting = setting;
|
||||
|
@ -161,4 +161,4 @@ public class SettingsCommand : Command {
|
|||
private static bool IsBool(string value) {
|
||||
return value is "true" or "false";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue