commit 585104fd6b74592f8752a70da362e120507154f3 parent 5f7fdc66fadd304f42ddeda33db00a71a57c0f0b Author: Demonstrandum <moi@knutsen.co> Date: Thu, 19 Mar 2020 17:07:10 +0000 Fix ID Diffstat:
M | lib/commands/id.ts | | | 6 | ++++-- |
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/commands/id.ts b/lib/commands/id.ts @@ -1,8 +1,10 @@ +import { Message } from 'discord.js'; + export default home_scope => { - const { message } = home_scope; + const { message } : { message : Message } = home_scope; const rep = []; ['channel', 'user', 'role'].forEach(n => - message.mentions[n + 's'].each(o => rep.push(n + ' id: `' + o.id + '`'))); + message.mentions[`${n}s`].forEach(o => rep.push(`${n} id: \`${o.id}\``))); // Joining an empty array yields an empty string which is false const reply = rep.join(', ') || `User ID: \`${message.author.id}\` Author: ${message.author}