Removes server-admin requirement for admin commands
This commit is contained in:
parent
26ec841db1
commit
84382b4ab4
|
@ -10,7 +10,6 @@ namespace BiblioTech
|
||||||
public abstract string StartingMessage { get; }
|
public abstract string StartingMessage { get; }
|
||||||
public abstract string Description { get; }
|
public abstract string Description { get; }
|
||||||
public virtual CommandOption[] Options => Array.Empty<CommandOption>();
|
public virtual CommandOption[] Options => Array.Empty<CommandOption>();
|
||||||
public virtual bool IsAdminCommand => false;
|
|
||||||
|
|
||||||
public async Task SlashCommandHandler(SocketSlashCommand command)
|
public async Task SlashCommandHandler(SocketSlashCommand command)
|
||||||
{
|
{
|
||||||
|
|
|
@ -30,12 +30,6 @@ namespace BiblioTech
|
||||||
.WithName(c.Name)
|
.WithName(c.Name)
|
||||||
.WithDescription(c.Description);
|
.WithDescription(c.Description);
|
||||||
|
|
||||||
if (c.IsAdminCommand)
|
|
||||||
{
|
|
||||||
builder.WithDefaultPermission(false);
|
|
||||||
builder.WithDefaultMemberPermissions(GuildPermission.Administrator);
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (var option in c.Options)
|
foreach (var option in c.Options)
|
||||||
{
|
{
|
||||||
builder.AddOption(option.Build());
|
builder.AddOption(option.Build());
|
||||||
|
|
|
@ -25,7 +25,6 @@ namespace BiblioTech.Commands
|
||||||
public override string Name => "admin";
|
public override string Name => "admin";
|
||||||
public override string StartingMessage => "...";
|
public override string StartingMessage => "...";
|
||||||
public override string Description => "Admins only.";
|
public override string Description => "Admins only.";
|
||||||
public override bool IsAdminCommand => true;
|
|
||||||
|
|
||||||
public override CommandOption[] Options => new CommandOption[]
|
public override CommandOption[] Options => new CommandOption[]
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue