How to get an user id by replying to his message

(Marcel Alexandru) #1

So, I’ve managed to make a ban bot but it will get my user id to make the ban and not from the user I’m replying to. Can you guys help me making my ban bot complete?

Thanks

(Daniel Beckett) #2

Hi Marcel,

There’s not really a clear way to get a user’s ID from their username using the bot API for Telegram. To have the ID they need to have an open conversation with the bot e.g. by triggering a flow by sending a new message trigger keyword. This would mean that their user_id would then be available in the flow.

(Rotakoi) #3

Flow.xo supports javascript, so is there a way to get the ID of the user you replied to

(Daniel Beckett) #4

Hi @Dishaan_Jain

I don’t believe that JavaScript offers any extra methods for locating a user’s ID. This is all handled by the bot when a flow is triggered and pulled directly from Telegram / whichever platform is being used.