eslint config aqua

This commit is contained in:
Daniel Odendahl Jr
2017-07-27 21:00:54 +00:00
parent 93fd5f6caa
commit 53e1d6a8ff
176 changed files with 6713 additions and 7642 deletions
+36 -36
View File
@@ -2,44 +2,44 @@ const { Command } = require('discord.js-commando');
const perms = require('../assets/json/permissions');
class XiaoCommand extends Command {
constructor(client, info) {
super(client, info);
constructor(client, info) {
super(client, info);
this.ownerOnly = info.ownerOnly;
this.nsfw = info.nsfw;
this.clientPermissions = info.clientPermissions;
this.userPermissions = info.userPermissions;
this.throttling = info.throttling || {
usages: 1,
duration: 2
};
}
this.ownerOnly = info.ownerOnly;
this.nsfw = info.nsfw;
this.clientPermissions = info.clientPermissions;
this.userPermissions = info.userPermissions;
this.throttling = info.throttling || {
usages: 1,
duration: 2
};
}
hasPermission(msg) {
if (this.ownerOnly && !this.client.isOwner(msg.author)) {
return 'This Command can only be used by the bot owner.';
}
if (this.nsfw && !msg.channel.nsfw) {
return 'This Command can only be used in NSFW Channels.';
}
if (msg.channel.type !== 'dm') {
if (this.clientPermissions) {
for (const permission of this.clientPermissions) {
if (!msg.channel.permissionsFor(this.client.user).has(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 \`${perms[permission]}\` Permission.`;
}
}
}
}
return true;
}
hasPermission(msg) {
if (this.ownerOnly && !this.client.isOwner(msg.author)) {
return 'This Command can only be used by the bot owner.';
}
if (this.nsfw && !msg.channel.nsfw) {
return 'This Command can only be used in NSFW Channels.';
}
if (msg.channel.type !== 'dm') {
if (this.clientPermissions) {
for (const permission of this.clientPermissions) {
if (!msg.channel.permissionsFor(this.client.user).has(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 \`${perms[permission]}\` Permission.`;
}
}
}
}
return true;
}
}
module.exports = XiaoCommand;
+35 -35
View File
@@ -2,44 +2,44 @@ const snekfetch = require('snekfetch');
const { carbonKey, dbotsKey, dbotsOrgKey } = require('../config');
class Util {
static cleanXML(str) {
return str
.replace(/(<br \/>)/g, '')
.replace(/(&#039;)/g, '\'')
.replace(/(&mdash;)/g, '—')
.replace(/(&#034;|&quot;)/g, '"')
.replace(/(&#038;)/g, '&')
.replace(/(\[i\]|\[\/i\])/g, '*');
}
static cleanXML(str) {
return str
.replace(/(<br \/>)/g, '')
.replace(/(&#039;)/g, '\'')
.replace(/(&mdash;)/g, '—')
.replace(/(&#034;|&quot;)/g, '"')
.replace(/(&#038;)/g, '&')
.replace(/(\[i\]|\[\/i\])/g, '*');
}
static dBots(count, id) {
snekfetch
.post(`https://bots.discord.pw/api/bots/${id}/stats`)
.set({ Authorization: dbotsKey })
.send({ server_count: count })
.then(() => console.log('[DBOTS] Successfully posted to Discord Bots.'))
.catch((err) => console.error(`[DBOTS] Failed to post to Discord Bots. ${err}`));
}
static dBots(count, id) {
snekfetch
.post(`https://bots.discord.pw/api/bots/${id}/stats`)
.set({ Authorization: dbotsKey })
.send({ server_count: count })
.then(() => console.log('[DBOTS] Successfully posted to Discord Bots.'))
.catch(err => console.error(`[DBOTS] Failed to post to Discord Bots. ${err}`));
}
static carbon(count) {
snekfetch
.post('https://www.carbonitex.net/discord/data/botdata.php')
.send({
key: carbonKey,
servercount: count
})
.then(() => console.log('[CARBON] Successfully posted to Carbon.'))
.catch((err) => console.error(`[CARBON] Failed to post to Carbon. ${err}`));
}
static carbon(count) {
snekfetch
.post('https://www.carbonitex.net/discord/data/botdata.php')
.send({
key: carbonKey,
servercount: count
})
.then(() => console.log('[CARBON] Successfully posted to Carbon.'))
.catch(err => console.error(`[CARBON] Failed to post to Carbon. ${err}`));
}
static dBotsOrg(count, id) {
snekfetch
.post(`https://discordbots.org/api/bots/${id}/stats`)
.set({ Authorization: dbotsOrgKey })
.send({ server_count: count })
.then(() => console.log('[DBOTSORG] Successfully posted to Discord Bots Org.'))
.catch((err) => console.error(`[DBOTSORG] Failed to post to Discord Bots Org. ${err}`));
}
static dBotsOrg(count, id) {
snekfetch
.post(`https://discordbots.org/api/bots/${id}/stats`)
.set({ Authorization: dbotsOrgKey })
.send({ server_count: count })
.then(() => console.log('[DBOTSORG] Successfully posted to Discord Bots Org.'))
.catch(err => console.error(`[DBOTSORG] Failed to post to Discord Bots Org. ${err}`));
}
}
module.exports = Util;