Skip to content

Commit f333a08

Browse files
authored
Feat repel improvements (#961)
* refractor: use repel role id instead of name * fix: fix typescript errors * feat: add channel logger utility * feat: add Discord error codes enum * feat: implement new repel command options + logging
1 parent 5e8e824 commit f333a08

File tree

5 files changed

+601
-82
lines changed

5 files changed

+601
-82
lines changed

.env.example

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,7 @@ ONBOARDING_CHANNEL=
4040
JOIN_LOG_CHANNEL=
4141
INTRO_CHANNEL=
4242
INTRO_ROLE=
43-
REPEL_ROLE_NAME=MiniMod # The name of the role that is used for MiniMods
44-
REPEL_DELETE_COUNT=2 # The number of messages to delete when using the repel command
43+
REPEL_ROLE_ID=1002411741776461844 # The ID of the role that is used for MiniMods
44+
REPEL_DEFAULT_DELETE_COUNT=20 # The number of messages to delete when using the repel command
45+
REPEL_LOG_CHANNEL_ID=1403558160144531589 # The channel where the repel command logs are sent
46+
REPEL_DEFAULT_TIMEOUT=6 # Default timeout for the repel command in HOURS

src/enums.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,9 @@ export enum Months {
5252
November = 10,
5353
December = 11,
5454
}
55+
56+
/* https://discord.com/developers/docs/topics/opcodes-and-status-codes#json-json-error-codes */
57+
export enum DiscordAPIErrorCode {
58+
UnknownMember = 10007,
59+
UnknownUser = 10013,
60+
}

src/env.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ export const { JOIN_LOG_CHANNEL } = process.env;
4343
export const { INTRO_CHANNEL } = process.env;
4444
export const { INTRO_ROLE } = process.env;
4545

46-
export const { REPEL_ROLE_NAME } = process.env;
47-
export const REPEL_DELETE_COUNT =
48-
Number.parseInt(process.env.REPEL_DELETE_COUNT) || 2;
46+
export const { REPEL_ROLE_ID } = process.env;
47+
export const REPEL_DEFAULT_DELETE_COUNT =
48+
Number.parseInt(process.env.REPEL_DEFAULT_DELETE_COUNT) || 20;
49+
export const { REPEL_LOG_CHANNEL_ID } = process.env;
50+
export const REPEL_DEFAULT_TIMEOUT =
51+
Number.parseInt(process.env.REPEL_DEFAULT_TIMEOUT) || 6;

0 commit comments

Comments
 (0)