Spaces:
Runtime error
Runtime error
Update bot.js
Browse files
bot.js
CHANGED
|
@@ -29,9 +29,13 @@ client.on("messageCreate", (message) => {
|
|
| 29 |
const content = message.content.trim();
|
| 30 |
const prefix = "!";
|
| 31 |
|
| 32 |
-
// Track command usage
|
| 33 |
-
|
| 34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
if (content === `${prefix}ping`) {
|
| 37 |
message.reply(`Pong! Latency: ${client.ws.ping}ms`);
|
|
|
|
| 29 |
const content = message.content.trim();
|
| 30 |
const prefix = "!";
|
| 31 |
|
| 32 |
+
// Track command usage (only if functions exist)
|
| 33 |
+
try {
|
| 34 |
+
if (db.trackServerActivity) db.trackServerActivity(message.guildId, message.guild?.name || "Unknown", message.guild?.memberCount || 0);
|
| 35 |
+
if (db.trackCommandUsage) db.trackCommandUsage(message.guildId, message.author.id, message.author.tag, content.split(" ")[0]);
|
| 36 |
+
} catch (e) {
|
| 37 |
+
console.error("[ERROR] Tracking failed:", e.message);
|
| 38 |
+
}
|
| 39 |
|
| 40 |
if (content === `${prefix}ping`) {
|
| 41 |
message.reply(`Pong! Latency: ${client.ws.ping}ms`);
|