Button UserID push through
So I have a Event where the Bot sends a Welcome-Message with a Button to Welcome the User, similar to the Discord in-build function so to get like the name into the InteractionCreate Event I need to push it through with the button ID I guess. But how can I Filter the button Interaction then bc I have multiple and normally you would filter it with the interaction.customid but here I can't I guess so how do I filter it?
23 Replies
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
I got discord.js v13.12.0 and node 18
which name do you want to get?
so from the user that just joined
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
interaction.user.username exists
jep
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Jep, I know so I push it trough with the Button custom ID
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
I don't need the Info from the interaction.user I wanna have the user ID of the Person just joined
I send the code rl quick
and isnt that person the one that pushes the button?
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
whatever, in any case interaction.customId is a string
nothing stops you to do
.setCustomId("real custom id" + "_" + userId)
and split the string by _
Nononono the Person who pushes the button can like welcome the person who joined
wait a sec
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
This is the Code and I'm trying to filter the interaction
my answer still applies
Bro no
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
nothing stops you to doSo.setCustomId("real custom id" + "_" + userId)
and split the string by_
interaction.customId.split("_")
will be an array with the first element being the real customId and the second element being the userIdyou got this button like discord has it y'all know how it works and I'm trying to make it with my Bot
Ahh thanks this could work I'm so dumb thanks