Skip to content

Commit

Permalink
Add | Command to console
Browse files Browse the repository at this point in the history
  • Loading branch information
Adivise committed Nov 3, 2024
1 parent 64eb9a3 commit e2646dd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions events/guild/interactionCreate.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
const { InteractionType, PermissionsBitField } = require("discord.js");
const { InteractionType } = require("discord.js");
const ytsr = require("@distube/ytsr");
const { SEARCH_DEFAULT } = require("../../settings/config.js")
const { SEARCH_DEFAULT } = require("../../settings/config.js");
const { Database } = require("st.db");
const { red } = require('chalk');

const BStats = new Database("./settings/models/stats.json", { databaseInObject: true });

module.exports = async(client, interaction) => {
if (interaction.isCommand || interaction.isContextMenuCommand || interaction.isModalSubmit || interaction.isChatInputCommand) {
Expand Down Expand Up @@ -54,6 +58,7 @@ module.exports = async(client, interaction) => {
try {
client.addCount(command.name.at(-1));
command.run(client, interaction);
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.`);
} catch (error) {
console.log(error);
await interaction.reply({ content: `Something went wrong!`, ephmeral: true });
Expand Down

0 comments on commit e2646dd

Please sign in to comment.