From d868a93be987bc5e78724df621aef7b44e332e8d Mon Sep 17 00:00:00 2001 From: Will Hunt <will@half-shot.uk> Date: Sat, 28 Apr 2018 17:53:01 +0100 Subject: [PATCH] this.bot > this.opts.bot --- src/matrixeventprocessor.ts | 1 + src/messageprocessor.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/matrixeventprocessor.ts b/src/matrixeventprocessor.ts index f63b76b..3a4abb9 100644 --- a/src/matrixeventprocessor.ts +++ b/src/matrixeventprocessor.ts @@ -84,4 +84,5 @@ export class MatrixEventProcessor { } return body; } + } diff --git a/src/messageprocessor.ts b/src/messageprocessor.ts index 57e1cb3..6dac01a 100644 --- a/src/messageprocessor.ts +++ b/src/messageprocessor.ts @@ -150,7 +150,7 @@ export class MessageProcessor { const id = results[ID_EMOJI_REGEX_GROUP]; try { // we still fetch the mxcUrl to check if the emoji is valid= - const mxcUrl = await this.bot.GetEmoji(name, animated, id); + const mxcUrl = await this.opts.bot.GetEmoji(name, animated, id); content = content.replace(results[0], `:${name}:`); } catch (ex) { log.warn("MessageProcessor", @@ -169,7 +169,7 @@ export class MessageProcessor { const name = escapeHtml(results[NAME_EMOJI_REGEX_GROUP]); const id = results[ID_EMOJI_REGEX_GROUP]; try { - const mxcUrl = await this.bot.GetEmoji(name, animated, id); + const mxcUrl = await this.opts.bot.GetEmoji(name, animated, id); content = content.replace(results[0], `<img alt="${name}" src="${mxcUrl}" style="height: ${EMOJI_SIZE};"/>`); } catch (ex) { -- GitLab