toowake

index.js

Oct 6th, 2023
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //command logging
  2. client.on(Events.InteractionCreate, async interaction => {
  3.     if(!interaction) return;
  4.     if(!interaction.isChatInputCommand()) return;
  5.     else {
  6.     const channel = await client.channels.cache.get("1127250053451485246");
  7.     const server = interaction.guild.name;
  8.     const userId = interaction.user.id;
  9.  
  10.     const embed = new EmbedBuilder()
  11.     .setColor("DarkButNotBlack")
  12.     .setTitle(`⚠️ Chat Command Used!`)
  13.     .addFields({ name: `Server Name`, value: `${server}`})
  14.     .addFields({ name: `Chat Command`, value: `${interaction.commandName}`})
  15.     .addFields({ name: `User`, value: `<@${userId}>`})
  16.     .addFields({ name: `Channel`, value: `${interaction.channel.id}`})
  17.     .addFields({ name: `Link:`, value: `https://discord.com/channels/${interaction.guild.id}/${interaction.channel.id}`})
  18.     .setTimestamp()
  19.     .setFooter({ text: `Chat Command Executed`})
  20.    
  21.  
  22.         await channel.send({ embeds: [embed] }).catch(err => {
  23.             console.log("There was an error logging the command!")
  24.         });
  25.    
  26.    
  27.     }
  28.  })
Advertisement
Add Comment
Please, Sign In to add comment