Portal Emoji

This commit is contained in:
Dragon Fire
2020-03-01 15:59:35 -05:00
parent c40eede245
commit 874d9e747a
3 changed files with 13 additions and 2 deletions
+2
View File
@@ -18,6 +18,8 @@ MOCKING_EMOJI_ID=
MOCKING_EMOJI_NAME=
SILVER_FISH_EMOJI_ID=
SILVER_FISH_EMOJI_NAME=
PORTAL_EMOJI_ID=
PORTAL_EMOJI_NAME=
# API Keys, IDs, and Secrets
ALPHA_VANTAGE_KEY=
+10 -1
View File
@@ -1,4 +1,6 @@
const Command = require('../../structures/Command');
const { oneLine } = require('common-tags');
const { PORTAL_EMOJI_ID, PORTAL_EMOJI_NAME } = process.env;
module.exports = class PortalSendCommand extends Command {
constructor(client) {
@@ -30,10 +32,17 @@ module.exports = class PortalSendCommand extends Command {
if (!channels.size) return msg.reply('No channels have an open portal...');
const channel = channels.random();
try {
await channel.send(`**${msg.author.tag} (${msg.channel.type === 'text' ? msg.guild.name : 'DM'}):** ${message}`);
await channel.send(oneLine`
**${this.portalEmoji} ${msg.author.tag} (${msg.channel.type === 'text' ? msg.guild.name : 'DM'}):**
${message}
`);
return msg.say(`Message sent to **${channel.name}** in **${channel.guild.name}**!`);
} catch (err) {
return msg.reply('Failed to send the message. Try again later!');
}
}
get portalEmoji() {
return PORTAL_EMOJI_ID && PORTAL_EMOJI_NAME ? `<:${PORTAL_EMOJI_NAME}:${PORTAL_EMOJI_ID}>` : 'PORTAL';
}
};
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "111.1.0",
"version": "111.1.1",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {