mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-05-05 13:36:30 +03:00
General code refactor (and a few breaking config changes)
This commit is contained in:
parent
0e144db2e2
commit
552c575dd2
15 changed files with 1164 additions and 879 deletions
|
@ -8,15 +8,14 @@ public sealed class KickCommand : ICommand {
|
|||
|
||||
public async Task RunAsync(CommandProcessor cmd, string[] args, string[] cleanArgs) {
|
||||
var toKick = cmd.GetMember(args, cleanArgs, 0, "ToKick");
|
||||
if (toKick == null || !cmd.HasPermission(GuildPermission.KickMembers)) return;
|
||||
if (toKick is null || !cmd.HasPermission(GuildPermission.KickMembers)) return;
|
||||
|
||||
if (!cmd.CanInteractWith(toKick, "Kick")) return;
|
||||
|
||||
await KickMemberAsync(cmd, toKick, cmd.GetRemaining(args, 1, "KickReason"));
|
||||
if (cmd.CanInteractWith(toKick, "Kick"))
|
||||
await KickMemberAsync(cmd, toKick, cmd.GetRemaining(args, 1, "KickReason"));
|
||||
}
|
||||
|
||||
private static async Task KickMemberAsync(CommandProcessor cmd, SocketGuildUser toKick, string? reason) {
|
||||
if (reason == null) return;
|
||||
if (reason is null) return;
|
||||
var guildKickMessage = $"({cmd.Context.User}) {reason}";
|
||||
|
||||
await Utils.SendDirectMessage(toKick,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue