From 08a2b375a3add4c08203ccf9a8932054681d2f3b Mon Sep 17 00:00:00 2001 From: "Ean Milligan (Bastion)" Date: Sat, 10 Sep 2022 11:53:46 -0400 Subject: [PATCH] V0.4.2 - Fix reaction system to not react to self --- config.example.ts | 2 +- src/events/reactionAdd.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/config.example.ts b/config.example.ts index 0c6309e..e61a79f 100644 --- a/config.example.ts +++ b/config.example.ts @@ -1,6 +1,6 @@ export const config = { 'name': 'Sweeper Bot', // Name of the bot - 'version': '0.4.1', // Version of the bot + 'version': '0.4.2', // Version of the bot 'token': 'the_bot_token', // Discord API Token for this bot 'localtoken': 'local_testing_token', // Discord API Token for a secondary OPTIONAL testing bot, THIS MUST BE DIFFERENT FROM "token" 'prefix': 's!', // Prefix for all commands diff --git a/src/events/reactionAdd.ts b/src/events/reactionAdd.ts index f114541..0a2e127 100644 --- a/src/events/reactionAdd.ts +++ b/src/events/reactionAdd.ts @@ -2,12 +2,16 @@ import config from '../../config.ts'; import { // Discordeno deps Bot, + botId, } from '../../deps.ts'; import { ReactionAdd } from '../types/eventTypes.ts'; import utils from '../utils.ts'; import functions from '../functions/_index.ts'; export const reactionAdd = async (bot: Bot, payload: ReactionAdd) => { + // Ignore self + if (botId === payload.userId) return; + if (config.pollChannels.includes(payload.channelId)) { try { const message = await bot.helpers.getMessage(payload.channelId, payload.messageId);