From 4d73ed633cb8a23a6a8febd4f4e85815ce2381f8 Mon Sep 17 00:00:00 2001 From: Ayeen Date: Fri, 15 Mar 2024 16:41:55 +0800 Subject: [PATCH 1/2] Update About.ts Using client ID from .env instead of copy-paste bot ID manually Signed-off-by: Ayeen... --- src/commands/info/About.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/commands/info/About.ts b/src/commands/info/About.ts index 37d487828..a7a5c7586 100644 --- a/src/commands/info/About.ts +++ b/src/commands/info/About.ts @@ -1,4 +1,7 @@ import { ActionRowBuilder, ButtonBuilder, ButtonStyle } from 'discord.js'; +import dotenv from 'dotenv'; // Import dotenv + +dotenv.config(); // Load environment variables import { Command, Context, Lavamusic } from '../../structures/index.js'; @@ -31,12 +34,14 @@ export default class About extends Command { }); } public async run(client: Lavamusic, ctx: Context): Promise { + const clientId = process.env.CLIENT_ID; // Retrieve client ID from environment variables + const row = new ActionRowBuilder().addComponents( new ButtonBuilder() .setLabel('Invite Lavamusic') .setStyle(ButtonStyle.Link) .setURL( - `https://discord.com/api/oauth2/authorize?client_id=875635121770889257&permissions=8&scope=bot%20applications.commands` + `https://discord.com/api/oauth2/authorize?client_id=${clientId}&permissions=8&scope=bot%20applications.commands` ), new ButtonBuilder() .setLabel('Support Server') @@ -84,6 +89,7 @@ export default class About extends Command { }); } } + /** * Project: lavamusic From adbf29f2ab9c216acd44de4bbf5805d1880f1397 Mon Sep 17 00:00:00 2001 From: Ayeen Date: Mon, 18 Mar 2024 15:00:53 +0800 Subject: [PATCH 2/2] Update About.ts Did it as brblacky requested Signed-off-by: Ayeen... --- src/commands/info/About.ts | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/src/commands/info/About.ts b/src/commands/info/About.ts index a7a5c7586..b609ee467 100644 --- a/src/commands/info/About.ts +++ b/src/commands/info/About.ts @@ -1,8 +1,4 @@ import { ActionRowBuilder, ButtonBuilder, ButtonStyle } from 'discord.js'; -import dotenv from 'dotenv'; // Import dotenv - -dotenv.config(); // Load environment variables - import { Command, Context, Lavamusic } from '../../structures/index.js'; export default class About extends Command { @@ -33,15 +29,14 @@ export default class About extends Command { options: [], }); } - public async run(client: Lavamusic, ctx: Context): Promise { - const clientId = process.env.CLIENT_ID; // Retrieve client ID from environment variables + public async run(client: Lavamusic, ctx: Context): Promise { const row = new ActionRowBuilder().addComponents( new ButtonBuilder() .setLabel('Invite Lavamusic') .setStyle(ButtonStyle.Link) .setURL( - `https://discord.com/api/oauth2/authorize?client_id=${clientId}&permissions=8&scope=bot%20applications.commands` + `https://discord.com/api/oauth2/authorize?client_id=${client.config.clientId}&permissions=8&scope=bot%20applications.commands` ), new ButtonBuilder() .setLabel('Support Server') @@ -88,15 +83,5 @@ export default class About extends Command { components: [row], }); } -} - - -/** - * Project: lavamusic - * Author: Blacky - * Company: Coders - * Copyright (c) 2023. All rights reserved. - * This code is the property of Coder and may not be reproduced or - * modified without permission. For more information, contact us at - * https://discord.gg/ns8CTk9J3e - */ + } +