Is there any way to vote in a telegram poll with a bot? I tried to use telepot and python-telegram-bot. I can get poll id, chat_id, options and all the relevant data, but can not find any way to implement messages.sendVote() method described in telegram api docs.
messages.sendVote is a method from the Telegram API, not the Bot API. All available methods of the Bot API can be found here, which does not include voting in polls.
Related
there is an option to make my telegram bot call my telegram account? Something like bot.make_call(...).
I'm using telebot library on python,
Thanks!
Telegram bots cannot make calls to users. To call a user you need to logged in as a user and not a bot. You can use pyrogram (A telegram client).
Here's a link to my answer where I explain how it's done.
https://stackoverflow.com/a/72335362/11814361
So i would like to make a bot that can access recent action from my supergroup. The flow is pretty simple, i want the bot to scrape all of the information inside of it and save it into database. I made it with python and telegram bot API
The bot is already admin and he can do anything that admin could do.
Is it possible to do that???
No. Bots can only do what's listed in the official API docs at https://core.telegram.org/bots/api. Instead, you can just keep track of what's happening in the chat.
I already use telegram bot APIs but it dosen't have any methods to get number of views.
Can I use telegram Client APIs for this?
with telegram api you cant get post view numbers.
you can use madelineproto library( https://docs.madelineproto.xyz ) for this
Is it possible to send a message from a node.js server to someone's mobile number or telegram Id directly?
is it possible without using a telegram bot?
I need an API like below:
function sendMessage(senderTelegramId, receiverTelegramId, messageText)
In short: No, without a bot no way for now.
Detailed explanation:
In order for you to send users messages on telegram you would need to create your own telegram bot. They have a well documented API which you can read and play around with.
There are 2 things you should know about sending messages to users using telegram bot:
You can't just send random people messages on telegram even if you know their phone number, to send them messages you need to have their chat_id. See how in the docs
To get the chat_id the user must first click the start button that comes up when they open your bot for the first time. Telegram will send you the chat id of that user and you save it for later when you would want to send messages to that user.
There are tons of libraries that makes working telegram bots very easy, it wouldn't take you more than an hour to get started.
I hope this answers the question, feel free to ask further questions, I have made some bots and you can also play around with them to see how it works.
Cheers )
There is actually one more easiest way to send a message to chat
just fetch the URL
https://api.telegram.org/bot[BOT_API_KEY]/sendMessage?chat_id=[MY_CHANNEL_NAME]&text=[MY_MESSAGE_TEXT]
you can find more details here
https://xabaras.medium.com/sending-a-message-to-a-telegram-channel-the-easy-way-eb0a0b32968
I have a room with a couple of bots, one of them needs to read all the messages on the room including other bot's messages.
Telegram API says bots can't see other bots message otherwise they might get caught in a "loop".
Since i really need to work around this i'm wondering if there is a known workaround?
There cannot be any workaround using the Bot APIs since the messages in getUpdates or webhook of the Bot will be from Users alone.
One workaround could be to use the telegram-cli and create a normal user as a Bot.