toowake

Untitled

Mar 15th, 2023
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. const { SlashCommandBuilder, EmbedBuilder } = require("discord.js");
  2.  
  3. module.exports = {
  4. data: new SlashCommandBuilder()
  5. .setName("report-bug")
  6. .setDescription("report a bug to the Developers of this Bot!")
  7. .addStringOption(option => option
  8. .setName("command")
  9. .setDescription("The not-working/bugging command")
  10. .setRequired(true)
  11. )
  12. .addStringOption(option => option
  13. .setName("details")
  14. .setDescription("Describe the Problem (not required, you can leave that blank ) :)")
  15. .setRequired(false)
  16. ),
  17.  
  18. async execute (interaction, client) {
  19. const USER = interaction.user.tag;
  20. const Command = interaction.options.getString("command");
  21. const BUG = interaction.options.getString("details") || "No details given!";
  22.  
  23. const embed = new EmbedBuilder()
  24. .setTitle("NEW REPORTED BUG!")
  25. .setDescription(`Bug: ${BUG}`)
  26. .addFields({ name: "Command", value: `${Command}`, inline: false})
  27. .addFields({ name: `user`, value: `${USER}`, inline: false})
  28.  
  29. const sendEmbed = new EmbedBuilder()
  30. .setTitle("YOU REPORTED A BUG!")
  31. .setDescription(`Bug: ${BUG}`)
  32. .addFields({ name: "Command", value: `${Command}`})
  33. .setFooter({ text: "The Developer Team will contact you as fast as they can!"})
  34.  
  35. const channel = client.channels.cache.get('Channel ID for the Bug Report here');
  36.  
  37. channel.send({
  38. embeds: [embed]
  39. }).catch(err => {
  40. return;
  41. });
  42.  
  43. return interaction.reply({ embeds: [sendEmbed], ephemeral: true }).catch(err => {
  44. return;
  45. });
  46.  
  47. }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment