# * _ __ __ _ _ # * / \ _ _ _ __ ___ _ __ __ _| \/ | ___ __| |_ _| | ___ ___ # * / _ \| | | | '__/ _ \| '__/ _` | |\/| |/ _ \ / _` | | | | |/ _ \/ __| # * / ___ \ |_| | | | (_) | | | (_| | | | | (_) | (_| | |_| | | __/\__ \ # * /_/ \_\__,_|_| \___/|_| \__,_|_| |_|\___/ \__,_|\__,_|_|\___||___/ # * # * © 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: AuroraBull # Author: Felix? # Commands: # .abull | .abullspam | .abulloff # scope: hikka_only # meta developer: @AuroraModules # meta pic: https://i.postimg.cc/Hx3Zm8rB/logo.png # meta banner: https://te.legra.ph/file/7612b5506856c1eb34c56.jpg __version__ = (1, 1, 0) import json import aiohttp import asyncio from random import choice from .. import loader, utils from telethon.tl.types import Message # type: ignore @loader.tds class AuroraBullMod(loader.Module): """Module for insults, make the interlocutor depressed.""" strings = { "name": "AuroraBull", "error_key": "Error: Key 'BullText' not found.", "error_decoding": "Error: The JSON could not be decoded.", "error_uploading_data": "Error loading data", "error_valid_args": "Please enter valid arguments!", "launched": "AuroraBull launched!\n\nUse {prefix}abulloff to stop the attack.", "stopped": "AuroraBull has stopped.", } strings_ru = { "error_key": "Error: ключ 'BullText' не найден.", "error_decoding": "Error: не удалось декодировать JSON.", "error_uploading_data": "Ошибка при загрузке данных", "error_valid_args": "Введите корректные аргументы!", "launched": "AuroraBull запущен!\n\nИспользуйте {prefix}abulloff, чтобы остановить атаку.", "stopped": "AuroraBull остановлен.", } strings_uz = { "error_key": "Error: 'BullText' калити топилмади.", "error_decoding": "Error: JSON декодлаш муваффақиятли амалга ошмади.", "error_uploading_data": "Маълумотлар юклаб олинмади", "error_valid_args": "Iltimos, to'g'ri dalillarni kiriting!", "launched": "AuroraBull ishga tushirildi!\n\nHujumni toʻxtatish uchun {prefix}abulloff dan foydalaning.", "stopped": "AuroraBull to'xtadi.", } strings_de = { "error_key": "Error: Der Schlüssel 'BullText' wurde nicht gefunden.", "error_decoding": "Error: JSON konnte nicht decodiert werden.", "error_uploading_data": "Fehler beim Hochladen der Daten", "error_valid_args": "Bitte geben Sie gültige Argumente ein!", "launched": "AuroraBull gestartet!\n\nVerwenden Sie {prefix}abulloff, um den Angriff zu stoppen.", "stopped": "AuroraBull hat angehalten.", } strings_es = { "error_key": "Error: No se encontró la clave 'BullText'.", "error_decoding": "Error: No se pudo decodificar JSON.", "error_uploading_data": "Error al cargar los datos", "error_valid_args": "¡Por favor ingrese argumentos válidos!", "launched": "¡AuroraBull lanzado!\n\nUtiliza {prefix}abulloff para detener el ataque.", "stopped": "AuroraBull se ha detenido.", } @loader.command( ru_doc="Оскорбите вашего собеседника.", uz_doc="Suhbatdoshingizni insult qiling.", de_doc="Beleidigen Sie Ihren Gesprächspartner.", es_doc="Insulta a tu interlocutor.", ) async def abull(self, message): """Insult your interlocutor""" url = "https://raw.githubusercontent.com/KorenbZla/HikkaModules/main/AuroraBull.json" async with aiohttp.ClientSession() as session: async with session.get(url) as response: if response.status == 200: response = await response.text() try: data = json.loads(response) if "BullText" in data and isinstance(data["BullText"], list) and data["BullText"]: text = choice(data["BullText"]) await utils.answer(message, text) else: await utils.answer(message, self.strings("error_key")) except json.JSONDecodeError: await utils.answer(message, self.strings("error_decoding")) else: await utils.answer(message, f"{self.strings('error_uploading_data')}: {response.status}") @loader.command( ru_doc="[time] [text] - Заспамте оскорблениями вашего собеседника", uz_doc="[time] [text] - Suhbatdoshingizni haqorat bilan spam qiling", de_doc="[time] [text] - Spammen Sie Ihren Gesprächspartner mit Beleidigungen zu", es_doc="[time] [text] - Spamea a tu interlocutor con insultos", ) async def abullspam(self, message: Message): """[time] [text] - Spam your interlocutor with insults""" url = "https://raw.githubusercontent.com/KorenbZla/HikkaModules/main/AuroraBull.json" args = utils.get_args(message) if not args: await utils.answer(message, self.strings("error_valid_args")) return else: self.db.set(self.strings["AuroraBull"], "state", True) try: time = float(args[0]) text = ' '.join(args[1:]) + " " if len(args) > 1 else "" except ValueError: await utils.answer(message, self.strings("error_valid_args")) return await utils.answer(message, self.strings("launched").format(prefix=self.get_prefix())) async with aiohttp.ClientSession() as session: async with session.get(url) as response: if response.status == 200: response = await response.text() data = json.loads(response) if "BullText" in data and isinstance(data["BullText"], list) and data["BullText"]: while self.db.get(self.strings["AuroraBull"], "state"): bull_text = choice(data["BullText"]) await message.respond(text + bull_text) await asyncio.sleep(time) return else: return await utils.answer(message, self.strings("error_key")) else: return await utils.answer(message, f"{self.strings('error_uploading_data')}: {response.status}") @loader.command( ru_doc="Остановить оскорбления", uz_doc="Haqoratlarni to'xtating", de_doc="Hört auf mit den Beleidigungen", es_doc="basta de insultos", ) async def abulloff(self, message: Message): """Stop the insults""" self.db.set(self.strings["AuroraBull"], "state", False) await utils.answer(message, self.strings("stopped")) return