From f102729237d5c20ceeebaae8dbccafaa6ca55e21 Mon Sep 17 00:00:00 2001 From: Ben Landin Date: Sun, 19 Apr 2020 09:43:55 -0400 Subject: Fixed tellraw components not being encoded properly --- src/Discord.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/Discord.ts') diff --git a/src/Discord.ts b/src/Discord.ts index bc15fac..8415ad0 100644 --- a/src/Discord.ts +++ b/src/Discord.ts @@ -91,11 +91,15 @@ class Discord { } private makeMinecraftTellraw(message: Message): string { - const username = emojiStrip(message.author.username) - const discriminator = message.author.discriminator - const text = emojiStrip(message.cleanContent) + const variables: {[index: string]: string} = { + username: emojiStrip(message.author.username), + discriminator: message.author.discriminator, + text: emojiStrip(message.cleanContent) + } // hastily use JSON to encode the strings - const variables = JSON.parse(JSON.stringify({ username, discriminator, text })) + for (const v of Object.keys(variables)) { + variables[v] = JSON.stringify(variables[v]).slice(1,-1) + } return this.config.MINECRAFT_TELLRAW_TEMPLATE .replace('%username%', variables.username) -- cgit 1.4.1 ?id=86891cd638ad3481e58d79952e1b3131d14ac44a&follow=1'>commit diff
path: root/doc/zlib/deflateReset.3 (unfollow)
Commit message (Expand)Author
2021-01-01Increment license header templatesJune McEnroe
2020-12-31Tell "Music" rather than "iTunes"June McEnroe
2020-12-31Add ASCII control code names to bitJune McEnroe
2020-12-31Simplify bit lexing and parsingJune McEnroe
2020-12-31Add ddateJune McEnroe
2020-12-30Print octal for 8 bits in bitJune McEnroe
2020-12-30Add unary & to bitJune McEnroe
2020-12-30Support unary + in orderJune McEnroe
2020-12-30Add postfix $ operator to bitJune McEnroe
2020-12-29Add make lexerJune McEnroe
2020-12-29Clean up C lexerJune McEnroe
2020-12-29Clean up hilex code somewhatJune McEnroe
2020-12-29Match lex/yacc %% %{ %} lines as MacroJune McEnroe
2020-12-29Match top-level C definitions as IdentifierTagJune McEnroe
2020-12-29Match C type declarations as IdentifierTagJune McEnroe
2020-12-29Match function-like macro definitions as IdentifierTagJune McEnroe
2020-12-29Reconfigure C macro start conditionsJune McEnroe
2020-12-29Document HTML class namesJune McEnroe
2020-12-29Rename Tag class to IdentifierTagJune McEnroe
2020-12-29Change HTML class from hi to hilexJune McEnroe
2020-12-29Add hilex HTML outputJune McEnroe