toowake

Suggestion Command

Mar 21st, 2023
683
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. const { SlashCommandBuilder, EmbedBuilder } = require("discord.js");
  2.  
  3. module.exports = {
  4. data: new SlashCommandBuilder()
  5. .setName("suggest")
  6. .setDescription("Suggest for a feature the bot should have")
  7. .addStringOption(option => option
  8. .setName("suggestion")
  9. .setDescription("The suggestion")
  10. .setRequired(true)
  11. ),
  12.  
  13. async execute (interaction, client) {
  14.  
  15. const suggestion = interaction.options.getString("suggestion");
  16. const userx = interaction.user.id;
  17.  
  18. const embed = new EmbedBuilder()
  19. .setTitle("NEW SUGGESTION!")
  20. .setColor("Green")
  21. .addFields({ name:"User: ", value:`<@${userx}>`, inline: false})
  22. .setDescription(`${suggestion}`)
  23. .setTimestamp()
  24.  
  25. const xEmbed = new EmbedBuilder()
  26. .setTitle("You send us a suggestion!")
  27. .setDescription(`${suggestion}`)
  28. .setColor("Green")
  29.  
  30. const channel = client.channels.cache.get('Here the channel ID for the suggestion!');
  31.  
  32. channel.send({
  33. embeds: [embed]
  34. }).catch(err => {
  35. return;
  36. });
  37.  
  38. return interaction.reply({ embeds: [xEmbed], ephemeral: true}).catch(err => {
  39. return;
  40. });
  41.  
  42.  
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment