Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //command logging
- client.on(Events.InteractionCreate, async interaction => {
- if(!interaction) return;
- if(!interaction.isChatInputCommand()) return;
- else {
- const channel = await client.channels.cache.get("1127250053451485246");
- const server = interaction.guild.name;
- const userId = interaction.user.id;
- const embed = new EmbedBuilder()
- .setColor("DarkButNotBlack")
- .setTitle(`⚠️ Chat Command Used!`)
- .addFields({ name: `Server Name`, value: `${server}`})
- .addFields({ name: `Chat Command`, value: `${interaction.commandName}`})
- .addFields({ name: `User`, value: `<@${userId}>`})
- .addFields({ name: `Channel`, value: `${interaction.channel.id}`})
- .addFields({ name: `Link:`, value: `https://discord.com/channels/${interaction.guild.id}/${interaction.channel.id}`})
- .setTimestamp()
- .setFooter({ text: `Chat Command Executed`})
- await channel.send({ embeds: [embed] }).catch(err => {
- console.log("There was an error logging the command!")
- });
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment