diff --git a/src/core/Bot.ts b/src/core/Bot.ts index af53dd5..18ffa07 100644 --- a/src/core/Bot.ts +++ b/src/core/Bot.ts @@ -9,6 +9,7 @@ import BotMediaPlayer from './BotMediaPlayer'; import BotConsoleReader from './BotConsoleReader'; import BotCommandMap from './BotCommandMap'; import { ParsedMessage, parse } from './BotCommandParser'; +import { embedPing } from './BotEmbed'; import logger from '../utils/logger'; @@ -59,11 +60,7 @@ class YBot implements Bot { this.commands = new BotCommandMap() .on('ping', (cmd: ParsedMessage, msg: Message): void => { - let phrases = ['Can\'t stop won\'t stop!', ':ping_pong: Pong Bitch!']; - - if (msg.guild) phrases = phrases.concat(msg.guild.emojis.array().map((x): string => x.name)); - - msg.channel.send(`${this.client.ping}ms, :${random(phrases)}:`); + msg.channel.send(embedPing(this.client)); }) .on('help', help) .on('join', join) diff --git a/src/core/BotEmbed.ts b/src/core/BotEmbed.ts index 868cbd4..d1318dc 100644 --- a/src/core/BotEmbed.ts +++ b/src/core/BotEmbed.ts @@ -1,4 +1,4 @@ -import { RichEmbed } from 'discord.js'; +import { RichEmbed, Client } from 'discord.js'; import { MediaItem } from './BotMedia'; import BotMediaQueue from './BotMediaQueue'; @@ -100,10 +100,20 @@ const embedMultipleTracksAdded = (tracks: MediaItem[]): RichEmbed => { return embed; }; +const embedPing = (client: Client): RichEmbed => { + const embed = new RichEmbed() + .setColor('#ffdb4d') + .setDescription(`⌛ ${Math.ceil(client.ping)}`) + .setFooter(copyright, logoYandexMusicURL); + + return embed; +}; + export { embedTrackAdded, embedNowPlaying, embedList, embedHelp, embedMultipleTracksAdded, + embedPing, };