Role Info, Permissions Stuff

This commit is contained in:
Daniel Odendahl Jr
2017-07-24 16:47:26 +00:00
parent ffd73cc21c
commit 4339ae0134
5 changed files with 89 additions and 3 deletions
+3 -2
View File
@@ -1,4 +1,5 @@
const { Command } = require('discord.js-commando');
const perms = require('../assets/json/permissions');
class XiaoCommand extends Command {
constructor(client, info) {
@@ -25,14 +26,14 @@ class XiaoCommand extends Command {
if (this.clientPermissions) {
for (const permission of this.clientPermissions) {
if (!msg.channel.permissionsFor(this.client.user).has(permission)) {
return `This Command requires the \`${permission}\` Permission.`;
return `This Command requires the \`${perms[permission]}\` Permission.`;
}
}
}
if (this.userPermissions) {
for (const permission of this.userPermissions) {
if (!msg.channel.permissionsFor(msg.author).has(permission)) {
return `You do not have the \`${permission}\` Permission.`;
return `You do not have the \`${perms[permission]}\` Permission.`;
}
}
}
+5
View File
@@ -11,6 +11,11 @@ class Util {
.replace(/(&)/g, '&')
.replace(/(\[i\]|\[\/i\])/g, '*');
}
static placeholder({ size, color }) {
if (!size) size = '200x200';
return `http://via.placeholder.com/${size}/${color}/${color}`;
}
static dBots(count, id) {
snekfetch
.post(`https://bots.discord.pw/api/bots/${id}/stats`)