From 79e7e88fab1ce05cf84abeba2e05300a93b4759c Mon Sep 17 00:00:00 2001 From: Max Isom Date: Sat, 18 Sep 2021 17:04:04 -0400 Subject: Remove requirement for DISCORD_CLIENT_ID Closes #336 --- src/bot.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/bot.ts') diff --git a/src/bot.ts b/src/bot.ts index 1b8f8dd..16bdba0 100644 --- a/src/bot.ts +++ b/src/bot.ts @@ -16,14 +16,12 @@ export default class { private readonly client: Client; private readonly naturalLanguage: NaturalLanguage; private readonly token: string; - private readonly clientId: string; private readonly commands!: Collection; - constructor(@inject(TYPES.Client) client: Client, @inject(TYPES.Services.NaturalLanguage) naturalLanguage: NaturalLanguage, @inject(TYPES.Config.DISCORD_TOKEN) token: string, @inject(TYPES.Config.DISCORD_CLIENT_ID) clientId: string) { + constructor(@inject(TYPES.Client) client: Client, @inject(TYPES.Services.NaturalLanguage) naturalLanguage: NaturalLanguage, @inject(TYPES.Config.DISCORD_TOKEN) token: string) { this.client = client; this.naturalLanguage = naturalLanguage; this.token = token; - this.clientId = clientId; this.commands = new Collection(); } @@ -96,7 +94,7 @@ export default class { }); this.client.on('ready', async () => { - console.log(`Ready! Invite the bot with https://discordapp.com/oauth2/authorize?client_id=${this.clientId}&scope=bot&permissions=36752448`); + console.log(`Ready! Invite the bot with https://discordapp.com/oauth2/authorize?client_id=${this.client.user?.id ?? ''}&scope=bot&permissions=36752448`); }); this.client.on('error', console.error); -- cgit v1.2.3