summaryrefslogtreecommitdiff
path: root/packages/gateway
diff options
context:
space:
mode:
authorFuwn <[email protected]>2025-10-06 20:31:16 -0700
committerFuwn <[email protected]>2025-10-06 20:31:16 -0700
commit79b15f61449d811abad586a5b5fc739284723192 (patch)
treee4a35db5c6a02339f15afd42a01b7ac3fa458277 /packages/gateway
parentrefactor(gateway): Move most channel IDs to shared constants (diff)
downloadumabotdiscord-79b15f61449d811abad586a5b5fc739284723192.tar.xz
umabotdiscord-79b15f61449d811abad586a5b5fc739284723192.zip
refactor(gateway): Move magic IDs to shared constants
Diffstat (limited to 'packages/gateway')
-rw-r--r--packages/gateway/src/constants.ts21
-rw-r--r--packages/gateway/src/listeners/messageCreate/announcementReaction.ts4
-rw-r--r--packages/gateway/src/listeners/messageCreate/randomEyesReaction.ts6
-rw-r--r--packages/gateway/src/listeners/messageCreate/roleMentionCooldown.ts3
-rw-r--r--packages/gateway/src/listeners/messageDeletion.ts6
-rw-r--r--packages/gateway/src/listeners/roleProtection.ts8
6 files changed, 33 insertions, 15 deletions
diff --git a/packages/gateway/src/constants.ts b/packages/gateway/src/constants.ts
index 54f9903..117598c 100644
--- a/packages/gateway/src/constants.ts
+++ b/packages/gateway/src/constants.ts
@@ -12,5 +12,24 @@ export {
ROLEPLAY_ANNOUNCEMENTS_CHANNEL_ID,
CENTRAL_ART_MEDIA_CHANNEL_ID,
CENTRAL_ART_MEDIA_NSFW_CHANNEL_ID,
- CENTRAL_USER_NSFW_APPLICATIONS_LOG_CHANNEL_ID
+ CENTRAL_MODERATION_LOG_CHANNEL_ID,
+ CENTRAL_GENERAL_CHANNEL_ID,
+ CENTRAL_UMABOT_CHANNEL_ID,
+ CENTRAL_OWNER_ROLE_ID,
+ CENTRAL_ADMINISTRATOR_ROLE_ID,
+ CENTRAL_MODERATOR_ROLE_ID,
+ CENTRAL_TRIAL_MODERATOR_ROLE_ID,
+ CENTRAL_PROTECTED_ROLE_ID,
+ CENTRAL_VERIFIED_ROLEPLAY_ROLE_ID,
+ CENTRAL_ROLEPLAY_CURATOR_ROLE_ID,
+ CENTRAL_ART_MEDIA_ROLE_ID,
+ CENTRAL_ROLEPLAY_NSFW_ROLE_ID,
+ CENTRAL_REVIVE_ROLEPLAY_ROLE_ID,
+ CENTRAL_REVIVE_CHAT_ROLE_ID,
+ CENTRAL_USER_COMPLAINTS_CHANNEL_ID,
+ CENTRAL_USER_APPEALS_CHANNEL_ID,
+ CENTRAL_USER_NSFW_APPLICATIONS_LOG_CHANNEL_ID,
+ STAFF_GUILD_ID,
+ STAFF_LOG_CHANNEL_ID,
+ CENTRAL_OKBUDDY_EMOJI_ID
} from "../../shared";
diff --git a/packages/gateway/src/listeners/messageCreate/announcementReaction.ts b/packages/gateway/src/listeners/messageCreate/announcementReaction.ts
index 79ae031..87fada4 100644
--- a/packages/gateway/src/listeners/messageCreate/announcementReaction.ts
+++ b/packages/gateway/src/listeners/messageCreate/announcementReaction.ts
@@ -1,5 +1,5 @@
import { Message } from "discord.js";
-import { CENTRAL_ANNOUNCEMENTS_CHANNEL_ID } from "../../constants";
+import { CENTRAL_ANNOUNCEMENTS_CHANNEL_ID, CENTRAL_OKBUDDY_EMOJI_ID } from "../../constants";
export const handleAnnouncementReaction = async (message: Message) => {
if (message.channelId !== CENTRAL_ANNOUNCEMENTS_CHANNEL_ID) return;
@@ -7,7 +7,7 @@ export const handleAnnouncementReaction = async (message: Message) => {
if (message.author.id === message.client.user?.id) return;
try {
- await message.react("1406426721158303864");
+ await message.react(CENTRAL_OKBUDDY_EMOJI_ID);
} catch (error) {
console.error("Failed to add okbuddy reaction to announcement:", error);
}
diff --git a/packages/gateway/src/listeners/messageCreate/randomEyesReaction.ts b/packages/gateway/src/listeners/messageCreate/randomEyesReaction.ts
index c856776..8206eb9 100644
--- a/packages/gateway/src/listeners/messageCreate/randomEyesReaction.ts
+++ b/packages/gateway/src/listeners/messageCreate/randomEyesReaction.ts
@@ -1,10 +1,10 @@
import { Message } from "discord.js";
-import { CENTRAL_ART_MEDIA_CHANNEL_ID } from "../../constants";
+import { CENTRAL_ART_MEDIA_CHANNEL_ID, CENTRAL_GENERAL_CHANNEL_ID, CENTRAL_UMABOT_CHANNEL_ID } from "../../constants";
const EYES_REACTION_CHANNELS = [
CENTRAL_ART_MEDIA_CHANNEL_ID,
- "1406422619087044675",
- "1418154524178255932",
+ CENTRAL_GENERAL_CHANNEL_ID,
+ CENTRAL_UMABOT_CHANNEL_ID,
] as const;
export const handleRandomEyesReaction = async (message: Message) => {
diff --git a/packages/gateway/src/listeners/messageCreate/roleMentionCooldown.ts b/packages/gateway/src/listeners/messageCreate/roleMentionCooldown.ts
index d1fba37..73cad2b 100644
--- a/packages/gateway/src/listeners/messageCreate/roleMentionCooldown.ts
+++ b/packages/gateway/src/listeners/messageCreate/roleMentionCooldown.ts
@@ -1,6 +1,7 @@
import { Message } from "discord.js";
+import { CENTRAL_REVIVE_ROLEPLAY_ROLE_ID, CENTRAL_REVIVE_CHAT_ROLE_ID } from "../../constants";
-const COOLDOWN_ROLES = ["1421632398302515271", "1421632887219814572"];
+const COOLDOWN_ROLES = [CENTRAL_REVIVE_ROLEPLAY_ROLE_ID, CENTRAL_REVIVE_CHAT_ROLE_ID];
const COOLDOWN_DURATION = 30 * 60 * 1000;
const roleCooldowns = new Map<string, number>();
diff --git a/packages/gateway/src/listeners/messageDeletion.ts b/packages/gateway/src/listeners/messageDeletion.ts
index 2be24e0..b548ac0 100644
--- a/packages/gateway/src/listeners/messageDeletion.ts
+++ b/packages/gateway/src/listeners/messageDeletion.ts
@@ -1,10 +1,10 @@
import { Client, Events, EmbedBuilder } from "discord.js";
import { sendAuditLog } from "../commands/utilities";
-import { CENTRAL_GUILD_ID, ROLEPLAY_GUILD_ID, CENTRAL_AUDIT_LOG_CHANNEL_ID, ROLEPLAY_AUDIT_LOG_CHANNEL_ID } from "../constants";
+import { CENTRAL_GUILD_ID, ROLEPLAY_GUILD_ID, CENTRAL_MESSAGE_LOG_CHANNEL_ID, ROLEPLAY_MESSAGE_LOG_CHANNEL_ID } from "../constants";
const GUILD_CHANNEL_MAPPINGS = {
- [CENTRAL_GUILD_ID]: CENTRAL_AUDIT_LOG_CHANNEL_ID,
- [ROLEPLAY_GUILD_ID]: ROLEPLAY_AUDIT_LOG_CHANNEL_ID,
+ [CENTRAL_GUILD_ID]: CENTRAL_MESSAGE_LOG_CHANNEL_ID,
+ [ROLEPLAY_GUILD_ID]: ROLEPLAY_MESSAGE_LOG_CHANNEL_ID,
} as const;
export const handleMessageDeletion = (client: Client) => {
diff --git a/packages/gateway/src/listeners/roleProtection.ts b/packages/gateway/src/listeners/roleProtection.ts
index fec8b8c..2f9cf97 100644
--- a/packages/gateway/src/listeners/roleProtection.ts
+++ b/packages/gateway/src/listeners/roleProtection.ts
@@ -1,7 +1,5 @@
import { Client, Events } from "discord.js";
-import { GUILD_ID } from "../constants";
-
-const PROTECTED_ROLE_ID = "1406422617724026909";
+import { GUILD_ID, CENTRAL_PROTECTED_ROLE_ID } from "../constants";
const COLOR_ROLE_IDS = [
"1407075059830624406", // Nice Nature Red
"1407075160250650664", // Taiki Shuttle Green
@@ -43,7 +41,7 @@ export const handleRoleProtection = (client: Client) => {
if (addedRoles.size === 0) return;
try {
- const protectedRole = newMember.guild.roles.cache.get(PROTECTED_ROLE_ID);
+ const protectedRole = newMember.guild.roles.cache.get(CENTRAL_PROTECTED_ROLE_ID);
if (!protectedRole) {
console.error("Protected role not found");
@@ -54,7 +52,7 @@ export const handleRoleProtection = (client: Client) => {
const guildOwner = await newMember.guild.fetchOwner();
for (const role of addedRoles.values()) {
- if (role.id === PROTECTED_ROLE_ID) continue;
+ if (role.id === CENTRAL_PROTECTED_ROLE_ID) continue;
if (COLOR_ROLE_IDS.includes(role.id)) continue;