Guest User

Author Object Example

a guest
Jan 5th, 2024
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module.exports = {
  2.     data: new SlashCommandBuilder()
  3.         .setName('embedcreator')
  4.         .setDescription('This creates a custom embed')
  5.         .addStringOption(Option =>
  6.             Option
  7.                 .setName('author-name')
  8.                 .setDescription('This is the name of author of the embed')
  9.                 .setRequired(false)
  10.         )
  11.         // ... the rest of your command options
  12.  
  13.     async execute(interaction) {
  14.         const { options } = interaction;
  15.        
  16.         // Here we declare the Author Title string.
  17.         const authorTitle = options.getString('author-name')
  18.         // ... the rest of your getString() variables
  19.  
  20.         const embed = new EmbedBuilder()
  21.             .setAuthor({
  22.                 // Here we need a string for the name, so authorTitle is passed in.
  23.                 name: authorTitle
  24.                 // ... your other author options
  25.             })
  26.             // ... the rest of your embed options
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment