#private interaction

1 messages · Page 1 of 1 (latest)

shut ether
#

I've seen bots that reply to commands and the replies are only visible to you (like little error messages for example). I would like to reply to an interaction with the same behaviour. RN I'm doing:

await sendInteractionResponse(
    bot, interaction.id, interaction.token, {
        type: InteractionResponseTypes.ChannelMessageWithSource,
        data: response
    }
);

What do I need to change?

chilly sierra
#

there is a flags prop somewhere

#

set that to 64

#

probably in the data variable irc

shut ether
#

Ill take a look at the docs

chilly sierra
#
await sendInteractionResponse(
    bot, interaction.id, interaction.token, {
        type: InteractionResponseTypes.ChannelMessageWithSource,
        data: response,
        flags: 64, // either here or in data, I do not remember
    }
);
shut ether
#

it's data.flags but hardcoding 64 is not the best, maybe you should make an export const somewhere for the next version

chilly sierra
finite aspen
#

Just make a function somewhere

async function sendPrivateReply(interaction, data) {}

#

Then put 64 once here

#

And use this function when u need it

shut ether
#

@chilly sierra are these messages only possible when replying to an interaction or does it work for normal messages as well?

chilly sierra
#

Including stuff like buttons

shut ether
#

I mean ephimeral

chilly sierra
#

yeah I get it

#

you can only reply with it to interaction.
But the interaction can come from a button which is on a normal message

shut ether
#

I wanted to make welcome messages ephimeral

chilly sierra
#

not possible afaik