python-telegram-bot

How to use Jobqueue in Python-telegram-bot

邮差的信 提交于 2020-08-26 00:32:13
问题 I have able to make a bot very easily by reading the docs but Jobqueue is not working as per it is written. The run_daily method uses a datetime.time object to send the message at a particular time but this code neither does its job of sending a message nor shows any errors. It just keeps running import datetime from telegram import bot from telegram.ext import Updater def callback_minute(bot, job): bot.send_message(chat_id=475838704, text='PlEaSe wOrK!') def main(): updater = Updater() bot =

How to use Jobqueue in Python-telegram-bot

时光怂恿深爱的人放手 提交于 2020-08-26 00:30:52
问题 I have able to make a bot very easily by reading the docs but Jobqueue is not working as per it is written. The run_daily method uses a datetime.time object to send the message at a particular time but this code neither does its job of sending a message nor shows any errors. It just keeps running import datetime from telegram import bot from telegram.ext import Updater def callback_minute(bot, job): bot.send_message(chat_id=475838704, text='PlEaSe wOrK!') def main(): updater = Updater() bot =

(python) Telegram bot- how to send messages periodically?

北城余情 提交于 2020-07-06 12:58:47
问题 I have a dilemma regarding my telegram bot. Let's say I have to create a function that will ask, every user connected to the bot, one time per week/month, a question: def check_the_week(bot, update): reply_keyboard = [['YES', 'NO']] bot.send_message( chat_id=update.message.chat_id, text=report, reply_markup=ReplyKeyboardMarkup(reply_keyboard, one_time_keyboard=True)) # sends the total nr of hours update.reply_text("Did you report all you working hour on freshdesk for this week?",

Telegram bot- how to send messages Daily

纵然是瞬间 提交于 2020-06-28 09:53:36
问题 I am trying to develop a telegram-bot that send a message every day at a specific time. but it's not working for me. I think the problem is in the time parameter. I used another method of this class and they were working well but run_daily is not working. :( import telegram.ext from telegram.ext import Updater from datetime import time updater = Updater('My Token', use_context=True) job = updater.job_queue def callback_minute(context: telegram.ext.CallbackContext): context.bot.send_message