#followUp

1 messages · Page 1 of 1 (latest)

devout estuary
#

so does followUp() just not work at all?

#

@dusk cosmos

dusk cosmos
#

i guess

#

it doesnt followUp

devout estuary
#

could you send your code for this?

dusk cosmos
#

that doesnt work for all commands

#

every single one

#

idk why

#

it used to work

devout estuary
#

thats rather odd

#

when did this start happening

#

like after an update or just randomly

dusk cosmos
#
const { client, CommandInteraction, MessageEmbed } = require("discord.js");
const db = require('quick.db')

module.exports = {
    name: "ping",
    description: "Returns Latency and API Ping.",
    type: 'CHAT_INPUT',
    timeout: 5000,
    run: async (client, interaction, args) => {
      const Blacklisted = db.fetch(`blacklistedUsers_${interaction.user.id}`)
    if (Blacklisted === true) return;
    
        interaction.followUp({ content: `Calculating ping...` }).then((resultMessage) => {
      const ping = resultMessage.createdTimestamp - interaction.createdTimestamp
      const embed = new MessageEmbed()
        .setTitle("Pong!")
        .setAuthor(`${interaction.user.username}`, interaction.user.displayAvatarURL())
        .setDescription(`![pong](https://cdn.discordapp.com/emojis/872911287586279434.webp?size=128 "pong") Bot Latency is ${ping} ms\n![sandclock](https://cdn.discordapp.com/emojis/872911287628230767.webp?size=128 "sandclock") API Latency is ${Math.round(client.ws.ping)} ms`
        )
        .setFooter(interaction.guild.name)
        .setColor('#2F3136');
      resultMessage.edit({
        content: `\u200B`,
        embeds: [embed]
      })
    })
    },
};
#

for example ping command

#

theres also deprecated setAuthor and SetFooter but it literally doesnt log it in console

devout estuary
#

that is odd

dusk cosmos
#

very

devout estuary
#

could you add a console log inside the .then() handler

#

to check if the thing is even reaching that

dusk cosmos
#

so followUp().then(())

#

?

devout estuary
#

nono

#

in the

#

.then( () => {} )

#

add a console log

dusk cosmos
#

oh

#

it didnt log

#

bruh

#

maybe discord.js got some changes

devout estuary
#

i guess the promise is just not being resolved

#

weird

dusk cosmos
#

related to followUp

devout estuary
#

i dont think this will fix it but

#

can you use async/await syntax

#

like do

#
const resultMessage = await interaction.followUp({ content: 'Calculating ping...' })
console.log("finished")
#

then move the code from the .then to after this line

slender apex
#

@devout estuary @dusk cosmos
you need to provide fetchReply: true in the options

#

<Interaction>.followUp({ content: 'blah blah', fetchReply: true })

#

then it does return the message

devout estuary
#

oh yeah my bad sorry

#

i misread the second part in MessagePayload or InteractionReplyOptions

dusk cosmos
#

.