From 80259a0801947a3d83b88223c29906c75a23ab21 Mon Sep 17 00:00:00 2001 From: Karar Al-Remahy Date: Wed, 12 Aug 2020 15:12:10 +0200 Subject: [PATCH] fix: channelID didn't exist on !befriendlier usage --- src/Twitch.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Twitch.ts b/src/Twitch.ts index 8484014..92b0240 100644 --- a/src/Twitch.ts +++ b/src/Twitch.ts @@ -220,13 +220,14 @@ export default class Client { } private async prepareMsg (msg: PrivmsgMessage): Promise { + if (msg.senderUserID === this.id) { + return + } + // TODO: REFACTOR THIS LATER. if (msg.messageText === '!befriendlier') { - const msgBot = { - senderUserID: msg.senderUserID, - senderUsername: msg.senderUsername, - messageText: '@@bot', - } + const msgBot = { ...msg } + msgBot.messageText = '@@bot' const foundChannel = this.channels.get(msg.channelID)