DoingGoodHelping

Say Command

Jan 11th, 2021
470
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const BaseCommand = require('../../utils/structures/BaseCommand');
  2. const Discord = require('discord.js');
  3.  
  4. module.exports = class SayCommand extends BaseCommand {
  5.   constructor() {
  6.     super('say', 'fun', []);
  7.   }
  8.  
  9.   async run(client, message, args) {
  10.     const messageToSay = args.join(" ");
  11.     const sayEmbed = Discord.MessageEmbed()
  12.       .setTitle(`${message.author.tag} says: ${messageToSay}`)
  13.       .setFooter(message.author.tag, message.author.displayAvatarURL())
  14.       .setColor("#009900")
  15.       .setTimestamp()
  16.     try {
  17.       await message.channel.send(sayEmbed);
  18.     }catch (err){
  19.       console.log("There was an error while running the say command");
  20.       console.log("Error below");
  21.       console.log(err)
  22.       message.channel.send('I am not able to say that message.')
  23.     }
  24.   }
  25. }
RAW Paste Data