Hi Friends,
We can easily create a poll in a telegram group manually as well as using the REST API exposed by telegram. We use REST API to send poll in a group via bot.
The poll can be anonymous or you can also make it non-anonymous.
The good feature in Telegram is that we can also create question as a quiz for educational purpose.
In Below steps we will have a look on creation of Poll as well as a quiz.
Creating a Poll in a chat group Using Manual and REST API:
Manual:
Step 1: Go in the Chat Group where you want to create the poll and on the right hand side from the top corner select Create Poll. You will get below screen.
Step 2: Type your question and provide the options. Select Anonymous in case you don't want to know answers of each person.
Step 3: Now your poll has been created successfully.
Step 4: Below is the screen shot which is providing you the details of responses.
USING TELEGRAM REST API to send poll from a bot:
We can send message in a chat group by using the bot as as well. If we are using this approach then bot should be part of the chat group.
Steps to cerate chat group and bot: we already discussed in blog:
https://telegrambotinfo.blogspot.com/2020/04/
if you have already added bot in chat group and want to create poll from bot then see below method.
You need to send poll message in query string with bot id and chat id, see below format:
https://api.telegram.org/bot<your bot id>/sendPoll?chat_id=<chat id>&question=Which one is the best car company in your opinion?&options=[ "Ford", "BMW", "Fiat" ]
example:
https://api.telegram.org/bot1142780089:AAHjsyi3S9Dt_koUNgoYV5OUDJt-gkdMpIk/sendPoll?chat_id=-477548973&question=Which one is the best car company in your opinion?&options=[ "Ford", "BMW", "Fiat" ]
To check all possible query params of REST API check below official Telegram link:
https://core.telegram.org/bots/api#payments
Creating a Quiz in a chat group:
It's very good option for educational purpose. You will get to know about it from below example. Steps are same as above, Below screen shots will give you clarity.
Thank you.
In case of any question. Please write it in comments.
No comments:
Post a Comment