From c12b73659051012ed129cca164c057f6eed5ab9f Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Fri, 8 Sep 2017 01:28:33 +0000 Subject: [PATCH] Use direct unicode --- XiaoBot.js | 8 +++----- assets/json/tag.json | 10 +++++----- commands/games/fishy.js | 2 +- commands/games/slots.js | 2 +- commands/random-res/8-ball.js | 2 +- commands/random-res/magic-conch.js | 2 +- commands/text-edit/b.js | 8 ++++---- commands/util/help.js | 2 +- commands/util/info.js | 2 +- commands/util/ping.js | 2 +- commands/util/shard-info.js | 2 +- commands/util/uptime.js | 2 +- package.json | 2 +- structures/Util.js | 8 +++----- 14 files changed, 25 insertions(+), 29 deletions(-) diff --git a/XiaoBot.js b/XiaoBot.js index c36037f1..b605236e 100644 --- a/XiaoBot.js +++ b/XiaoBot.js @@ -12,7 +12,7 @@ const client = new Client({ messageSweepInterval: 120 }); const SequelizeProvider = require('./providers/Sequelize'); -const { dBots, dBotsOrg, filterTopics, parseTopic } = require('./structures/Util'); +const { postStats, filterTopics, parseTopic } = require('./structures/Util'); client.registry .registerDefaultTypes() @@ -83,16 +83,14 @@ client.on('guildCreate', async guild => { console.log(`[GUILD] I have joined ${guild.name}! (${guild.id})`); const guilds = await client.shard.fetchClientValues('guilds.size'); const count = guilds.reduce((prev, val) => prev + val, 0); - dBots(count, client.user.id); - dBotsOrg(count, client.user.id); + postStats(count, client.user.id); }); client.on('guildDelete', async guild => { console.log(`[GUILD] I have left ${guild.name}... (${guild.id})`); const guilds = await client.shard.fetchClientValues('guilds.size'); const count = guilds.reduce((prev, val) => prev + val, 0); - dBots(count, client.user.id); - dBotsOrg(count, client.user.id); + postStats(count, client.user.id); }); client.login(TOKEN); diff --git a/assets/json/tag.json b/assets/json/tag.json index f3d3b3e7..3a8c5f26 100644 --- a/assets/json/tag.json +++ b/assets/json/tag.json @@ -2,17 +2,17 @@ "if900hp": "All cars unlocked!", "i'm an easter egg": "You're also an example.", "not a valid tag": "No, it's not valid at all.", - "easter egg": "This command is *tag*, not *easter egg* :yum:", + "easter egg": "This command is _tag_, not _easter egg_ 😋", "tag": "Invalid tag!", - "snek": "*Blame :snake:*", + "snek": "_Blame 🐍_", "snekfetch": "The best.", "xiaobot": "That's my name.", - "dragonfire535": "http://dragonfire535.tk", + "dragonfire535": "http://dragonfire.space", "heroes of dreamland": "https://www.wattpad.com/story/8712240", "neopets": "I got robbed by the pant devil.", "koneko-chan": "https://i.ytimg.com/vi/YStwTmG4Ex0/hqdefault.jpg", "shrug": "¯\\_(ツ)_/¯", - "vulcan": ":vulcan:", + "vulcan": "🖖", "soundboard": "Rest in Peace...", "me": "You.", "no u": "no u", @@ -32,7 +32,7 @@ "token": "[REDACTED]", "nom": "https://cdn.discordapp.com/attachments/256055608279695360/308434352377954304/tumblr_ojzfs3jjoJ1qz64n4o1_540.gif", "good vs evil": "https://cdn.discordapp.com/attachments/256055608279695360/308404323392684033/837631b64ef351ddabe8c2200c2feca54d81af62_hq.jpg", - "ebearskittychan": "The best :heart:", + "ebearskittychan": "The best ❤", "i am your father": "NOOOOOOOOOOOOOO!", "waifu": "I'm your waifu, right?", "no": "yes", diff --git a/commands/games/fishy.js b/commands/games/fishy.js index e662e126..7c7fbe63 100644 --- a/commands/games/fishy.js +++ b/commands/games/fishy.js @@ -1,5 +1,5 @@ const Command = require('../../structures/Command'); -const fishes = [':fish:', ':tropical_fish:', ':blowfish:', ':wrench:']; +const fishes = ['🐟', '🐠', '🐡', '🔧']; module.exports = class FishyCommand extends Command { constructor(client) { diff --git a/commands/games/slots.js b/commands/games/slots.js index 35c96726..43671839 100644 --- a/commands/games/slots.js +++ b/commands/games/slots.js @@ -1,6 +1,6 @@ const Command = require('../../structures/Command'); const { stripIndents } = require('common-tags'); -const slots = [':grapes:', ':tangerine:', ':pear:', ':cherries:', ':lemon:']; +const slots = ['🍇', '🍊', '🍐', '🍒', '🍋']; module.exports = class SlotsCommand extends Command { constructor(client) { diff --git a/commands/random-res/8-ball.js b/commands/random-res/8-ball.js index e3640900..751acbf0 100644 --- a/commands/random-res/8-ball.js +++ b/commands/random-res/8-ball.js @@ -23,7 +23,7 @@ module.exports = class MagicBallCommand extends Command { const { question } = args; return msg.say(stripIndents` Question: ${question} - :8ball: ${answers[Math.floor(Math.random() * answers.length)]} :8ball: + 🎱 ${answers[Math.floor(Math.random() * answers.length)]} 🎱 `); } }; diff --git a/commands/random-res/magic-conch.js b/commands/random-res/magic-conch.js index 39389a63..4b2df1ac 100644 --- a/commands/random-res/magic-conch.js +++ b/commands/random-res/magic-conch.js @@ -23,7 +23,7 @@ module.exports = class MagicConchCommand extends Command { const { question } = args; return msg.say(stripIndents` Question: ${question} - :shell: ${answers[Math.floor(Math.random() * answers.length)]} :shell: + 🐚 ${answers[Math.floor(Math.random() * answers.length)]} 🐚 `); } }; diff --git a/commands/text-edit/b.js b/commands/text-edit/b.js index 7a5ee8fe..2d81582b 100644 --- a/commands/text-edit/b.js +++ b/commands/text-edit/b.js @@ -7,14 +7,14 @@ module.exports = class BCommand extends Command { aliases: ['🅱'], group: 'text-edit', memberName: 'b', - description: ':b:.', + description: '🅱.', args: [ { key: 'text', - prompt: 'What text would you like to :b:?', + prompt: 'What text would you like to 🅱?', type: 'string', validate: text => { - if (text.replace(/(b|d|g|p|q)/gi, ':b:').length < 2000) return true; + if (text.replace(/(b|d|g|p|q)/gi, '🅱').length < 2000) return true; return 'Your text is too long.'; } } @@ -24,6 +24,6 @@ module.exports = class BCommand extends Command { run(msg, args) { const { text } = args; - return msg.say(text.replace(/(b|d|g|p|q)/gi, ':b:')); + return msg.say(text.replace(/(b|d|g|p|q)/gi, '🅱')); } }; diff --git a/commands/util/help.js b/commands/util/help.js index 61b306c1..f057bb4c 100644 --- a/commands/util/help.js +++ b/commands/util/help.js @@ -57,7 +57,7 @@ module.exports = class HelpCommand extends Command { } try { await msg.direct({ embed }); - return msg.say(':mailbox_with_mail: Sent you a DM with information.'); + return msg.say('📬 Sent you a DM with information.'); } catch (err) { return msg.say('Failed to send DM. You probably have DMs disabled.'); } diff --git a/commands/util/info.js b/commands/util/info.js index 4dcbe15f..478cb70b 100644 --- a/commands/util/info.js +++ b/commands/util/info.js @@ -33,7 +33,7 @@ module.exports = class InfoCommand extends Command { .addField('❯ Memory Usage', `${Math.round(memory.reduce((prev, val) => prev + val, 0) / 1024 / 1024)}MB`, true) .addField('❯ Uptime', - duration(this.client.uptime).format, true) + duration(this.client.uptime).format(), true) .addField('❯ Version', `v${version}`, true) .addField('❯ Node Version', diff --git a/commands/util/ping.js b/commands/util/ping.js index 67af20e0..19ecc0cf 100644 --- a/commands/util/ping.js +++ b/commands/util/ping.js @@ -16,7 +16,7 @@ module.exports = class PingCommand extends Command { async run(msg) { const message = await msg.say('Pinging...'); return message.edit(stripIndents` - :ping_pong: Pong! \`${Math.round(message.createdTimestamp - msg.createdTimestamp)}ms\` + 🏓 Pong! \`${Math.round(message.createdTimestamp - msg.createdTimestamp)}ms\` Heartbeat: \`${Math.round(this.client.ping)}ms\` `); } diff --git a/commands/util/shard-info.js b/commands/util/shard-info.js index 65d8f65b..2ffd76ed 100644 --- a/commands/util/shard-info.js +++ b/commands/util/shard-info.js @@ -39,7 +39,7 @@ module.exports = class ShardInfoCommand extends Command { .addField('❯ Memory Usage', `${Math.round(memory[shard] / 1024 / 1024)}MB`, true) .addField('❯ Uptime', - duration(uptime[shard]).format, true); + duration(uptime[shard]).format(), true); return msg.embed(embed); } }; diff --git a/commands/util/uptime.js b/commands/util/uptime.js index b524eaa6..dd998e20 100644 --- a/commands/util/uptime.js +++ b/commands/util/uptime.js @@ -13,6 +13,6 @@ module.exports = class UptimeCommand extends Command { } run(msg) { - return msg.say(duration(this.client.uptime).format); + return msg.say(duration(this.client.uptime).format()); } }; diff --git a/package.json b/package.json index cf245077..2f21c36c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiaobot", - "version": "37.5.0", + "version": "37.5.1", "description": "Your personal server companion.", "main": "Shard.js", "scripts": { diff --git a/structures/Util.js b/structures/Util.js index d85e52ba..cb721ae5 100644 --- a/structures/Util.js +++ b/structures/Util.js @@ -14,16 +14,13 @@ class Util { .replace(/(\[i\]|\[\/i\])/g, '*'); } - static dBots(count, id) { + static postStats(count, id) { snekfetch .post(`https://bots.discord.pw/api/bots/${id}/stats`) .set({ Authorization: DBOTS_KEY }) .send({ server_count: count }) .then(() => console.log('[DBOTS] Successfully posted to Discord Bots.')) .catch(err => console.error(`[DBOTS] Failed to post to Discord Bots. ${err}`)); - } - - static dBotsOrg(count, id) { snekfetch .post(`https://discordbots.org/api/bots/${id}/stats`) .set({ Authorization: DBOTSORG_KEY }) @@ -39,6 +36,7 @@ class Util { return c.topic.includes(`<${setting}>`); } catch (err) { console.error(stripIndents` + ${err.name}: ${err.message} Guild memberCount: ${c.guild.memberCount} GuildMemberStore size: ${c.guild.members.size} permissionsFor ClientUser: ${c.permissionsFor(c.client.user)} @@ -97,7 +95,7 @@ class Util { hours: hrs, minutes: min, seconds: sec, - format: `${hrs < 10 ? `0${hrs}` : hrs}:${min < 10 ? `0${min}` : min}:${sec < 10 ? `0${sec}` : sec}` + format: () => `${hrs < 10 ? `0${hrs}` : hrs}:${min < 10 ? `0${min}` : min}:${sec < 10 ? `0${sec}` : sec}` }; } }