Skip to content
This repository has been archived by the owner on Dec 19, 2018. It is now read-only.

Commit

Permalink
Add exception notifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Ray committed Sep 12, 2018
1 parent 522d230 commit 8ef777c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
19 changes: 4 additions & 15 deletions commands/game.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,8 @@ if (botuser.user.bot === true) {
bot = "No";
}

if(!botuser.user.presence.game.assets.assets) {
const embed = new Discord.RichEmbed()
.setAuthor(botuser.displayName, `undefined`)
.setColor(botuser.displayColor)
.addField("Status", `${status[botuser.user.presence.status]}`, true)
.addField("Playing", `${botuser.user.presence.game ? `${botuser.user.presence.game.name}` : "not playing anything."}`, true)
.addField("Details", `${botuser.user.presence.game.details}`, true)
.addField("State", `${botuser.user.presence.game.state}`, true)
.addField("ID", botuser.id, false)
.addField("Bot", `${bot}`, false)
.addField("Guild", `${bot}`, false)
.setFooter("ShadowShard | Alpha Development")
msg.edit(embed)
}

const embed = new Discord.RichEmbed()
try { const embed = new Discord.RichEmbed()
.setAuthor(botuser.displayName, botuser.user.presence.game.assets.smallImageURL)
.setThumbnail(botuser.user.presence.game.assets.largeImageURL)
.setColor(botuser.displayColor)
Expand All @@ -49,6 +35,9 @@ if(!botuser.user.presence.game.assets.assets) {
.addField("Guild", `${bot}`, false)
.setFooter("ShadowShard | Alpha Development")
msg.edit(embed)
} catch (err) {
msg.edit('Exception: ' + err)
}
}


Expand Down
5 changes: 4 additions & 1 deletion commands/whois.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ exports.run = async (client, message, args, level) => {
} catch(e) {
level = 0;
}
const msg = await message.channel.send("Loading...");
try { const msg = await message.channel.send("Loading...");
const friendly = client.config.permLevels.find(l => l.level === level).name;
let botuser = message.mentions.users.first() ? message.guild.members.get(message.mentions.users.first().id) : message.member
let matt = message.mentions.users.first() ? message.guild.members.get(message.mentions.users.first().id).roles.sort((a, b) => b.position - a.position).map(i => i.id).slice(0, -1) : message.member.roles.sort((a, b) => b.position - a.position).map(i => i.id).slice(0, -1)
Expand Down Expand Up @@ -44,6 +44,9 @@ myDick;
.addField("System Level", `${level}`, true)
.setFooter("ShadowShard | Alpha Development")
msg.edit(embed)
} catch (err) {
msg.edit('Exception: ' + err)
}
};
exports.conf = {
enabled: true,
Expand Down

0 comments on commit 8ef777c

Please sign in to comment.