Answer the question
In order to leave comments, you need to log in
How to make only one request to pyTelegramBotAPI?
token='token'
bot=telebot.TeleBot(token)
@bot.message_handler(commands=['refresh'])
def ref_teleg(message):
bot.send_message(chat.id, 'text')
bot.polling()
Answer the question
In order to leave comments, you need to log in
You can, send the one request you want, don't call polling.
If you want to get updates, there is a getUpdates method
It works like this for me (I don't know how correct this implementation is):
async def send_message(message):
await bot.send_message(chat_id, text=message)
loop = asyncio.get_event_loop()
loop.run_until_complete(send_message(message))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question