diff options
| author | Unknown <jtsshieh@outlook.com> | 2018-02-24 13:25:22 -0500 |
|---|---|---|
| committer | Unknown <jtsshieh@outlook.com> | 2018-02-24 13:25:22 -0500 |
| commit | 86f123a91dd335ba371f219040bc12791c45282d (patch) | |
| tree | a1fbed5146b83702f367ec3aeec7822faab0cbb9 | |
| parent | f0eceb99aea5595c338fc130f14d0eff67c7c9f2 (diff) | |
| download | PokeBot-86f123a91dd335ba371f219040bc12791c45282d.tar.gz PokeBot-86f123a91dd335ba371f219040bc12791c45282d.tar.bz2 PokeBot-86f123a91dd335ba371f219040bc12791c45282d.zip | |
bugfixes
| -rw-r--r-- | bot.js | 1 | ||||
| -rw-r--r-- | commands/ban.js | 4 | ||||
| -rw-r--r-- | commands/join.js | 6 | ||||
| -rw-r--r-- | commands/softban.js | 6 |
4 files changed, 9 insertions, 8 deletions
@@ -132,6 +132,7 @@ bot.on('messageUpdate', (oldMsg, newMsg) => { }); bot.on('messageDelete', (msg) => { + if(!msg.content) return; try { const embed = new Discord.RichEmbed() .setColor(0x00ae86) diff --git a/commands/ban.js b/commands/ban.js index 33c9277..74d8447 100644 --- a/commands/ban.js +++ b/commands/ban.js @@ -16,8 +16,8 @@ exports.run = async (bot, msg, args) => { .setColor(0x00ae86) .setAuthor(member.user.tag, member.user.avatarURL) .setTitle(`:hammer: **${member.user.tag}**`) - .setDescription(`*${member.user.tag}}* was banned from the server by *${msg.author.tag}*.`) - .addField('Reason', reason) + .setDescription(`*${member.user.tag}* was banned from the server by *${msg.author.tag}*.`) + .addField('Reason', reason ? reason : '*none*') .addField('Moderator', msg.author.tag) .setTimestamp() .setFooter(`${msg.author.tag} banned ${member.user.tag}`, msg.author.avatarURL); diff --git a/commands/join.js b/commands/join.js index b7fd916..dc3ba84 100644 --- a/commands/join.js +++ b/commands/join.js @@ -6,17 +6,17 @@ exports.run = async (bot, msg, args) => { { case 'mystic': { msg.member.addRole(msg.guild.roles.find('name', 'Mystic')); - msg.reply(`Alright, ${team ? 'you have left team ' + team + ' and ' : 'you are have '}joined team Mystic.`); + msg.reply(`Alright, ${team ? 'you have left team ' + team + ' and ' : 'you have '}joined team Mystic.`); break; } case 'valor' : { msg.member.addRole(msg.guild.roles.find('name', 'Valor')); - msg.reply(`Alright, ${team ? 'you have left team ' + team + ' and ' : 'you are have '}joined team Valor.`); + msg.reply(`Alright, ${team ? 'you have left team ' + team + ' and ' : 'you have '}joined team Valor.`); break; } case 'instinct' : { msg.member.addRole(msg.guild.roles.find('name', 'Instinct')); - msg.reply(`Alright, ${team ? 'you have left team ' + team + ' and ' : 'you are have '}joined team Instinct.`); + msg.reply(`Alright, ${team ? 'you have left team ' + team + ' and ' : 'you have '}joined team Instinct.`); break; } default : { diff --git a/commands/softban.js b/commands/softban.js index ff5d4b5..8c4fee0 100644 --- a/commands/softban.js +++ b/commands/softban.js @@ -6,7 +6,7 @@ exports.run = async (bot, msg, args) => { if (!member) return await msg.reply('Who am I gonna softban?'); const reason = args.join(' ').slice(3 + member.user.id.length); - await member.ban({ days: 7, reason: msg.author.tag + ': ' + (reason ? ': ' + reason : '') }) + await member.ban({ days: 7, reason: msg.author.tag + ': ' + (reason ? reason : '') }) .catch(err => { msg.reply('There was an error.'); console.error(err.stack);}); await msg.guild.unban(member.user.id).catch(msg.reply('There was an error.')); msg.channel.send(`Alright, I softbanned **${member.user.tag}**${(reason ? ` for the reason **${reason}**.` : '.')}`); @@ -16,8 +16,8 @@ exports.run = async (bot, msg, args) => { .setColor(0x00ae86) .setAuthor(member.user.tag, member.user.avatarURL) .setTitle(`:hammer: **${member.user.tag}**`) - .setDescription(`*${member.user.tag}}* was softbanned from the server by *${msg.author.tag}*.`) - .addField('Reason', reason) + .setDescription(`*${member.user.tag}* was softbanned from the server by *${msg.author.tag}*.`) + .addField('Reason', reason ? reason : '*none*') .addField('Moderator', msg.author.tag) .setTimestamp() .setFooter(`${msg.author.tag} softbanned ${member.user.tag}`, msg.author.avatarURL); |
