Skip to content

Commit

Permalink
fix(discordbot): keep DiscordBotData default values
Browse files Browse the repository at this point in the history
No need to redefine default values anymore in DiscordBotData parameter that's sent to the DiscordBot
class constructor
  • Loading branch information
The Alpha committed Sep 30, 2023
1 parent cb2fae4 commit 62a9553
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/core/discordBot.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,7 @@ class DiscordBot {
* @param {ClientOptions} options - The bot's client options.
*/
constructor(
data = {
rootDirectory: "bot",
dataDirectory: "bot/data"
},
data,
options = {
intents: [
GatewayIntentBits.Guilds,
Expand All @@ -73,6 +70,12 @@ class DiscordBot {
]
}
) {
const data2 = {
rootDirectory: "bot",
dataDirectory: "bot/data"
};
Object.assign(data2, data);

// TODO Check token and clientId validity
this.client = new Client(options);
this.runBot(data);
Expand Down

0 comments on commit 62a9553

Please sign in to comment.