https://discord.gg/botpress logo
#🤝help
execute nickname telegram chatbot
# 🤝help
e

enough-farmer-72041

12/14/2023, 3:20 PM
Hello guys, is there a way to retrieve the Telegram username of the person chatting with my chatbot using execute.
a

acceptable-kangaroo-64719

12/14/2023, 3:25 PM
Hey @enough-farmer-72041 usually channel info like that is kept in the
event.tags
variable. You can use a code card to log it with
console.log(event.tags)
and then check out the logs to see what is stored there.
> To get the Telegram user ID, you can read the following variable: {{ event.tags.user["telegram:id"] }}.
e

enough-farmer-72041

12/20/2023, 11:15 AM
I explained myself poorly, sorry. I wanted to know how to get the username instead of the ID @acceptable-kangaroo-64719
with this i get the id number
but i want to get this
a

acceptable-kangaroo-64719

12/21/2023, 10:31 AM
that might also be in
event.tags
, have you looked at what all is included in that object?
s

stocky-lunch-87875

01/04/2024, 11:56 PM
Hey @acceptable-kangaroo-64719 ! I have the same problem. Logically it has to be stored in event.tags.user["telegram:username"] but it isn't. I'm trying to store it in workflow.username:
workflow.username = event.tags.user["telegram:username"]
and what returns is just "@"
e

enough-farmer-72041

01/05/2024, 9:07 AM
me return this " "
a

acceptable-kangaroo-64719

01/11/2024, 5:54 PM
Looks like the telegram username is in the payload, not in the event.tags object. Have you tried taking the username from there?
3 Views