1
0
Fork 1
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:
Octol1ttle 2022-09-18 19:41:29 +05:00
parent ac63719a0b
commit e767205c1a
Signed by: Octol1ttle
GPG key ID: B77C34313AEE1FFF
20 changed files with 873 additions and 123 deletions

View file

@ -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";
}
}
}