fixing stupid bugs

This commit is contained in:
codepupper 2019-11-13 22:12:14 +01:00
parent 7022efebb8
commit 54fff51e97
17 changed files with 124 additions and 121 deletions

View file

@ -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);
@ -91,6 +94,8 @@ module.exports = {
`Full Error:
${err}
Content: ${ctx.msg.content}
Author: ${msg.author.tag} (${msg.author.id})
Server: ${msg.guild.name} (${msg.guild.id})`,
config.trello.boards.errors

View file

@ -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,7 +49,9 @@ function randomStatus(client) {
module.exports = {
name: 'ready',
run: async (client) => {
if (client.user.id === '434662676547764244') {
blapi.handle(client, config.apis);
}
log.hasStarted();
randomStatus(client);
setInterval(() => {

View file

@ -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.`);

View file

@ -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));

View file

@ -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));

View file

@ -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));

View file

@ -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));

View file

@ -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));

View file

@ -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));

View file

@ -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));

View file

@ -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));

View file

@ -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));

View file

@ -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));

View file

@ -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));

View file

@ -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));

View file

@ -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));

View file

@ -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');