From 57d6b45d2e81ad0c92273a38bfb2d351252fe481 Mon Sep 17 00:00:00 2001 From: "Ean Milligan (Bastion)" Date: Tue, 20 Sep 2022 14:34:51 -0400 Subject: [PATCH] v0.4.3 upgrade to dd16, improve reactionAdd ignore to ignore local version of self --- deps.ts | 7 ++++--- flags.ts | 2 +- src/events/reactionAdd.ts | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/deps.ts b/deps.ts index 85f21c1..747a109 100644 --- a/deps.ts +++ b/deps.ts @@ -1,12 +1,13 @@ // All external dependancies are to be loaded here to make updating dependancy versions much easier -import { getBotIdFromToken } from 'https://deno.land/x/discordeno@15.0.1/mod.ts'; // https://deno.land/x/discordeno@14.0.1/mod.ts +import { getBotIdFromToken } from 'https://deno.land/x/discordeno@16.0.1/mod.ts'; import config from './config.ts'; import { LOCALMODE } from './flags.ts'; export const botId = getBotIdFromToken(LOCALMODE ? config.localtoken : config.token); +export const sweeperBotIds = [getBotIdFromToken(config.localtoken), getBotIdFromToken(config.token)]; -export { ActivityTypes, createBot, editBotMember, editBotStatus, getReactions, Intents, sendMessage, startBot } from 'https://deno.land/x/discordeno@15.0.1/mod.ts'; +export { ActivityTypes, createBot, editBotMember, editBotStatus, getReactions, Intents, sendMessage, startBot } from 'https://deno.land/x/discordeno@16.0.1/mod.ts'; -export type { Bot, CreateMessage, Emoji, EventHandlers, Guild, Member, Message, User } from 'https://deno.land/x/discordeno@15.0.1/mod.ts'; +export type { Bot, CreateMessage, Emoji, EventHandlers, Guild, Member, Message, User } from 'https://deno.land/x/discordeno@16.0.1/mod.ts'; export { Client } from 'https://deno.land/x/mysql@v2.10.2/mod.ts'; diff --git a/flags.ts b/flags.ts index 939f73a..94bf935 100644 --- a/flags.ts +++ b/flags.ts @@ -3,4 +3,4 @@ export const DEVMODE = false; // DEBUG is used to toggle the cmdPrompt export const DEBUG = false; // LOCALMODE is used to run a differnt bot token for local testing -export const LOCALMODE = false; +export const LOCALMODE = true; diff --git a/src/events/reactionAdd.ts b/src/events/reactionAdd.ts index 0a2e127..4fd5ccb 100644 --- a/src/events/reactionAdd.ts +++ b/src/events/reactionAdd.ts @@ -2,7 +2,7 @@ import config from '../../config.ts'; import { // Discordeno deps Bot, - botId, + sweeperBotIds, } from '../../deps.ts'; import { ReactionAdd } from '../types/eventTypes.ts'; import utils from '../utils.ts'; @@ -10,7 +10,7 @@ import functions from '../functions/_index.ts'; export const reactionAdd = async (bot: Bot, payload: ReactionAdd) => { // Ignore self - if (botId === payload.userId) return; + if (sweeperBotIds.includes(payload.userId)) return; if (config.pollChannels.includes(payload.channelId)) { try {