Files
limoka/MuRuLOSE/HikkaModulesRepo/timer.py
2025-07-10 21:02:34 +03:00

39 lines
1.8 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from hikkatl.types import Message
from .. import loader, utils
import asyncio
"""
███ ███ ██ ██ ██████ ██ ██ ██ ██████ ███████ ███████
████ ████ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
██ ████ ██ ██ ██ ██████ ██ ██ ██ ██ ██ ███████ █████
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
██ ██ ██████ ██ ██ ██████ ███████ ██████ ███████ ███████
Timer
📜 Licensed under the GNU AGPLv3
"""
# meta desc: desc
# meta developer: @BruhHikkaModules
@loader.tds
class timer(loader.Module):
"""Модуль который запускает таймер до события"""
strings = {"name": "timer"}
@loader.command()
async def start_timer(self, message: Message):
"""[Таймер на секунды] [Текст напоминания] - Запустить таймер (Сообщения будет отправляться инлайн ботом с вашим упоминанием)"""
args = utils.get_args_raw(message)
msg = " ".join(args.split()[1:])
time = int(args.split(" ", 2)[0])
await utils.answer(message, "Таймер поставлен")
await asyncio.sleep(time)
for _ in range(10):
me = await self.client.get_me()
await self.inline.bot.send_message(self.tg_id, f"@{me.username} {msg}")