Skip to content

Commit

Permalink
Merge pull request schmooky#19 from dvasiliev97/feat/ping-embed
Browse files Browse the repository at this point in the history
feat(embed): add embed for ping command
  • Loading branch information
schmooky authored Sep 4, 2019
2 parents 4fc5879 + c970e9b commit 96c9cb9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 1 addition & 5 deletions src/core/Bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,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.ping));
})
.on('help', help)
.on('join', join)
Expand Down
8 changes: 8 additions & 0 deletions src/core/BotEmbed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,14 @@ const embedMultipleTracksAdded = (tracks: MediaItem[]): RichEmbed => {
return embed;
};

const embedPing = (ping: number): RichEmbed => {
const embed = new RichEmbed()
.setColor('#ffdb4d')
.setDescription(`⌛ ${Math.ceil(ping)}`);

return embed;
};

export {
embedTrackAdded,
embedNowPlaying,
Expand Down

0 comments on commit 96c9cb9

Please sign in to comment.