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

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