Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Calculadora

0

64
Vistas
Discord.JS For Every Request Reply With a New Code

I am trying to make something work. When they do [!btc] it sends an embed where it shows a address code from blockchain.com

Is it possible for every new request to send a new address code?

My current code:

case "btc":
          const btc = new Discord.MessageEmbed()
            .setColor('#003087')
            .setTitle('Payment Method: Bitcoin! <:btc:878247766067908610>')
            .setDescription("Bitcoin Adress: **code**")
            .setFooter("Created and Developed by ❤️")
          //message.channel.send()
          setTimeout(() => {
            message.channel.send(btc);
          }, 5500);
          message.delete();
          message.channel.send(`<a:loading:885542082234629809> Please wait..`)
            .then((msg) => {
              setTimeout(function () {
                msg.edit(`${message.author.toString()}.`);
              }, 5000)
            });
          break;
7 months ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I think you want a dynamic value, if I understand your question right, for code. If this is the case, this goes in your embed description, and you can change it to take a variable. you have right now:

.setDescription("Bitcoin Adress: **code**")

get your variable, load it with what you want, and call it newCode. Change your string to use variables with text:

.setDescription(`Bitcoin Adress: ***${newCode}***`)

keep the "*" if you want them, I preserved, in case that's the formatting you want. also note the change in quotes from double to `.

7 months ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar empleo Planes Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2023 PeakU Inc. All Rights Reserved.