Bug fixes

This commit is contained in:
Daniel Odendahl Jr
2018-04-04 19:14:20 +00:00
parent 95a37134ed
commit 8cbbcecb70
4 changed files with 8 additions and 5 deletions
+3 -2
View File
@@ -16,7 +16,8 @@ module.exports = class ServerInfoCommand extends Command {
});
}
run(msg) {
async run(msg) {
if (!msg.guild.members.has(msg.guild.ownerID)) await msg.guild.members.fetch(msg.guild.ownerID);
const embed = new MessageEmbed()
.setColor(0x00AE86)
.setThumbnail(msg.guild.iconURL())
@@ -33,7 +34,7 @@ module.exports = class ServerInfoCommand extends Command {
.addField(' Verification Level',
verificationLevels[msg.guild.verificationLevel], true)
.addField(' Owner',
msg.guild.owner ? msg.guild.owner.user.tag : 'None', true)
msg.guild.owner.user.tag, true)
.addField(' Members',
msg.guild.memberCount, true)
.addField(' Roles',
+3 -1
View File
@@ -33,6 +33,8 @@ module.exports = class Base64Command extends Command {
}
run(msg, { mode, text }) {
return msg.say(base64(text, mode));
const converted = base64(text, mode);
if (!converted) return msg.reply('That is not valid Base64.');
return msg.say(converted);
}
};
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "71.0.1",
"version": "71.0.2",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {
+1 -1
View File
@@ -56,7 +56,7 @@ class Util {
static base64(text, mode = 'encode') {
if (mode === 'encode') return Buffer.from(text).toString('base64');
if (mode === 'decode') return Buffer.from(text, 'base64').toString('utf8');
if (mode === 'decode') return Buffer.from(text, 'base64').toString('utf8') || null;
throw new TypeError(`${mode} is not a supported base64 mode.`);
}