Skip to content

Commit

Permalink
added abandon.js
Browse files Browse the repository at this point in the history
  • Loading branch information
xca-libur committed Nov 12, 2022
1 parent 344389c commit 2af9f30
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions slashCommands/meme/abandon.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
const { ApplicationCommandType, ApplicationCommandOptionType, AttachmentBuilder, EmbedBuilder} = require('discord.js');

module.exports = {
name: 'abandon',
description: "Generate abandon meme",
type: ApplicationCommandType.ChatInput,
cooldown: 3000,
options: [
{
name: 'text',
description: 'Input note text',
type: ApplicationCommandOptionType.String,
required: true
},



],
run: async (client, interaction) => {
await interaction.deferReply()

client.memer.abandon(interaction.options.get('text').value).then(async image => {

const attachment = new AttachmentBuilder(image, {name: 'abandon.png'})

const embed = new EmbedBuilder()
.setTitle(`Note for ${interaction.user.tag}`)
.setColor('Blue')
.setImage('attachment://abandon.png')
.setTimestamp()

await interaction.editReply({embeds: [embed], files: [attachment]})

}).catch(async err => {
await interaction.editReply('Error' + err)

})

}
};

0 comments on commit 2af9f30

Please sign in to comment.