Skip to content

Commit

Permalink
Closes #48 - The summon circle is fancy and does math to center a use…
Browse files Browse the repository at this point in the history
…rname now
  • Loading branch information
jake@chrx committed Mar 18, 2018
1 parent 0622ebb commit f62229a
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions discordlib/chatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,29 @@ exports.sass = function(input) {

exports.summon = function(input, message) {
//TODO Consider a ring of :fire: and actually tagging summoned user
if (message.mentions.users && message.mentions.users.size > 0) {
let targetToSummon = message.mentions.users.first()
let response = `your wish is my command.
COME FORTH ${targetToSummon}! \`\`\`
if (message.mentions.users) {
if (message.mentions.users.size == 1) {
let summoned = message.mentions.members.first()
// The summon circle is 32 chars wide, 16 is the mid point
let padding = ' '.repeat(18 - (summoned.displayName.length / 2))
return `your wish is my command...
COME FORTH ${summoned}! \`\`\`
%%% %%%
%%% %%%
%%% %%%
%%% %%%
${targetToSummon.nickname}
${padding + summoned.displayName}
%%% %%%
%%% %%%
%%% %%%
%%% %%%\`\`\``
return response
}
}
return "you can't just summon nothing, that's not how this works!"
}

0 comments on commit f62229a

Please # to comment.