mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-04-29 18:49:53 +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 UnbanCommand : Command {
|
||||
public override string[] Aliases { get; } = { "unban", "разбан" };
|
||||
public sealed class UnbanCommand : ICommand {
|
||||
public string[] Aliases { get; } = { "unban", "разбан" };
|
||||
|
||||
public override async Task Run(CommandProcessor cmd, string[] args) {
|
||||
public async Task RunAsync(CommandProcessor cmd, string[] args, string[] cleanArgs) {
|
||||
if (!cmd.HasPermission(GuildPermission.BanMembers)) return;
|
||||
|
||||
var id = cmd.GetBan(args, 0);
|
||||
|
@ -13,10 +13,10 @@ public class UnbanCommand : Command {
|
|||
var reason = cmd.GetRemaining(args, 1, "UnbanReason");
|
||||
if (reason == null) return;
|
||||
|
||||
await UnbanUser(cmd, id.Value, reason);
|
||||
await UnbanUserAsync(cmd, id.Value, reason);
|
||||
}
|
||||
|
||||
public static async Task UnbanUser(CommandProcessor cmd, ulong id, string reason) {
|
||||
public static async Task UnbanUserAsync(CommandProcessor cmd, ulong id, string reason) {
|
||||
var requestOptions = Utils.GetRequestOptions($"({cmd.Context.User}) {reason}");
|
||||
await cmd.Context.Guild.RemoveBanAsync(id, requestOptions);
|
||||
|
||||
|
@ -24,4 +24,4 @@ public class UnbanCommand : Command {
|
|||
cmd.Reply(feedback);
|
||||
cmd.Audit(feedback);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue