I am new to telegram inline bot. I have no clue how I can retrieve the callback function of telegram’s inlinekeyboardbuttons. Would be forever greatful if someone can explain this to me how I could retrieve user response. Answer You have to use CallbackQueryHandler to assing function to data If you use pattern .* then it will get all data
Tag: telegram
Make telebot mute new user for 24 hours
I have this code It listens for new users, and it has mute command, but how can i get their ID with TeleBot? Answer
Python Telegram Bot: button data invalid
I am trying to make a super simple telegram bot using PTB. The bot has a button, when I click the button bot should make an http request to the web (without opening browser). And show the response data. Here is the piece of code I am using: it works for hard coded values and under 50 characters text however
How to pass data in object_ptr format in python-telegram library
In python-telegram lib; I have a problem with calling methods which require data in object_ptr data type (You can read about it in tdlib documentation) Exactly my problem is in addContact method. How should I pass data in params ? I act like this: The print result is None & no contact is added. Where is the problem? This links
How to delete queue updates in telegram api?
I’m trying to delete messages from /getUpdates in telegram API but I didn’t know how.. I tried to use /deleteMessage But it didn’t delete message from API database.. Answer TL;DR: Call getUpdates() with the offset parameter set to the last message’s id, incremented by 1 We’ll need to let Telegram know which message’s we’ve processed. To do this, set the
When starting client the code is asking for phone/bot token
While running my first code using Telethon library, it is asking for a bot token. This is the actual code: And on command prompt: Result: Please enter your phone (or bot token) If I give my API ID, it eventually throws the error: telethon.errors.rpcerrorlist.PhoneNumberInvalidError: The phone number is invalid (caused by SendCodeRequest) Why? I expect the client to start without