Skip to content

Commit e2646dd

Browse files
committed
Add | Command to console
1 parent 64eb9a3 commit e2646dd

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

events/guild/interactionCreate.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
const { InteractionType, PermissionsBitField } = require("discord.js");
1+
const { InteractionType } = require("discord.js");
22
const ytsr = require("@distube/ytsr");
3-
const { SEARCH_DEFAULT } = require("../../settings/config.js")
3+
const { SEARCH_DEFAULT } = require("../../settings/config.js");
4+
const { Database } = require("st.db");
5+
const { red } = require('chalk');
6+
7+
const BStats = new Database("./settings/models/stats.json", { databaseInObject: true });
48

59
module.exports = async(client, interaction) => {
610
if (interaction.isCommand || interaction.isContextMenuCommand || interaction.isModalSubmit || interaction.isChatInputCommand) {
@@ -54,6 +58,7 @@ module.exports = async(client, interaction) => {
5458
try {
5559
client.addCount(command.name.at(-1));
5660
command.run(client, interaction);
61+
console.log(`[COMMAND] ${command.name.at(-1)} executed by ${interaction.user.tag} | [${client.user.tag}] in ${interaction.guild.name} (${interaction.guild.id}) | Total Used: ${BStats.all().find((i) => i.ID === command.name.at(-1)).data} times.`);
5762
} catch (error) {
5863
console.log(error);
5964
await interaction.reply({ content: `Something went wrong!`, ephmeral: true });

0 commit comments

Comments
 (0)