I want to start a new chat in Telegram with a Python script but I know with neither Telegram's BOT nor its API it is possibile.
I don't want the user starts the chat with a BOT before!
However I was wandering if you can achieve this in anther way. I mean, when you create a new chat with Telegram application, there will be, somehow, and endpoint which handle this request.
Why is it impossibile to create a Python script which emulates this action?
I don't want the user starts the chat with a BOT before!
This is not possible. A Bot can never start a chat, that has to be done by the user him/her self.
After the user has started a conversation with the Bot, you can send anything to the user until the user stops the conversation.
Related
I am making a telegram bot. It needs to interact with each user separately. I know telegraf.js have an isolated env for each user that starts the bot. But how to do such a thing on python?
My setup is as follows: I have Dialogflow bot added as an app. The bot interacts with Slack and Dialogflow. The script uses dialogflow_fulfillment to handles the requests to return the response back to Dialogflow. At the same time, I want the bot to interact with the users like questionaries or buttons without routing back to Dialogflow. I can get it to post messages to any specified channel using client.chat_postMessage(). However I want to the bot to reply directly to the user when the user DM the app. I am not sure how this can be achieved. Please advise.
It turns out that using one app to monitor another app is not allowed by Slack. So this was not possible. The only possible way is to merge it to one app and use event api on it.
Hi everyone i want to create a new telegram bot similar to #usinifobot.
this is how it works:
you just send someone username to this bot and it will give you back his/her chat id.
i want to do same thing but i dont khow how to do it with python-telegram-bot.
python-telegram-bot can't help with this, because telegram bot api can't provide ids of unrelated entities to the bot - only ones with which bot iteracts
you need telegram client api for this and to hold a real account (not a bot) online to make checks by another library
and with bot library like python-telegram-bot you could only get ids of users who write to bot, channels and groups bot is in and reposted messages from other users
I created similar bot #username_to_id_bot for getting ids of any entity and faced all these moments
I'm starting to learn telegram bot. My plan was to have a bot that daily sends you at a specific time a message, but also I wanted the option to manually poll the bot for getting that daily message, or a random one. Right now I have a bot running on pythonanywhere that can respond to the 2 commands, but what about sending the user the daily message at some time?
What's the way to go, create a channel and then schedule a task on my webhook to daily send the message to the channel, or store all chat-id in my service and talk to them everytime? The first one seems obviously better but I was wondering if there's some trick to make everything works in the bot.
For now I managed to create a channel, make the bot an admin and scheduled a task on the webhook to daily send a message as admin to the channel
I use xmpppy library for creating my bot. I run the bot and it works correctly, but when I enter to MirandaIM with other user account(not bot account) for testing it I see that its status is offline. Although I can send and receive messages. How can I send to all bot's 'friends' that it is online?
To manage presence with your bot you need to:
Make sure the roster is properly defined. For example, you bot contact and your user should be each other in their respective contact list.
Once it is done, send a presence packet when you login and you should see the presence properly broadcasted.
Reference document is: http://xmpp.org/rfcs/rfc3921.html#int