# * _ __ __ _ _ # * / \ _ _ _ __ ___ _ __ __ _| \/ | ___ __| |_ _| | ___ ___ # * / _ \| | | | '__/ _ \| '__/ _` | |\/| |/ _ \ / _` | | | | |/ _ \/ __| # * / ___ \ |_| | | | (_) | | | (_| | | | | (_) | (_| | |_| | | __/\__ \ # * /_/ \_\__,_|_| \___/|_| \__,_|_| |_|\___/ \__,_|\__,_|_|\___||___/ # * # * © Copyright 2024 # * # * https://t.me/AuroraModules # * # * 🔒 Code is licensed under GNU AGPLv3 # * 🌐 https://www.gnu.org/licenses/agpl-3.0.html # * ⛔️ You CANNOT edit this file without direct permission from the author. # * ⛔️ You CANNOT distribute this file if you have modified it without the direct permission of the author. # Name: AuroraSpam # Author: Felix? # Commands: # .aspam # scope: hikka_only # meta developer: @AuroraModules # meta pic: https://i.postimg.cc/Hx3Zm8rB/logo.png # meta banner: https://te.legra.ph/file/e5b219dd459e4cf8b0b11.jpg __version__ = (1, 1, 6) import asyncio from .. import loader, utils from telethon.tl.types import Message # type: ignore @loader.tds class AuroraSpamMod(loader.Module): """Module for mailings message""" strings = { "name": "AuroraSpam", "successfully_spam": "✔️ The newsletter has been successfully completed, all messages have been delivered.", "error_cfg_group_id": "Error! The config value was entered incorrectly or it does not exist.", "cfg_group_id": "Enter the group identifier in the format СhatId , СhatId", "cfg_custom_text": "Enter a custom text for the mailing", "cfg_photo_url": "Enter a link to send media with text.", } strings_ru = { "successfully_spam": "✔️ Рассылка успешно завершена, все сообщения были доставлены.", "error_cfg_group_id": "Error! Неправильно введено значение конфига или его не существует.", "cfg_group_id": "Введите индификатор группы в формате СhatID , ChatID", "cfg_custom_text": "Введите кастомный текст для рассылки", "cfg_photo_url": "Введите ссылку для отправки медиа с текстом.", } strings_uz = { "successfully_spam": "✔️ Yuborish muvaffaqiyatli yakunlandi, barcha xabarlarni yetkazib berildi.", "error_cfg_group_id": "Error! Konfiguratsiya qiymati noto'g'ri yoki mavjud emas.", "cfg_group_id": "Guruh identifikatorini ChatID, ChatID formatida kiriting", "cfg_custom_text": "Yuborish uchun maxsus matnni kiriting", "cfg_photo_url": "Matnli media yuborish uchun havolani kiriting.", } strings_de = { "successfully_spam": "✔️ Die Verteilung wurde erfolgreich abgeschlossen, alle Nachrichten wurden zugestellt.", "error_cfg_group_id": "Error! Falscher oder nicht vorhandener Konfigurationswert.", "cfg_group_id": "Geben Sie die Gruppenkennung im Format ChatID, ChatID ein", "cfg_custom_text": "Geben Sie den benutzerdefinierten Text für die Verteilung ein", "cfg_photo_url": "Geben Sie einen Link ein, um Medien mit Text zu senden.", } strings_es = { "successfully_spam": "✔️ La distribución se ha completado con éxito, todos los mensajes han sido entregados.", "error_cfg_group_id": "Error! Valor de configuración incorrecto o inexistente", "cfg_group_id": "Ingrese el identificador del grupo en formato ChatID, ChatID", "cfg_custom_text": "Ingrese el texto personalizado para la distribución", "cfg_photo_url": "Enter the ", } def __init__(self): self.config = loader.ModuleConfig( loader.ConfigValue( "group_id", None, lambda: self.strings["cfg_group_id"], validator=loader.validators.Series( validator=loader.validators.Union( loader.validators.TelegramID(), loader.validators.RegExp("[0-9]"), ), ), ), loader.ConfigValue( "custom_text", "The module was created by @AuroraModules", lambda: self.strings["cfg_custom_text"], ), loader.ConfigValue( "photo_url", None, lambda: self.strings("cfg_photo_url"), validator=loader.validators.Link(), ), ) @loader.command( ru_doc="Начать рассылку сообщений.", uz_doc="Xabarlarni yuborishni boshlang.", de_doc="Starten Sie den Versand von Nachrichten.", es_doc="Empezar a enviar mensajes.", ) async def aspam(self, message: Message): """Start sending messages.""" ccid = self.config["group_id"] text = self.config["custom_text"] photo = self.config["photo_url"] sp = self.strings["successfully_spam"] if ccid is None or ccid == []: await utils.answer(message, self.strings["error_cfg_group_id"]) return for i in ccid: if self.config["photo_url"] == None: await self.client.send_message(i, text) else: await self.client.send_file( i, photo, caption=text, ) await utils.answer(message, sp) await asyncio.sleep(6) await message.delete()