Skip to content

Commit f7663d9

Browse files
authored
Move prefixes to .env (#186)
* move prefixes to .env * default prefix to ! if not set in env
1 parent 21e1729 commit f7663d9

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ TIME_BEFORE_HELPER_PING=
2323
SUGGESTIONS_CHANNEL=
2424

2525
LOG_CHANNEL=
26+
27+
# PREFIXES=!,t!

src/env.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,5 @@ export const timeBeforeHelperPing = parseInt(
3636
export const suggestionsChannelId = process.env.SUGGESTIONS_CHANNEL!;
3737

3838
export const logChannelId = process.env.LOG_CHANNEL!;
39+
40+
export const prefixes = (process.env.PREFIXES ?? '!').split(',');

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { token, botAdmins } from './env';
1+
import { token, botAdmins, prefixes } from './env';
22
import CookiecordClient from 'cookiecord';
33
import { Intents } from 'discord.js';
44
import { getDB } from './db';
@@ -18,7 +18,7 @@ import { ModModule } from './modules/mod';
1818
const client = new CookiecordClient(
1919
{
2020
botAdmins,
21-
prefix: ['!', 't!'],
21+
prefix: prefixes,
2222
},
2323
{
2424
partials: ['REACTION', 'MESSAGE', 'USER', 'CHANNEL'],

0 commit comments

Comments
 (0)