Skip to content

Commit

Permalink
Merge pull request #20 from MicahJank/micah-jank
Browse files Browse the repository at this point in the history
Beautify the bot's messages #16 - fix
  • Loading branch information
tomassirio authored Oct 22, 2020
2 parents dd8b27c + bbf82af commit a6e3417
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/commands/whatsMyBirthday.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,17 @@ module.exports = {

let member = dbServer.members.find(m => m.user === message.author.tag)
let embededMessage;

if(member){
// Dates will all come back with the same character count so slicing up to the end of the year seems simplest
const formattedDate = member.birthday.toString().slice(0,15);
const randomColor = Math.floor(Math.random()*16777215).toString(16);

embededMessage = Util.embedMessage(
'Your Birthday',
message.author.tag,
'0xffff00',
`Your Birthday is set to ${member.birthday}.`
`0x${randomColor}`,
`Your Birthday is set to ${formattedDate}.`
)
}else{
embededMessage = Util.embedMessage(
Expand Down

0 comments on commit a6e3417

Please sign in to comment.