# █████████████████████████████████████████ # █────██────█────█────█───█────█────█────█ # █─██──█─██─█─██─█─██─██─██─██─█─██─█─██─█ # █─██──█─██─█────█─██─██─██─██─█────█─██─█ # █─██──█─██─█─█─██─██─██─██─██─█─█─██─██─█ # █────██────█─█─██────██─██────█─█─██────█ # █████████████████████████████████████████ # # # Copyright 2022 t.me/Dorotoro # https://www.gnu.org/licenses/agpl-3.0.html # # meta banner: https://raw.githubusercontent.com/dorotorothequickend/DorotoroModules/main/banners/DorotoroAutoEdit.png # meta developer: @DorotoroMods from .. import utils, loader import asyncio @loader.tds class AutoEdit(loader.Module): """Редактирует каждое ваше сообщение в определенное время на выбранный вами текст.\n Настройка через .config AutoEdit""" strings = { "name": "AutoEdit", "timechoice": "Время, за которое будет редактироваться сообщение.(в секундах)", "editmsg": "Текст, на который будет редактироваться ваше сообщение." } @loader.watcher(out=True) async def watcher(self, message): if self.get("autoedit"): if message.text == 'AutoEdit on.' :return if message.text == '@DorotoroMods' :return if message.text == '@AstroModules' :return await asyncio.sleep(self.config['timechoice']) await message.edit(self.config['editmsg']) async def client_ready(self, client, db): self._db = db self._me = await client.get_me() def __init__(self): self.config = loader.ModuleConfig( loader.ConfigValue("timechoice", "10", doc=lambda: self.strings("timechoice")), loader.ConfigValue("editmsg", "========\nЗасекречено", doc=lambda: self.strings("editmsg")) ) @loader.command() async def autoedit(self, message): "- включить/выключить AutoEdit." if self.get('autoedit') == True: self.set('autoedit', False) await utils.answer(message, "AutoEdit off.") return elif self.get('autoedit') == False or self.get('autoedit') is None: self.set('autoedit', True) await utils.answer(message, "AutoEdit on.")