Answer the question
In order to leave comments, you need to log in
Simultaneous sending of messages by timer and manual requests does not work?
import telebot
import random
import misc
from telebot import types
import pyowm
import datetime
token = misc.token
bot = telebot.TeleBot(token)
# Меню
@bot.message_handler(commands=["menu"])
def inline(message):
key = types.InlineKeyboardMarkup(True)
but_1 = types.InlineKeyboardButton(text="123",
url="website")
but_2 = types.InlineKeyboardButton(text="222", callback_data="sendmessage")
key.add(but_1, but_2)
bot.send_message(message.chat.id, "Выберите необходимый раздел", reply_markup=key)
@bot.callback_query_handler(func=lambda c: True)
def inlin(c):
if c.data == "sendmessage":
bot.send_message(c.message.chat.id, "Задавай вопрос ***")
# Меню
### напоминалка
import schedule
import time
import datetime
def job():
bot.send_message(chat_id='-***',
text=" ****♀️♂️")
def size():
mydate = datetime.datetime.today().strftime("%d.%m.%Y %H:%M")
if misc.date1 == mydate:
bot.send_message(chat_id='-****',
text=" !!!! ")
schedule.every(1).minutes.do(size)
schedule.every().day.at("13:14").do(job)
while True:
schedule.run_pending()
time.sleep(1)
### напоминалка
if __name__ == "__main__":
bot.polling(none_stop=True)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question