diff --git a/package.json b/package.json index c071401..14ec10e 100644 --- a/package.json +++ b/package.json @@ -1,21 +1,21 @@ { "name": "robbot", - "version": "4.3.1", + "version": "4.3.2", "description": "Discord bot to along with the website megumin.love, built with discord.js", "main": "./src/robbot", "dependencies": { - "chalk": "^2.3.0", - "discord.js": "^11.3.0", + "chalk": "^2.3.2", + "discord.js": "^11.3.2", "erlpack": "^0.1.2", - "moment": "^2.20.1", + "moment": "^2.21.0", "opusscript": "^0.0.6", "prism-media": "github:hydrabolt/prism-media", - "snekfetch": "^3.6.1", + "snekfetch": "^4.0.0-beta.0", "uws": "^9.14.0", "zlib-sync": "^0.1.4" }, "devDependencies": { - "eslint": "^4.15.0" + "eslint": "^4.18.2" }, "scripts": { "test": "eslint src" diff --git a/src/controllers/CommandController.js b/src/controllers/CommandController.js index 1f2b9a1..2ac618c 100644 --- a/src/controllers/CommandController.js +++ b/src/controllers/CommandController.js @@ -87,7 +87,7 @@ class CommandController { }); } - permissionsCheck(command, message) { + async permissionsCheck(command, message) { let type = ''; const clientMember = message.guild.me; const { perms } = command; @@ -101,6 +101,8 @@ class CommandController { } } + if (!message.member) message.member = await message.guild.fetchMember(message.author); + if ('client' in perms && !clientMember.permissions.has(perms.client)) type = 'client'; if ('member' in perms && !message.member.permissions.has(perms.member)) type = 'member'; if (!type || (owners.includes(message.member.user.id) && type !== 'client')) return true;