Skip to content

Commit

Permalink
Update imagine.js
Browse files Browse the repository at this point in the history
String error fixed
  • Loading branch information
sandarutharuneth authored May 8, 2023
1 parent 2b7a097 commit e97475c
Showing 1 changed file with 8 additions and 19 deletions.
27 changes: 8 additions & 19 deletions src/slashCommands/information/imagine.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,53 +16,42 @@ module.exports = {
run: async (client, interaction, args) => {
await interaction.deferReply()
const prompt = interaction.options.getString("prompt")
const Replicate = (await import("replicate")).default
const Replicate = require('replicate')
//const Replicate = (await import("replicate")).default

const replicate = new Replicate({
auth: config.API,
});

const output = await
replicate.run("prompthero/openjourney:9936c2001faa2194a261c01381f90e65261879985476014a0a37a334593a05eb", {
const output = await replicate.run("prompthero/openjourney:9936c2001faa2194a261c01381f90e65261879985476014a0a37a334593a05eb", {
input: {
prompt: prompt
}
})
if (interaction.channel.nsfw === true) {

console.log()

const row = new ActionRowBuilder()
.addComponents(
new ButtonBuilder()
.setLabel(`Download`)
.setStyle(ButtonStyle.Link)
.setURL(output)
.setEmoji('1083007659457912852'),
.setURL(`${output}`),
new ButtonBuilder()
.setLabel(`Support Us`)
.setStyle(ButtonStyle.Link)
.setURL('https://paypal.me/officialrazer')
.setEmoji('1083016028369453199'))
.setURL('https://paypal.me/officialrazer'))

const embed = new EmbedBuilder()
.setTitle("**Your Prompt:**")
.setDescription(`**${prompt}**`)
.setImage(output)
.setImage(`${output}`)
.setColor('#2f3136')
.setFooter({ text: `Requested by: ${interaction.user.username} | ©️ Project Razer `,
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
})

await interaction.editReply({ embeds: [embed], components: [row] })

}else {

const nsfw = new EmbedBuilder()
.setTitle('Warning')
.setDescription('\`\`\`fix\n[ Must be a Age Restricted channel to function ]\n\`\`\`')
.setColor('#2f3136')

await interaction.editReply({ embeds: [nsfw] })
}
}
}

0 comments on commit e97475c

Please sign in to comment.