Skip to content
This repository has been archived by the owner on Jul 15, 2024. It is now read-only.

Commit

Permalink
Update ready.js
Browse files Browse the repository at this point in the history
  • Loading branch information
wdhdev committed Jul 9, 2023
1 parent 6911eaa commit 86acf8d
Showing 1 changed file with 16 additions and 34 deletions.
50 changes: 16 additions & 34 deletions src/events/client/ready.js
Original file line number Diff line number Diff line change
@@ -1,38 +1,20 @@
module.exports = {
name: "ready",
once: true,
async execute(client, Discord) {
name: "ready",
once: true,
async execute(client, Discord) {
try {
// Login Message
console.log(`Logged in as: ${client.user.tag.endsWith("#0") ? client.user.username : client.user.tag}`);
// Login Message
console.log(`Logged in as: ${client.user.tag.endsWith("#0") ? client.user.username : client.user.tag}`);

const logsChannel = client.channels.cache.get(client.config_channels.logs);
// Register Commands
const register = require("../../scripts/client-register");
await register(client);

const online = new Discord.EmbedBuilder()
.setColor(client.config_embeds.green)
.setAuthor({ name: client.user.tag.endsWith("#0") ? client.user.username : client.user.tag, iconURL: client.user.displayAvatarURL({ format: "png", dynamic: true }), url: `https://discord.com/users/${client.user.id}` })
.setTitle("🟢 Bot is Online")
.setTimestamp()

logsChannel.send({ embeds: [online] });

// Register Commands
const register = require("../../scripts/client-register");
await register(client);

const registered = new Discord.EmbedBuilder()
.setColor(client.config_embeds.green)
.setAuthor({ name: client.user.tag.endsWith("#0") ? client.user.username : client.user.tag, iconURL: client.user.displayAvatarURL({ format: "png", dynamic: true }), url: `https://discord.com/users/${client.user.id}` })
.setTitle("📝 Registered Commands")
.setTimestamp()

logsChannel.send({ embeds: [registered] });

// Cleanup Database
const clean = require("../../util/database/clean");
await clean(client, Discord);
} catch(err) {
client.logEventError(err);
}
}
}
// Cleanup Database
const cleanDB = require("../../util/database/clean");
await cleanDB(client, Discord);
} catch(err) {
client.logEventError(err);
}
}
}

0 comments on commit 86acf8d

Please sign in to comment.