const { CommandInteraction, MessageEmbed } = require("discord.js"); { let amount = await interaction.options.getString('amount'); await con.query(`SELECT * FROM perms WHERE guildid="${interaction.guild.id}" AND permtype="tickets" OR guildid="${interaction.guild.id}" AND permtype="admin"`, async (err, row) => { if(err) throw err; if(!row[0]) return interaction.reply({ content: `There are no permissions setup for this guild yet!`, ephemeral: true }).catch(e => {}); let granted = 0; let deEmbeds = []; await row.forEach(async (r) => { if(interaction.member.roles.cache.has(r.roleid)) { granted = 1; } }); if(granted == 0) return interaction.reply({ content: `You do not have the required permissions to use this command!`, ephemeral: true }).catch(e => {}); if(data.paypal != 'NA') { let paypalEmbed = new client.discord.MessageEmbed() .setColor(`#427ef5`) .setTitle(`PayPal Payment`) .setThumbnail(`https://img.icons8.com/color/452/paypal.png`) .setDescription(`**PayPal: ||${data.paypal}||**\nNotify us if you have chosen this option.`) deEmbeds.push(paypalEmbed) }; if(data.cashapp != 'NA') { let cashappEmbed = new client.discord.MessageEmbed() .setColor(`#0be000`) .setTitle(`Cash App Payment`) .setThumbnail(`https://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/Square_Cash_app_logo.svg/1200px-Square_Cash_app_logo.svg.png`) .setDescription(`**CashApp: ||${data.cashapp}||**\nNotify us if you have chosen this option.`) deEmbeds.push(cashappEmbed) }; if(data.custompay != 'NA') { let customEmbed = new client.discord.MessageEmbed() .setColor(`#0f0f0f`) .setTitle(`Other Option`) .setDescription(`**Payment: ||${data.custom}||**\nNotify us if you have chosen this option.`) deEmbeds.push(customEmbed) }; let embed = new client.discord.MessageEmbed() .setAuthor({ name: interaction.user.tag, iconURL: interaction.user.displayAvatarURL({ dynamic: true }) }) .setColor(data.themecolor) .setDescription(`**Please pay \`${amount}\` to __one__ of the above payment methods.**`) deEmbeds.push(embed); setTimeout(async () => { await interaction.reply({ embeds: deEmbeds, ephemeral: false }).catch(e => { if(client.config.debugmode) console.log(e) }); }, 100) }); }; exports.info = { name: "pay", description: "Ask a user to agree to your terms of service.", options: [ { name: 'amount', description: 'Please provide the amount and the currency the user should pay.', required: true, type: 'STRING' } ] };