I created a bot
#WeatherPlusbot
How do I know how many people use it?
Is there a way or "place" where you can count how many people have "installed" or currently use my bot?
Thank you.
Unfortunately telegram doesn't provide such info. You should log the ID of any user, using your bot.
A simple solution could be to create a database with the user ID primary key, the registration timestamp and the last usage timestamp.
I use this kind of way so you have more rich statistics knowing the total users, the active users in the last day, week, how many users are registering lately etc
You can't get this data from API at this time, you can log /start event to your own database, and count unique user send this command.
Related
I created a telegram bot with Nodejs and node-telegram-bot-api package and Mongodb for the database. Now, I want to add multiple languages in the bot and I want to keep the user language selected, and back data with his language.
I know I can save user language on a field in Mongodb. but I wanna know if there is any best way to keep that for the best performance. because there are many responses to users, I must check the language users every second with this method.
I’m planning on abuilding a nextjs app and connecting it to a DB. I’d like users to login to their profiles where a summary of their calendly charged sessions through stripe is visible in a table format.
What would be the best way to get this done? I know both stripe and calendly have their own APIs to pull the data in but how can I connect them to save records in DB for a user with a unique email and ID?
Your question is too general. I think this is due to a lack of information about Stripe's features. To narrow down the problem, I'd recommend to start from Usage-based pricing. This will allow you to understand what data structure you will have in Stripe and what part of it you want to store in your database. So, in general you should pass session time from Calendly to Stripe. I don't know how it is in Calendly, but for Stripe, an email is not a unique identifier. Thus, ensuring uniqueness is up to you.
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 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.