From 54fff51e97f77d8974e388c130563ce722fd2d98 Mon Sep 17 00:00:00 2001 From: codepupper Date: Wed, 13 Nov 2019 22:12:14 +0100 Subject: [PATCH] fixing stupid bugs --- DiscordEvents/message.js | 7 ++++++- DiscordEvents/ready.js | 26 +++++++++----------------- DiscordModules/General/help.js | 2 +- DiscordModules/Roleplay/bang.js | 16 ++++++++-------- DiscordModules/Roleplay/boop.js | 15 +++++++-------- DiscordModules/Roleplay/bulge.js | 14 +++++++------- DiscordModules/Roleplay/cuddle.js | 15 +++++++-------- DiscordModules/Roleplay/hold.js | 14 +++++++------- DiscordModules/Roleplay/hug.js | 12 ++++++------ DiscordModules/Roleplay/kiss.js | 14 +++++++------- DiscordModules/Roleplay/lick.js | 14 +++++++------- DiscordModules/Roleplay/ncuddle.js | 14 +++++++------- DiscordModules/Roleplay/nhold.js | 14 +++++++------- DiscordModules/Roleplay/nhug.js | 14 +++++++------- DiscordModules/Roleplay/nkiss.js | 14 +++++++------- DiscordModules/Roleplay/nlick.js | 14 +++++++------- DiscordModules/Settings/prefix.js | 26 +++++++++++++++++--------- 17 files changed, 124 insertions(+), 121 deletions(-) diff --git a/DiscordEvents/message.js b/DiscordEvents/message.js index 53b6956..1b7c501 100755 --- a/DiscordEvents/message.js +++ b/DiscordEvents/message.js @@ -54,12 +54,15 @@ module.exports = { client.cooldowns.set(cmd.name, new Collection()); } + if (ctx.isDeveloper) { + cmd.AuthorPermissions = 'NONE'; + } if (cmd.guildOnly && !msg.guild) return; if (cmd.nsfw && !ctx.channel.nsfw) return ctx.send('This channel is not marked as NSFW, please mark it as such and rerun this command.'); if (cmd.developerOnly && !client.config.developers.find((dev) => msg.author.id == dev.id)) return; if (cmd.AuthorPermissions !== 'NONE' && !ctx.member.permissions.has(cmd.AuthorPermissions)) { - return ctx.send(`You need \`${cmd.AuthorPermissions}\` Permission(s) to run this Command`); + return ctx.send(`You need the \`${cmd.AuthorPermissions}\` Permission(s) to run this Command`); } const now = Date.now(); const timestamps = client.cooldowns.get(cmd.name); @@ -90,6 +93,8 @@ module.exports = { cmd.name + ' | ' + err.message, `Full Error: ${err} + + Content: ${ctx.msg.content} Author: ${msg.author.tag} (${msg.author.id}) Server: ${msg.guild.name} (${msg.guild.id})`, diff --git a/DiscordEvents/ready.js b/DiscordEvents/ready.js index 50b2676..bbc3cdb 100755 --- a/DiscordEvents/ready.js +++ b/DiscordEvents/ready.js @@ -1,12 +1,11 @@ -const { - log -} = require('../utils'); +const { log } = require('../utils'); const config = require('../config'); const blapi = require('blapi'); //blapi.setLogging(true); function randomStatus(client) { - const States = [{ + const States = [ + { activity: { name: 'server fans whirr 💨', type: 'LISTENING' @@ -15,20 +14,18 @@ function randomStatus(client) { }, { activity: { - name: "my master's keyboard -w-", + name: 'True Damage - GIANTS', type: 'LISTENING' }, status: 'online' }, { activity: { - name: client.guilds.size + ' Servers -w-', + name: `${client.guilds.size} Servers -w-`, type: 'WATCHING' }, status: 'online' }, - // { game: { name: `${client.users.get('318044130796109825').username} dance~`, type: 'WATCHING' }, status: 'dnd' }, - // { game: { name: thal.users.size + ' Wolves', type: 'WATCHING' }, status: 'dnd' }, { activity: { name: 'Δ & ♫', @@ -36,13 +33,6 @@ function randomStatus(client) { }, status: 'online' }, - { - activity: { - name: 'True Damage - GIANTS', - type: 'LISTENING' - }, - status: 'online' - }, { activity: { name: `'help | thaldr.in`, @@ -59,11 +49,13 @@ function randomStatus(client) { module.exports = { name: 'ready', run: async (client) => { - blapi.handle(client, config.apis); + if (client.user.id === '434662676547764244') { + blapi.handle(client, config.apis); + } log.hasStarted(); randomStatus(client); setInterval(() => { randomStatus(client); }, 60000); } -}; \ No newline at end of file +}; diff --git a/DiscordModules/General/help.js b/DiscordModules/General/help.js index e9ce4d7..33fdcc4 100755 --- a/DiscordModules/General/help.js +++ b/DiscordModules/General/help.js @@ -80,6 +80,7 @@ module.exports = class Help extends Command { (c) => c.name == ctx.args[0].toLowerCase() || (c.aliases && c.aliases.includes(ctx.args[0].toLowerCase())) ); + console.log(command); let fields = [ { @@ -108,7 +109,6 @@ module.exports = class Help extends Command { inline: true } ]; - if (!command) return ctx.send(`That command couldn't be found. See the \`help\` command for valid commands.`); diff --git a/DiscordModules/Roleplay/bang.js b/DiscordModules/Roleplay/bang.js index 2fc6773..6839391 100644 --- a/DiscordModules/Roleplay/bang.js +++ b/DiscordModules/Roleplay/bang.js @@ -6,7 +6,7 @@ module.exports = class Bang extends Command { constructor() { super({ name: 'bang', - description: 'Cuddle a user', + description: 'Bang a user', aliases: [ 'fuck' ], module: 'Roleplay', cooldown: 2, @@ -25,7 +25,13 @@ module.exports = class Bang extends Command { const Server = await ctx.db.servers.get(ctx.guild.id); let Line; - if (Server.rp_text) { + let Settings; + if (Server === null) { + Settings = ctx.utils.db.defaults.server; + } else { + Settings = Server; + } + if (Settings.rp_text) { const LineFromUtils = ctx.utils.int.bang[parseInt(Math.random() * ctx.utils.int.bang.length)]; Line = LineFromUtils.replace(/0/g, ctx.utils.format.bold(ctx.author.username)).replace( /1/g, @@ -35,12 +41,6 @@ module.exports = class Bang extends Command { Line = undefined; } - let Settings; - if (Server === null) { - Settings = ctx.utils.db.defaults.server; - } else { - Settings = Server; - } let req; let Message; await yiff.furrybot.nsfw.bang().then((E) => (req = E)); diff --git a/DiscordModules/Roleplay/boop.js b/DiscordModules/Roleplay/boop.js index 3b7102b..cc2af29 100644 --- a/DiscordModules/Roleplay/boop.js +++ b/DiscordModules/Roleplay/boop.js @@ -25,7 +25,13 @@ module.exports = class Boop extends Command { const Server = await ctx.db.servers.get(ctx.guild.id); let Line; - if (Server.rp_text) { + let Settings; + if (Server === null) { + Settings = ctx.utils.db.defaults.server; + } else { + Settings = Server; + } + if (Settings.rp_text) { const LineFromUtils = ctx.utils.int.boop[parseInt(Math.random() * ctx.utils.int.boop.length)]; Line = LineFromUtils.replace(/0/g, ctx.utils.format.bold(ctx.author.username)).replace( /1/g, @@ -34,13 +40,6 @@ module.exports = class Boop extends Command { } else { Line = undefined; } - - let Settings; - if (Server === null) { - Settings = ctx.utils.db.defaults.server; - } else { - Settings = Server; - } let req; let Message; await yiff.furrybot.sfw.boop().then((E) => (req = E)); diff --git a/DiscordModules/Roleplay/bulge.js b/DiscordModules/Roleplay/bulge.js index 11430b0..b7789f2 100644 --- a/DiscordModules/Roleplay/bulge.js +++ b/DiscordModules/Roleplay/bulge.js @@ -19,7 +19,13 @@ module.exports = class Bulge extends Command { async command(ctx) { let Line; const Server = await ctx.db.servers.get(ctx.guild.id); - if (ctx.msg.mentions.members.size > 0 && Server.rp_text) { + let Settings; + if (Server === null) { + Settings = ctx.utils.db.defaults.server; + } else { + Settings = Server; + } + if (ctx.msg.mentions.members.size > 0 && Settings.rp_text) { const LineFromUtils = ctx.utils.int.bulge[parseInt(Math.random() * ctx.utils.int.bulge.length)]; Line = LineFromUtils.replace(/0/g, ctx.utils.format.bold(ctx.author.username)).replace( /1/g, @@ -29,12 +35,6 @@ module.exports = class Bulge extends Command { Line = undefined; } - let Settings; - if (Server === null) { - Settings = ctx.utils.db.defaults.server; - } else { - Settings = Server; - } let req; let Message; await yiff.furrybot.nsfw.bulge().then((E) => (req = E)); diff --git a/DiscordModules/Roleplay/cuddle.js b/DiscordModules/Roleplay/cuddle.js index ad8d6d3..ae7da31 100644 --- a/DiscordModules/Roleplay/cuddle.js +++ b/DiscordModules/Roleplay/cuddle.js @@ -25,7 +25,13 @@ module.exports = class Cuddle extends Command { const Server = await ctx.db.servers.get(ctx.guild.id); let Line; - if (Server.rp_text) { + let Settings; + if (Server === null) { + Settings = ctx.utils.db.defaults.server; + } else { + Settings = Server; + } + if (Settings.rp_text) { const LineFromUtils = ctx.utils.int.cuddle[parseInt(Math.random() * ctx.utils.int.cuddle.length)]; Line = LineFromUtils.replace(/0/g, ctx.utils.format.bold(ctx.author.username)).replace( /1/g, @@ -34,13 +40,6 @@ module.exports = class Cuddle extends Command { } else { Line = undefined; } - - let Settings; - if (Server === null) { - Settings = ctx.utils.db.defaults.server; - } else { - Settings = Server; - } let req; let Message; await yiff.furrybot.sfw.cuddle().then((E) => (req = E)); diff --git a/DiscordModules/Roleplay/hold.js b/DiscordModules/Roleplay/hold.js index e38456a..045c6aa 100644 --- a/DiscordModules/Roleplay/hold.js +++ b/DiscordModules/Roleplay/hold.js @@ -25,7 +25,13 @@ module.exports = class Hold extends Command { const Server = await ctx.db.servers.get(ctx.guild.id); let Line; - if (Server.rp_text) { + let Settings; + if (Server === null) { + Settings = ctx.utils.db.defaults.server; + } else { + Settings = Server; + } + if (Settings.rp_text) { const LineFromUtils = ctx.utils.int.hold[parseInt(Math.random() * ctx.utils.int.hold.length)]; Line = LineFromUtils.replace(/0/g, ctx.utils.format.bold(ctx.author.username)).replace( /1/g, @@ -35,12 +41,6 @@ module.exports = class Hold extends Command { Line = undefined; } - let Settings; - if (Server === null) { - Settings = ctx.utils.db.defaults.server; - } else { - Settings = Server; - } let req; let Message; await yiff.furrybot.sfw.hold().then((E) => (req = E)); diff --git a/DiscordModules/Roleplay/hug.js b/DiscordModules/Roleplay/hug.js index 9eda4ef..bcf1047 100644 --- a/DiscordModules/Roleplay/hug.js +++ b/DiscordModules/Roleplay/hug.js @@ -25,7 +25,13 @@ module.exports = class Hug extends Command { const Server = await ctx.db.servers.get(ctx.guild.id); let Line; + let Settings; if (Server === null) { + Settings = ctx.utils.db.defaults.server; + } else { + Settings = Server; + } + if (Settings.rp_text) { const LineFromUtils = ctx.utils.int.hug[parseInt(Math.random() * ctx.utils.int.hug.length)]; Line = LineFromUtils.replace(/0/g, ctx.utils.format.bold(ctx.author.username)).replace( /1/g, @@ -35,12 +41,6 @@ module.exports = class Hug extends Command { Line = undefined; } - let Settings; - if (Server === null) { - Settings = ctx.utils.db.defaults.server; - } else { - Settings = Server; - } let req; let Message; await yiff.furrybot.sfw.hug().then((E) => (req = E)); diff --git a/DiscordModules/Roleplay/kiss.js b/DiscordModules/Roleplay/kiss.js index 4486aed..7a45ac1 100644 --- a/DiscordModules/Roleplay/kiss.js +++ b/DiscordModules/Roleplay/kiss.js @@ -25,7 +25,13 @@ module.exports = class Kiss extends Command { const Server = await ctx.db.servers.get(ctx.guild.id); let Line; - if (Server.rp_text) { + let Settings; + if (Server === null) { + Settings = ctx.utils.db.defaults.server; + } else { + Settings = Server; + } + if (Settings.rp_text) { const LineFromUtils = ctx.utils.int.kiss[parseInt(Math.random() * ctx.utils.int.kiss.length)]; Line = LineFromUtils.replace(/0/g, ctx.utils.format.bold(ctx.author.username)).replace( /1/g, @@ -35,12 +41,6 @@ module.exports = class Kiss extends Command { Line = undefined; } - let Settings; - if (Server === null) { - Settings = ctx.utils.db.defaults.server; - } else { - Settings = Server; - } let req; let Message; await yiff.furrybot.sfw.kiss().then((E) => (req = E)); diff --git a/DiscordModules/Roleplay/lick.js b/DiscordModules/Roleplay/lick.js index 39df718..06ae3f6 100644 --- a/DiscordModules/Roleplay/lick.js +++ b/DiscordModules/Roleplay/lick.js @@ -24,7 +24,13 @@ module.exports = class Lick extends Command { return ctx.send(`Don't you want to Lick someone other than yourself?`); const Server = await ctx.db.servers.get(ctx.guild.id); let Line; - if (Server.rp_text) { + let Settings; + if (Server === null) { + Settings = ctx.utils.db.defaults.server; + } else { + Settings = Server; + } + if (Settings.rp_text) { const LineFromUtils = ctx.utils.int.lick[parseInt(Math.random() * ctx.utils.int.lick.length)]; console.log(LineFromUtils); Line = LineFromUtils.replace(/0/g, ctx.utils.format.bold(ctx.author.username)).replace( @@ -35,12 +41,6 @@ module.exports = class Lick extends Command { Line = undefined; } - let Settings; - if (Server === null) { - Settings = ctx.utils.db.defaults.server; - } else { - Settings = Server; - } let req; let Message; await yiff.furrybot.sfw.lick().then((E) => (req = E)); diff --git a/DiscordModules/Roleplay/ncuddle.js b/DiscordModules/Roleplay/ncuddle.js index 0a9fcd5..8daa723 100644 --- a/DiscordModules/Roleplay/ncuddle.js +++ b/DiscordModules/Roleplay/ncuddle.js @@ -25,7 +25,13 @@ module.exports = class nCuddle extends Command { const Server = await ctx.db.servers.get(ctx.guild.id); let Line; - if (Server.rp_text) { + let Settings; + if (Server === null) { + Settings = ctx.utils.db.defaults.server; + } else { + Settings = Server; + } + if (Settings.rp_text) { const LineFromUtils = ctx.utils.int.cuddle[parseInt(Math.random() * ctx.utils.int.cuddle.length)]; Line = LineFromUtils.replace(/0/g, ctx.utils.format.bold(ctx.author.username)).replace( /1/g, @@ -35,12 +41,6 @@ module.exports = class nCuddle extends Command { Line = undefined; } - let Settings; - if (Server === null) { - Settings = ctx.utils.db.defaults.server; - } else { - Settings = Server; - } let req; let Message; await yiff.furrybot.nsfw.cuddle().then((E) => (req = E)); diff --git a/DiscordModules/Roleplay/nhold.js b/DiscordModules/Roleplay/nhold.js index ae90923..787f278 100644 --- a/DiscordModules/Roleplay/nhold.js +++ b/DiscordModules/Roleplay/nhold.js @@ -25,7 +25,13 @@ module.exports = class nHold extends Command { const Server = await ctx.db.servers.get(ctx.guild.id); let Line; - if (Server.rp_text) { + let Settings; + if (Server === null) { + Settings = ctx.utils.db.defaults.server; + } else { + Settings = Server; + } + if (Settings.rp_text) { const LineFromUtils = ctx.utils.int.hold[parseInt(Math.random() * ctx.utils.int.hold.length)]; Line = LineFromUtils.replace(/0/g, ctx.utils.format.bold(ctx.author.username)).replace( /1/g, @@ -35,12 +41,6 @@ module.exports = class nHold extends Command { Line = undefined; } - let Settings; - if (Server === null) { - Settings = ctx.utils.db.defaults.server; - } else { - Settings = Server; - } let req; let Message; await yiff.furrybot.nsfw.hold().then((E) => (req = E)); diff --git a/DiscordModules/Roleplay/nhug.js b/DiscordModules/Roleplay/nhug.js index 80f509a..104dd29 100644 --- a/DiscordModules/Roleplay/nhug.js +++ b/DiscordModules/Roleplay/nhug.js @@ -24,7 +24,13 @@ module.exports = class nHug extends Command { return ctx.send(`Don't you want to hug someone other than yourself?`); let Line; const Server = await ctx.db.servers.get(ctx.guild.id); - if (Server.rp_text) { + let Settings; + if (Server === null) { + Settings = ctx.utils.db.defaults.server; + } else { + Settings = Server; + } + if (Settings.rp_text) { const LineFromUtils = ctx.utils.int.hug[parseInt(Math.random() * ctx.utils.int.hug.length)]; Line = LineFromUtils.replace(/0/g, ctx.utils.format.bold(ctx.author.username)).replace( /1/g, @@ -34,12 +40,6 @@ module.exports = class nHug extends Command { Line = undefined; } - let Settings; - if (Server === null) { - Settings = ctx.utils.db.defaults.server; - } else { - Settings = Server; - } let req; let Message; await yiff.furrybot.nsfw.hug().then((E) => (req = E)); diff --git a/DiscordModules/Roleplay/nkiss.js b/DiscordModules/Roleplay/nkiss.js index a833112..d87e248 100644 --- a/DiscordModules/Roleplay/nkiss.js +++ b/DiscordModules/Roleplay/nkiss.js @@ -24,7 +24,13 @@ module.exports = class nKiss extends Command { return ctx.send(`Don't you want to kiss someone other than yourself?`); const Server = await ctx.db.servers.get(ctx.guild.id); let Line; - if (Server.rp_text) { + let Settings; + if (Server === null) { + Settings = ctx.utils.db.defaults.server; + } else { + Settings = Server; + } + if (Settings.rp_text) { const LineFromUtils = ctx.utils.int.kiss[parseInt(Math.random() * ctx.utils.int.kiss.length)]; Line = LineFromUtils.replace(/0/g, ctx.utils.format.bold(ctx.author.username)).replace( /1/g, @@ -34,12 +40,6 @@ module.exports = class nKiss extends Command { Line = undefined; } - let Settings; - if (Server === null) { - Settings = ctx.utils.db.defaults.server; - } else { - Settings = Server; - } let req; let Message; await yiff.furrybot.nsfw.kiss().then((E) => (req = E)); diff --git a/DiscordModules/Roleplay/nlick.js b/DiscordModules/Roleplay/nlick.js index 16195b8..a0d7687 100644 --- a/DiscordModules/Roleplay/nlick.js +++ b/DiscordModules/Roleplay/nlick.js @@ -24,7 +24,13 @@ module.exports = class nLick extends Command { return ctx.send(`Don't you want to Lick someone other than yourself?`); const Server = await ctx.db.servers.get(ctx.guild.id); let Line; - if (Server.rp_text) { + let Settings; + if (Server === null) { + Settings = ctx.utils.db.defaults.server; + } else { + Settings = Server; + } + if (Settings.rp_text) { const LineFromUtils = ctx.utils.int.lick[parseInt(Math.random() * ctx.utils.int.lick.length)]; Line = LineFromUtils.replace(/0/g, ctx.utils.format.bold(ctx.author.username)).replace( /1/g, @@ -34,12 +40,6 @@ module.exports = class nLick extends Command { Line = undefined; } - let Settings; - if (Server === null) { - Settings = ctx.utils.db.defaults.server; - } else { - Settings = Server; - } let req; let Message; await yiff.furrybot.nsfw.lick().then((E) => (req = E)); diff --git a/DiscordModules/Settings/prefix.js b/DiscordModules/Settings/prefix.js index a14b6b1..efb1b6a 100644 --- a/DiscordModules/Settings/prefix.js +++ b/DiscordModules/Settings/prefix.js @@ -14,8 +14,6 @@ module.exports = class Prefix extends Command { } async command(ctx) { - let PrefixEmbed = new ctx.utils.discord.MessageEmbed(); - PrefixEmbed.setColor(ctx.config.color); let ARG = ctx.args[0]; ctx.args.shift(); let Prefix = ctx.args.join(' '); @@ -31,10 +29,12 @@ module.exports = class Prefix extends Command { ctx.utils.db.prefix .add(ctx, Prefix) .then(async () => { + let aPrefixEmbed = new ctx.utils.discord.MessageEmbed(); + aPrefixEmbed.setColor(ctx.config.color); let NServer = await ctx.db.servers.get(ctx.guild.id); - PrefixEmbed.setTitle(`Prefixes for ${ctx.guild.name}`); - PrefixEmbed.setDescription(`${NServer.prefix.join(' | ') || ctx.db.defaults.server.prefix}`); - ctx.send(PrefixEmbed); + aPrefixEmbed.setTitle(`Prefixes for ${ctx.guild.name}`); + aPrefixEmbed.setDescription(`${NServer.prefix.join(' | ') || ctx.config.prefixes}`); + ctx.send(aPrefixEmbed); }) .catch((err) => ctx.send(err)); break; @@ -45,11 +45,19 @@ module.exports = class Prefix extends Command { .remove(ctx, Prefix) .then(async () => { let NServer = await ctx.db.servers.get(ctx.guild.id); - PrefixEmbed.setTitle(`Prefixes for ${ctx.guild.name}`); - PrefixEmbed.setDescription(`${NServer.prefix.join(' | ') || ctx.db.defaults.server.prefix}`); - ctx.send(PrefixEmbed); + let rPrefixEmbed = new ctx.utils.discord.MessageEmbed(); + rPrefixEmbed.setColor(ctx.config.color); + rPrefixEmbed.setTitle(`Prefixes for ${ctx.guild.name}`); + if (NServer.prefix === []) { + rPrefixEmbed.setDescription(ctx.config.prefixes.join(' **|**')); + } else { + rPrefixEmbed.setDescription( + `${NServer.prefix.join(' | ') || ctx.config.prefixes.join(' **|** ')}` + ); + } + ctx.send(rPrefixEmbed); }) - .catch((err) => ctx.send(err)); + .catch((err) => console.log(err)); break; default: PrefixEmbed.setTitle('Help');