Added initial support for detecting videos, prevent music messages from showing on soundboard commands, fixed(?) permission checking

This commit is contained in:
TheEssem 2021-04-19 09:31:39 -05:00
parent 8aa0cc2163
commit c67499af9d
6 changed files with 26 additions and 22 deletions

View file

@ -4,7 +4,8 @@ const Command = require("../../classes/command.js");
class ChannelCommand extends Command {
async run() {
if (!this.message.channel.guild) return `${this.message.author.mention}, this command only works in servers!`;
if (!this.message.member.permissions.has("administrator") && this.message.member.id !== process.env.OWNER) return `${this.message.author.mention}, you need to be an administrator to enable/disable me!`;
console.log(this.message.member.permission);
if (!this.message.member.permission.has("administrator") && this.message.member.id !== process.env.OWNER) return `${this.message.author.mention}, you need to be an administrator to enable/disable me!`;
if (this.args.length === 0) return `${this.message.author.mention}, you need to provide whether I should be enabled or disabled in this channel!`;
if (this.args[0] !== "disable" && this.args[0] !== "enable") return `${this.message.author.mention}, that's not a valid option!`;

View file

@ -6,7 +6,7 @@ class PrefixCommand extends Command {
if (!this.message.channel.guild) return `${this.message.author.mention}, this command only works in servers!`;
const guild = await database.getGuild(this.message.channel.guild.id);
if (this.args.length !== 0) {
if (!this.message.member.permissions.has("administrator") && this.message.member.id !== process.env.OWNER) return `${this.message.author.mention}, you need to be an administrator to change the bot prefix!`;
if (!this.message.member.permission.has("administrator") && this.message.member.id !== process.env.OWNER) return `${this.message.author.mention}, you need to be an administrator to change the bot prefix!`;
await database.setPrefix(this.args[0], this.message.channel.guild);
return `The prefix has been changed to ${this.args[0]}.`;
} else {