summaryrefslogtreecommitdiff
path: root/packages/gateway/src/commands
diff options
context:
space:
mode:
Diffstat (limited to 'packages/gateway/src/commands')
-rw-r--r--packages/gateway/src/commands/react.ts30
1 files changed, 23 insertions, 7 deletions
diff --git a/packages/gateway/src/commands/react.ts b/packages/gateway/src/commands/react.ts
index d31cc90..8e8e5b3 100644
--- a/packages/gateway/src/commands/react.ts
+++ b/packages/gateway/src/commands/react.ts
@@ -45,8 +45,11 @@ export const handleReactCommand = async (message: Message) => {
try {
targetChannel = await message.client.channels.fetch(channelId);
- } catch (error) {
- await replyWithCleanup(message, "❌ Channel not found or not accessible.");
+ } catch {
+ await replyWithCleanup(
+ message,
+ "❌ Channel not found or not accessible.",
+ );
return;
}
@@ -72,17 +75,30 @@ export const handleReactCommand = async (message: Message) => {
}
const existingReaction = targetMessage.reactions.cache.get(emoji);
- const botReacted = existingReaction?.users.cache.has(message.client.user?.id || '');
+ const botReacted = existingReaction?.users.cache.has(
+ message.client.user?.id || "",
+ );
if (botReacted) {
- await targetMessage.reactions.cache.get(emoji)?.users.remove(message.client.user?.id);
- await replyWithCleanup(message, `✅ Removed reaction ${emoji} from message in ${targetChannel}`);
+ await targetMessage.reactions.cache
+ .get(emoji)
+ ?.users.remove(message.client.user?.id);
+ await replyWithCleanup(
+ message,
+ `✅ Removed reaction ${emoji} from message in ${targetChannel}`,
+ );
} else {
await targetMessage.react(emoji);
- await replyWithCleanup(message, `✅ Reacted with ${emoji} to message in ${targetChannel}`);
+ await replyWithCleanup(
+ message,
+ `✅ Reacted with ${emoji} to message in ${targetChannel}`,
+ );
}
} catch (error) {
console.error("Error toggling reaction:", error);
- await replyWithCleanup(message, "❌ Failed to toggle reaction on the message.");
+ await replyWithCleanup(
+ message,
+ "❌ Failed to toggle reaction on the message.",
+ );
}
};