telegram-bot

I'm writing a telegram bot with python

被刻印的时光 ゝ 提交于 2021-01-05 12:24:30
问题 I want to write a telegram bot via Python, but it doesn't work. import telebot bot = telebot.TeleBot("my_token") @bot.message_handler(content_types=['text']) def sending(message): bot.send_message(message.chat.id, message.text) # RUN bot.polling(non_stop=True) Returns to me the following problem. AttributeError: 'TeleBot' object has no attribute 'message_handler' 回答1: This is a common issue, unfortunately. I guess you installed the lib as "pip install telebot", which leads to another package.

Python Telegram Bot how to wait for user answer to a question And Return It

强颜欢笑 提交于 2021-01-03 06:24:28
问题 Context: I am using PyTelegramBotAPi or Python Telegram Bot I have a code I am running when a user starts the conversation. When the user starts the conversation I need to send him the first picture and a question if He saw something in the picture, the function needs to wait for the user input and return whether he saw it or not. After that, I will need to keep sending the picture in a loop and wait for the answer and run a bisection algorithm on it. What I have tried so far: I tried to use

Python Telegram Bot how to wait for user answer to a question And Return It

我怕爱的太早我们不能终老 提交于 2021-01-03 06:24:12
问题 Context: I am using PyTelegramBotAPi or Python Telegram Bot I have a code I am running when a user starts the conversation. When the user starts the conversation I need to send him the first picture and a question if He saw something in the picture, the function needs to wait for the user input and return whether he saw it or not. After that, I will need to keep sending the picture in a loop and wait for the answer and run a bisection algorithm on it. What I have tried so far: I tried to use

Python Telegram Bot how to wait for user answer to a question And Return It

╄→гoц情女王★ 提交于 2021-01-03 06:23:23
问题 Context: I am using PyTelegramBotAPi or Python Telegram Bot I have a code I am running when a user starts the conversation. When the user starts the conversation I need to send him the first picture and a question if He saw something in the picture, the function needs to wait for the user input and return whether he saw it or not. After that, I will need to keep sending the picture in a loop and wait for the answer and run a bisection algorithm on it. What I have tried so far: I tried to use

How to migrate ConversationHandler module from Python-Telegram-Bot to Telethon

流过昼夜 提交于 2021-01-01 04:23:32
问题 Python-telegram-bot which is HTTP Telegram Bot API wrapper has telegram.ext.ConversationHandler module and its functionality is: "A handler to hold a conversation with a single user by managing four collections of other handlers." I'm migrating from this python-telegram-bot to Telethon MTProto API . And I have this ConversationHandler to manage conversation. How can I create any type of ConversationHandler in Telethon . Here is some little overview given by Telethon to migrate from python

How to migrate ConversationHandler module from Python-Telegram-Bot to Telethon

六月ゝ 毕业季﹏ 提交于 2021-01-01 04:23:31
问题 Python-telegram-bot which is HTTP Telegram Bot API wrapper has telegram.ext.ConversationHandler module and its functionality is: "A handler to hold a conversation with a single user by managing four collections of other handlers." I'm migrating from this python-telegram-bot to Telethon MTProto API . And I have this ConversationHandler to manage conversation. How can I create any type of ConversationHandler in Telethon . Here is some little overview given by Telethon to migrate from python

How to send a hyperlink in bot.sendMessage()

落爺英雄遲暮 提交于 2020-12-07 06:30:53
问题 My bot sends out links. so I wanted to include a hyperlink like the one you can do with HTML for example -a href="google.com" Google /a shows up a click able text called "Google" how can I do this in bot.sendMessage() ? and also if you have any idea of sending bold font messages too.. 回答1: You can use formatting option to do this. 来源: https://stackoverflow.com/questions/45268368/how-to-send-a-hyperlink-in-bot-sendmessage

How to send a hyperlink in bot.sendMessage()

一世执手 提交于 2020-12-07 06:30:10
问题 My bot sends out links. so I wanted to include a hyperlink like the one you can do with HTML for example -a href="google.com" Google /a shows up a click able text called "Google" how can I do this in bot.sendMessage() ? and also if you have any idea of sending bold font messages too.. 回答1: You can use formatting option to do this. 来源: https://stackoverflow.com/questions/45268368/how-to-send-a-hyperlink-in-bot-sendmessage