My telegram bot database was accidentally deleted after I moved it to a new server.
Is there a way to obtain a list of all the numeric IDs of all users who have started the bot in the past? In reading Telegram's documentation, I did not find any solution (although I've seen someone do it before and I am certain it can be accomplished); I found out from searches that it should probably be accomplished on the client side and using something like getDialogs.
https://core.telegram.org/method/messages.getDialogs
Would anyone be able to assist me with that?
Is there a way to obtain a list of all the numeric IDs of all users who have started the bot in the past?
No, Telegram can't offer a list like that.
If an update is removed from the getUpdates() call, it's gone for good.
I found out from searches that it should probably be accomplished on the client side and using something like getDialogs.
The getDialogs you're looking at is part of the Telegram Core, used to create your own Client. This can't be used as a Bot.
So If you don't have a copy of your own, there won't be a way to tell all the users who have talked with your Bot, unless you ask them yourself ;)
Related
Recently, Telegram released a new feature - Custom Emojis. They instantly became available to users, but there are no instructions on how to send them using a Telegram bot. Is it even possible within the API? And specifically on Telegraf?
This update describes methods that may be useful to you. I haven't tested them myself yet, but I think this is what is needed. I will write about the results as soon as I test it myself.
I'm developing a Telegram Bot via PHP and I want users to answer bot question.
For Example:
Bot: What is your name?
User: (Reply)
But I don't know how to process user reply for specific question from bot.
If I receive user reply via webhook, it doesn't contain last bot message, and I don't know what question this reply is.
Webhook has parameter callback_query, but it works only for messages that contains inline keyboard.
Can you help please?
This process is called conversation. There are various ways to implement this.
The best and common way is to implement a Finite State Machine which will save the current state and accordingly, have a conversation with a user. Famous libraries like python-telegram-bot already implement it, which can give you a general idea on how to do this. Other ways can be storing last message in a database, etc; which is not recommended.
Telegram deleted my account by timing (after half a year without activity), this account had several combat bots. After deleting the account, the bots were not deleted, but now I don’t understand how I can restore access to them. I tried to re-register on a new account. The list of bots is empty.
I wrote to Telegram support, 2 weeks have passed and there is no response from them. I was looking for a similar situation on the Internet but did not find a similar one. Out of despair, I am writing here.
I think that the only way to solve this is to ask support.
Because if you'll create bot with the same name again - you'll lose your users. As you would normally delete and create bot.
So, ping them in all available channels, hope and wait.
I was reading any answer for this question but no one knows if there any code for any language for get telegram member for channel.if any one knows how it work please answer this question.
You need to use Telegram CLI for this purpose.
also your account need to be admin of that channel
I want to create a telegram bot for a home project and i wish the bot only talk to 3 people, how can I do this?
I thought to create a file with the chat id of each of us and check it before responding to any command, I think it will work. the bot will send the correct info if it's one of us and "goodbye" to any other
But is there any other way to block any other conversation with my bot?
Pd: I'm using python-telegram-bot
For the first part of your question you can make a private group and add your bot as one of its administrators. Then it can talk to the members and answer to their commands.
Even if you don't want to do so, it is possible by checking the chatID of each update that the bot receives. If the chatID exists in the file, DataBase or even in a simple array the bot answers the command and if not it just ignores or sends a simple text like what you said good-bye.
Note that bots cannot block people they can only ignore their
messages.