mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-04-29 10:39:53 +03:00
fixed a few bugs in settings + code style consistency with string comparison
This commit is contained in:
parent
a06376443f
commit
2493e317d0
8 changed files with 72 additions and 51 deletions
|
@ -5,16 +5,16 @@ using Discord.WebSocket;
|
|||
namespace Boyfriend.Commands;
|
||||
|
||||
public class ClearCommand : Command {
|
||||
public override string[] Aliases { get; } = {"clear", "purge", "очистить", "стереть"};
|
||||
public override string[] Aliases { get; } = { "clear", "purge", "очистить", "стереть" };
|
||||
public override int ArgsLengthRequired => 1;
|
||||
|
||||
public override async Task Run(SocketCommandContext context, string[] args) {
|
||||
var user = (SocketGuildUser) context.User;
|
||||
var user = (SocketGuildUser)context.User;
|
||||
|
||||
if (context.Channel is not SocketTextChannel channel) throw new Exception();
|
||||
|
||||
var permissionCheckResponse = CommandHandler.HasPermission(ref user, GuildPermission.ManageMessages);
|
||||
if (permissionCheckResponse != "") {
|
||||
if (permissionCheckResponse is not "") {
|
||||
Error(permissionCheckResponse, true);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue