summaryrefslogtreecommitdiff
path: root/packages/gateway
diff options
context:
space:
mode:
Diffstat (limited to 'packages/gateway')
-rw-r--r--packages/gateway/src/constants.ts4
-rw-r--r--packages/gateway/src/listeners/channelDeletion.ts4
-rw-r--r--packages/gateway/src/listeners/clientReady/activity.ts5
-rw-r--r--packages/gateway/src/listeners/messageDeletion.ts3
-rw-r--r--packages/gateway/src/listeners/roleProtection.ts3
5 files changed, 14 insertions, 5 deletions
diff --git a/packages/gateway/src/constants.ts b/packages/gateway/src/constants.ts
index 2a680e1..dbe8a45 100644
--- a/packages/gateway/src/constants.ts
+++ b/packages/gateway/src/constants.ts
@@ -33,4 +33,8 @@ export {
CENTRAL_OKBUDDY_EMOJI_ID,
BOT_ID,
COLOR_ROLE_IDS,
+ DISCORD_AUDIT_LOG_TYPES,
+ DISCORD_ACTIVITY_TYPES,
+ DISCORD_APPLICATION_COMMAND_OPTION_TYPES,
+ DISCORD_INTERACTION_CONTEXTS,
} from "../../shared";
diff --git a/packages/gateway/src/listeners/channelDeletion.ts b/packages/gateway/src/listeners/channelDeletion.ts
index 44c58f6..c576f50 100644
--- a/packages/gateway/src/listeners/channelDeletion.ts
+++ b/packages/gateway/src/listeners/channelDeletion.ts
@@ -1,5 +1,5 @@
import { Client, Events } from "discord.js";
-import { CENTRAL_GUILD_ID } from "../constants";
+import { CENTRAL_GUILD_ID, DISCORD_AUDIT_LOG_TYPES } from "../constants";
const channelDeletionTracker = new Map<
string,
@@ -22,7 +22,7 @@ export const handleChannelDeletion = (client: Client) => {
const guildOwner = await guild.fetchOwner();
const auditLogs = await guild.fetchAuditLogs({
- type: 12,
+ type: DISCORD_AUDIT_LOG_TYPES.CHANNEL_DELETE,
limit: 5,
});
const channelDeletionLog = auditLogs.entries.find(
diff --git a/packages/gateway/src/listeners/clientReady/activity.ts b/packages/gateway/src/listeners/clientReady/activity.ts
index 8abd50b..3e201dd 100644
--- a/packages/gateway/src/listeners/clientReady/activity.ts
+++ b/packages/gateway/src/listeners/clientReady/activity.ts
@@ -1,5 +1,8 @@
import { Client } from "discord.js";
+import { DISCORD_ACTIVITY_TYPES } from "../../constants";
export const handleActivity = (client: Client) => {
- client.user?.setActivity("r/okbuddyumamusume", { type: 3 });
+ client.user?.setActivity("r/okbuddyumamusume", {
+ type: DISCORD_ACTIVITY_TYPES.WATCHING,
+ });
};
diff --git a/packages/gateway/src/listeners/messageDeletion.ts b/packages/gateway/src/listeners/messageDeletion.ts
index 992091f..568448b 100644
--- a/packages/gateway/src/listeners/messageDeletion.ts
+++ b/packages/gateway/src/listeners/messageDeletion.ts
@@ -6,6 +6,7 @@ import {
CENTRAL_MESSAGE_LOG_CHANNEL_ID,
ROLEPLAY_MESSAGE_LOG_CHANNEL_ID,
BOT_ID,
+ DISCORD_AUDIT_LOG_TYPES,
} from "../constants";
const GUILD_CHANNEL_MAPPINGS = {
@@ -37,7 +38,7 @@ export const handleMessageDeletion = (client: Client) => {
try {
const auditLogs = await guild?.fetchAuditLogs({
limit: 10,
- type: 72, // MESSAGE_DELETE
+ type: DISCORD_AUDIT_LOG_TYPES.MESSAGE_DELETE,
});
if (!auditLogs || auditLogs.entries.size === 0) return;
diff --git a/packages/gateway/src/listeners/roleProtection.ts b/packages/gateway/src/listeners/roleProtection.ts
index 61d60da..2b9f6cc 100644
--- a/packages/gateway/src/listeners/roleProtection.ts
+++ b/packages/gateway/src/listeners/roleProtection.ts
@@ -3,6 +3,7 @@ import {
CENTRAL_GUILD_ID,
CENTRAL_PROTECTED_ROLE_ID,
COLOR_ROLE_IDS,
+ DISCORD_AUDIT_LOG_TYPES,
} from "../constants";
export const handleRoleProtection = (client: Client) => {
@@ -36,7 +37,7 @@ export const handleRoleProtection = (client: Client) => {
if (role.position > protectedRole.position) {
try {
const auditLogs = await newMember.guild.fetchAuditLogs({
- type: 25, // MEMBER_ROLE_UPDATE
+ type: DISCORD_AUDIT_LOG_TYPES.MEMBER_ROLE_UPDATE,
limit: 10,
});