Commited backup

This commit is contained in:
2025-07-10 21:02:34 +03:00
parent 952c1001e3
commit da0b80823e
1310 changed files with 254133 additions and 41 deletions

View File

@@ -0,0 +1,51 @@
# █████████████████████████████████████████
# █────██────█────█────█───█────█────█────█
# █─██──█─██─█─██─█─██─██─██─██─█─██─█─██─█
# █─██──█─██─█────█─██─██─██─██─█────█─██─█
# █─██──█─██─█─█─██─██─██─██─██─█─█─██─██─█
# █────██────█─█─██────██─██────█─█─██────█
# █████████████████████████████████████████
#
#
# Copyright 2022 t.me/Dorotoro
# https://www.gnu.org/licenses/agpl-3.0.html
# meta banner: https://raw.githubusercontent.com/dorotorothequickend/DorotoroModules/main/banners/DorotoroFoodRecipe.png
# meta developer: @DorotoroMods
from .. import loader, utils
from ..utils import answer
from telethon.tl.types import Message
@loader.tds
class FoodRecipe(loader.Module):
"""Ищет рецепт блюда по его названию."""
strings = {'name': 'FoodRecipe'}
@loader.command() # используем декоратор команды
async def foodrecipecmd(self, message: Message):
"<название блюда> - найти рецепт блюда."
args = utils.get_args_raw(message)
msg = await answer(message, 'Пожалуйста подождите. Рецепт в поиске...!')
if not args:
await answer(message, "Поедим пустоту вместе! Введи ингридиенты или название блюда, пожалуйста.")
async with self._client.conversation("@cookinghelpbot") as conv:
msgg = await conv.send_message(args)
r = await conv.get_response()
if r.message == "Рецепт не загрузился, либо его нет":
await answer(msg, "🔧 Рецепт не найден.")
return
elif r.message == "Одного из ингридиента нету":
await answer(msg, "🔧 Один из ингредиентов отсутствует. ")
return
else:
await r.click(data="cook")
k = await conv.get_response()
await msgg.delete()
await r.delete()
await k.delete()
ingridienti = r.text[15:]
retept = k.text
text = f"<b>Рецепт найден!\n\n{ingridienti}\n\nРецепт:\n{retept}</b>"
await answer(msg, text)