from pyrogram import Client, types, raw
from settings import *
from _datetime import datetime
app = Client(name=name_uset_admin, api_id=api_id, api_hash=api_hash)
async def main(image, date, button):
async with app:
await app.send_photo(channel, photo=image, caption="Set Total", schedule_date=date, reply_markup=button)
date = datetime(year=2022, month=6, day=17, hour=00, minute=9)
image = "url image"
app.run(main(image, date))
Traceback (most recent call last):
File "D:\Python\Code\test1\telegramBot.py", line 26, in <module>
temp = int(temp)
NameError: name 'temp' is not defined
temp = int(temp)
tempMin = int(tempMin)
tempMax = int(tempMax)
WindSpeed = int(WindSpeed)
if (temp >= 2 and temp <= 4) or (temp >= 22 and temp <= 24) or (temp >= 32 and temp <= 34) or (temp >= 42 and temp <= 44):
textGradus = " градуса"
elif (temp >= 5 and temp <= 20) or (temp >= 25 and temp <= 30) or (temp == 0) or (temp >= 35 and temp <= 40) or (temp >= 45 and temp <= 50):
textGradus = " градусов"
elif temp == 21 or temp == 31 or temp == 41 or temp == 51:
textGradus = " градус"
elif (temp <= -2 and temp >= -4) or (temp <= -22 and temp >= -24) or (temp <= -32 and temp >= -34) or (temp <= -42 and temp >= -44):
textGradus = " градуса"
elif (temp <= -5 and temp >= -20) or (temp <= -25 and temp >= -30) or (temp <= -35 and temp >= -40) or (temp <= -45 and temp >= -50):
textGradus = " градусов"
elif temp == -21 or temp == -31 or temp == -41 or temp == -51:
textGradus = " градус"
if (tempMin >= 2 and tempMin <= 4) or (tempMin >= 22 and tempMin <= 24) or (tempMin >= 32 and tempMin <= 34) or (tempMin >= 42 and tempMin <= 44):
textGradusMin = " градуса"
elif (tempMin >= 5 and tempMin <= 20) or (tempMin >= 25 and tempMin <= 30) or (tempMin == 0) or (tempMin >= 35 and tempMin <= 40) or (tempMin >= 45 and tempMin <= 50):
textGradusMin = " градусов"
elif tempMin == 21 or tempMin == 31 or tempMin == 41 or tempMin == 51:
textGradusMin = " градус"
elif (tempMin <= -2 and tempMin >= -4) or (tempMin <= -22 and tempMin >= -24) or (tempMin <= -32 and tempMin >= -34) or (tempMin <= -42 and tempMin >= -44):
textGradusMin = " градуса"
elif (tempMin <= -5 and tempMin >= -20) or (tempMin <= -25 and tempMin >= -30) or (tempMin <= -35 and tempMin >= -40) or (tempMin <= -45 and tempMin >= -50):
textGradusMin = " градусов"
elif tempMin == -21 or tempMin == -31 or tempMin == -41 or tempMin == -51:
textGradusMin = " градус"
if (tempMax >= 2 and tempMax <= 4) or (tempMax >= 22 and tempMax <= 24) or (tempMax >= 32 and tempMax <= 34) or (tempMax >= 42 and tempMax <= 44):
textGradusMax = " градуса"
elif (tempMax >= 5 and tempMax <= 20) or (tempMax >= 25 and tempMax <= 30) or (tempMax == 0) or (tempMax >= 35 and tempMax <= 40) or (tempMax >= 45 and tempMax <= 50):
textGradusMax = " градусов"
elif tempMax == 21 or tempMax == 31 or tempMax == 41 or tempMax == 51:
textGradusMax = " градус"
elif (tempMax <= -2 and tempMax >= -4) or (tempMax <= -22 and tempMax >= -24) or (tempMax <= -32 and tempMax >= -34) or (tempMax <= -42 and tempMax >= -44):
textGradusMax = " градуса"
elif (tempMax <= -5 and tempMax >= -20) or (tempMax <= -25 and tempMax >= -30) or (tempMax <= -35 and tempMax >= -40) or (tempMax <= -45 and tempMax >= -50):
textGradusMax = " градусов"
elif tempMax == -21 or tempMax == -31 or tempMax == -41 or tempMax == -51:
textGradusMax = " градус"
У telethon есть точно такой же атрибут schedule_date в методе send_message.
https://docs.telethon.dev/en/stable/modules/client...