Simp-O-Matic

Dumb Discord bot in TS.
git clone git://git.knutsen.co/Simp-O-Matic
Log | Files | Refs | README | LICENSE

commit fc51012ad8d5df2f2b9c723a570ab47ba219959e
parent 6306c7e926325df6f0b3087294d898bb5e7dfb4b
Author: Demonstrandum <moi@knutsen.co>
Date:   Fri, 22 May 2020 15:34:50 +0100

Use displayName, not nickname (may not exist).

Diffstat:
Mconsole.rb | 4++--
Mlib/action.ts | 2+-
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/console.rb b/console.rb @@ -11,14 +11,14 @@ def send_message message } body[:guild] = $guild unless $guild == 'GLOBAL' payload = JSON.dump body - puts "Sending payload: #{payload}" + puts " [*] Sending payload:\n #{payload}" command = ['curl', '-d', payload, URL] system *command end loop do - print "#{$guild}> " + print "[#{$guild}]> " input = gets.strip if input.start_with? '/' command, *args = input[1..].split ' ' diff --git a/lib/action.ts b/lib/action.ts @@ -159,7 +159,7 @@ export default class Action { static get(action: ActionType, message: Message): MessageEmbed { const [author, to] = [message.author, message.mentions.users.first()] .map(m => message.guild.member(m)) - .map(u => u.nickname); + .map(u => u.displayName); const reaction: Actions = ACTIONS[action]; const images = reaction.images; const image = images[(Number(message.cleanContent.split(' ')[1]) || (Math.floor(Math.random() * images.length) + 1)) - 1];