Skip to content

Commit df37801

Browse files
authored
Remove non template implementation (#25)
* Replace hard code ids to environment fields * Delete yarn.lock * Fix workflow
1 parent fe5a9ee commit df37801

File tree

3 files changed

+7
-4316
lines changed

3 files changed

+7
-4316
lines changed

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
run: >
4646
echo "export const ENV = 'dev'; export const BOT_TOKEN = ''; export const MIXPANEL_ID = ''; export const TOP_GG_TOKEN = '';
4747
export const GUILD_IDS = ''; export const GUILD_NOTIFICATION_WEBHOOK_URL = ''; export const USE_DATABASE = false;
48-
export const ERROR_NOTIFICATION_WEBHOOK_URL = ''; export const BOOT_NOTIFICATION_CHANNEL_ID = '';"
48+
export const ERROR_NOTIFICATION_WEBHOOK_URL = ''; export const BOOT_NOTIFICATION_CHANNEL_ID = ''; export const BOT_ID = '';"
4949
> src/config/environment.ts
5050
5151
- name: Load database config
@@ -75,7 +75,7 @@ jobs:
7575
run: >
7676
echo "export const ENV = 'dev'; export const BOT_TOKEN = ''; export const MIXPANEL_ID = ''; export const TOP_GG_TOKEN = '';
7777
export const GUILD_IDS = ''; export const GUILD_NOTIFICATION_WEBHOOK_URL = ''; export const USE_DATABASE = false;
78-
export const ERROR_NOTIFICATION_WEBHOOK_URL = ''; export const BOOT_NOTIFICATION_CHANNEL_ID = '';"
78+
export const ERROR_NOTIFICATION_WEBHOOK_URL = ''; export const BOOT_NOTIFICATION_CHANNEL_ID = ''; export const BOT_ID = '';"
7979
> src/config/environment.ts
8080
8181
- name: Load database config

src/events/ready/index.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { REST, Routes } from 'discord.js';
22
import { AppCommand } from '../../commands/commands';
3-
import { BOT_TOKEN, ENV, GUILD_IDS, USE_DATABASE } from '../../config/environment';
3+
import { BOT_ID, BOT_TOKEN, ENV, GUILD_IDS, USE_DATABASE } from '../../config/environment';
44
import { createGuildTable, populateGuilds } from '../../services/database';
55
import { sendBootNotification, sendErrorLog } from '../../utils/helpers';
66
import { EventModule } from '../events';
@@ -14,17 +14,15 @@ const registerApplicationCommands = async (commands?: AppCommand[]) => {
1414
try {
1515
if (ENV === 'dev') {
1616
if (GUILD_IDS) {
17-
//Registering guild-only commands to the bot; I like to use a different bot for dev purposes
18-
//TODO: Change id here to placeholder
19-
await rest.put(Routes.applicationGuildCommands('929421200797626388', GUILD_IDS), {
17+
//Registering guild-only commands to the bot i.e. only specified servers will see commands; I like to use a different bot when in development
18+
await rest.put(Routes.applicationGuildCommands(BOT_ID, GUILD_IDS), {
2019
body: commandList,
2120
});
2221
console.log('Successfully registered guild application commands');
2322
}
2423
} else {
25-
//Registering global commands for the bot i.e. every guild will see the commands; I mostly just use this in production
26-
//TODO: Change id here to placeholder
27-
await rest.put(Routes.applicationCommands('518196430104428579'), { body: commandList });
24+
//Registering global commands for the bot i.e. every server bot is in will see commands; use this in production
25+
await rest.put(Routes.applicationCommands(BOT_ID), { body: commandList });
2826
console.log('Successfully registered global application commands');
2927
}
3028
} catch (error) {

0 commit comments

Comments
 (0)