mirror of
https://github.com/MuRuLOSE/limoka.git
synced 2026-06-16 14:34:17 +02:00
Commited backup
This commit is contained in:
254
coddrago/modules/DelMessTools.py
Normal file
254
coddrago/modules/DelMessTools.py
Normal file
@@ -0,0 +1,254 @@
|
||||
# ---------------------------------------------------------------------------------
|
||||
#░█▀▄░▄▀▀▄░█▀▄░█▀▀▄░█▀▀▄░█▀▀▀░▄▀▀▄░░░█▀▄▀█
|
||||
#░█░░░█░░█░█░█░█▄▄▀░█▄▄█░█░▀▄░█░░█░░░█░▀░█
|
||||
#░▀▀▀░░▀▀░░▀▀░░▀░▀▀░▀░░▀░▀▀▀▀░░▀▀░░░░▀░░▒▀
|
||||
# Name: DelMessTools
|
||||
# Description: Module to manage and delete your messages in the current chat
|
||||
# Author: @codrago_m
|
||||
# ---------------------------------------------------------------------------------
|
||||
# 🔒 Licensed under the GNU AGPLv3
|
||||
# 🌐 https://www.gnu.org/licenses/agpl-3.0.html
|
||||
# ---------------------------------------------------------------------------------
|
||||
# Author: @codrago
|
||||
# Commands: nopurge, purgetime, purgelength, purgekeyword, purge
|
||||
# scope: hikka_only
|
||||
# meta developer: @codrago_m
|
||||
# meta banner: https://raw.githubusercontent.com/coddrago/modules/refs/heads/main/banner.png
|
||||
# meta pic: https://envs.sh/HJx.webp
|
||||
# ---------------------------------------------------------------------------------
|
||||
|
||||
__version__ = (1, 1, 0)
|
||||
|
||||
from hikkatl.tl.types import Message, DocumentAttributeFilename
|
||||
|
||||
from .. import loader, utils
|
||||
|
||||
class DelMessTools(loader.Module):
|
||||
"""Module to manage and delete your messages in the current chat"""
|
||||
|
||||
strings = {
|
||||
"name": "DelMessTools",
|
||||
"purge_complete": "All your messages have been deleted.",
|
||||
"purge_reply_complete": "Messages up to the replied message have been deleted.",
|
||||
"purge_keyword_complete": "Messages containing the keyword have been deleted.",
|
||||
"purge_time_complete": "Messages within the specified time range have been deleted.",
|
||||
"purge_media_complete": "All your media messages have been deleted.",
|
||||
"purge_length_complete": "Messages with the specified length have been deleted.",
|
||||
"purge_type_complete": "Messages of the specified type have been deleted.",
|
||||
"enabled": "It's not operational now anyway.",
|
||||
"disabled": "Operation status changed to disabled.",
|
||||
"interrupted": "The deletion was interrupted because you changed your mind.",
|
||||
"none": "You didn't even intend to delete anything here, but anyway it's disabled now."
|
||||
}
|
||||
|
||||
strings_ru = {
|
||||
"purge_complete": "Все ваши сообщения были удалены.",
|
||||
"purge_reply_complete": "Сообщения до указанного ответа были удалены.",
|
||||
"purge_keyword_complete": "Сообщения, содержащие ключевое слово, были удалены.",
|
||||
"purge_time_complete": "Сообщения в указанном временном диапазоне были удалены.",
|
||||
"purge_media_complete": "Все ваши медиа-сообщения были удалены.",
|
||||
"purge_length_complete": "Сообщения указанной длины были удалены.",
|
||||
"purge_type_complete": "Сообщения указанного типа были удалены.",
|
||||
"enabled": "Оно итак сейчас не работает.",
|
||||
"disabled": "Режим работы изменен на выключено.",
|
||||
"interrupted": "Удаление было прервано т.к вы передумали.",
|
||||
"none": "Вы даже не пытались ничего здесь удалить, в любом случае сейчас оно выключено."
|
||||
}
|
||||
|
||||
|
||||
async def purgecmd(self, message: Message):
|
||||
""" [reply] [-img] [-voice] [-file] [-all] - delete all your messages in current chat or only ones up to the message you replied to
|
||||
-all - to delete messages in each topic if this is a forum otherwise the flag'll just be ingored
|
||||
"""
|
||||
reply = await message.get_reply_message()
|
||||
is_last = False
|
||||
args, types_filter, is_each = self.get_types_filter(message)
|
||||
is_forum = (await self.client.get_entity(message.chat.id)).forum
|
||||
|
||||
status = self.db.get(__name__, "status", {})
|
||||
status[message.chat.id] = True
|
||||
self.db.set(__name__, "status", status)
|
||||
|
||||
async for i in self.client.iter_messages(message.peer_id):
|
||||
status = self.db.get(__name__, "status", {})
|
||||
if status.get(message.chat.id, None) is not True:
|
||||
return await utils.answer(message, self.strings["interrupted"])
|
||||
|
||||
if is_forum and not is_each and utils.get_topic(message) != utils.get_topic(i):
|
||||
continue
|
||||
|
||||
if i.from_id == self.tg_id and self.is_valid_type(i, types_filter):
|
||||
if reply:
|
||||
if is_last:
|
||||
break
|
||||
if i.id == reply.id:
|
||||
is_last = True
|
||||
await message.client.delete_messages(message.peer_id, [i.id])
|
||||
|
||||
if reply:
|
||||
await utils.answer(message, self.strings["purge_reply_complete"])
|
||||
else:
|
||||
await utils.answer(message, self.strings["purge_complete"])
|
||||
|
||||
async def purgekeywordcmd(self, message: Message):
|
||||
""" <keyword> [-img] [-voice] [-file] [-all] - delete all your messages containing the specified keyword in the current chat
|
||||
-all - to delete messages in each topic if this is a forum otherwise the flag'll just be ingored
|
||||
"""
|
||||
args = utils.get_args_raw(message)
|
||||
if not args:
|
||||
return await utils.answer(message, "Please specify anything because you didn't.")
|
||||
|
||||
args, types_filter, is_each = self.get_types_filter(message)
|
||||
if not args:
|
||||
return await utils.answer(message, "Please specify a keyword to delete messages.")
|
||||
|
||||
is_forum = (await self.client.get_entity(message.chat.id)).forum
|
||||
|
||||
status = self.db.get(__name__, "status", {})
|
||||
status[message.chat.id] = True
|
||||
self.db.set(__name__, "status", status)
|
||||
|
||||
async for i in self.client.iter_messages(message.peer_id):
|
||||
status = self.db.get(__name__, "status", {})
|
||||
if status.get(message.chat.id, None) is not True:
|
||||
return await utils.answer(message, self.strings["interrupted"])
|
||||
|
||||
if is_forum and not is_each and utils.get_topic(message) != utils.get_topic(i):
|
||||
continue
|
||||
|
||||
if i.from_id == self.tg_id and args.lower() in (i.text or '').lower() and self.is_valid_type(i, types_filter):
|
||||
await message.client.delete_messages(message.chat.id, [i.id])
|
||||
|
||||
await utils.answer(message, self.strings["purge_keyword_complete"])
|
||||
|
||||
async def purgetimecmd(self, message: Message):
|
||||
""" <start_time> <end_time> [-img] [-voice] [-file] [-all] - delete all your messages within the specified time range in the current chat
|
||||
-all - to delete messages in each topic if this is a forum otherwise the flag'll just be ingored
|
||||
Time format: YYYY-MM-DD HH:MM:SS
|
||||
"""
|
||||
args = utils.get_args_raw(message)
|
||||
if not args:
|
||||
return await utils.answer(message, "Please specify anything because you didn't.")
|
||||
|
||||
args, types_filter, is_each = self.get_types_filter(message)
|
||||
args = args.split()
|
||||
|
||||
if not args or len(args) < 2:
|
||||
return await utils.answer(message, "Please specify the start and end time in the format: YYYY-MM-DD HH:MM:SS")
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
try:
|
||||
start_time = datetime.strptime(args[0], "%Y-%m-%d %H:%M:%S")
|
||||
end_time = datetime.strptime(args[1], "%Y-%m-%d %H:%M:%S")
|
||||
except ValueError:
|
||||
return await utils.answer(message, "Invalid time format. Please use the format: YYYY-MM-DD HH:MM:SS")
|
||||
|
||||
is_forum = (await self.client.get_entity(message.chat.id)).forum
|
||||
|
||||
status = self.db.get(__name__, "status", {})
|
||||
status[message.chat.id] = True
|
||||
self.db.set(__name__, "status", status)
|
||||
|
||||
async for i in self.client.iter_messages(message.peer_id):
|
||||
status = self.db.get(__name__, "status", {})
|
||||
if status.get(message.chat.id, None) is not True:
|
||||
return await utils.answer(message, self.strings["interrupted"])
|
||||
|
||||
if is_forum and not is_each and utils.get_topic(message) != utils.get_topic(i):
|
||||
continue
|
||||
|
||||
if i.from_id == self.tg_id and start_time <= i.date <= end_time and self.is_valid_type(i, types_filter):
|
||||
await message.client.delete_messages(message.peer_id, [i.id])
|
||||
|
||||
await utils.answer(message, self.strings["purge_time_complete"])
|
||||
|
||||
async def purgelengthcmd(self, message: Message):
|
||||
""" <length> [-img] [-voice] [-file] [-all] - delete all your messages with the specified length in the current chat
|
||||
-all - to delete messages in each topic if this is a forum otherwise the flag'll just be ingored
|
||||
"""
|
||||
args = utils.get_args_raw(message)
|
||||
if not args:
|
||||
return await utils.answer(message, "Please specify anything because you didn't.")
|
||||
|
||||
args, types_filter, is_each = self.get_types_filter(message)
|
||||
if not args:
|
||||
return await utils.answer(message, "Please specify a valid length.")
|
||||
|
||||
length = int(args)
|
||||
is_forum = (await self.client.get_entity(message.chat.id)).forum
|
||||
|
||||
status = self.db.get(__name__, "status", {})
|
||||
status[message.chat.id] = True
|
||||
self.db.set(__name__, "status", status)
|
||||
|
||||
async for i in self.client.iter_messages(message.peer_id):
|
||||
status = self.db.get(__name__, "status", {})
|
||||
if status.get(message.chat.id, None) is not True:
|
||||
return await utils.answer(message, self.strings["interrupted"])
|
||||
|
||||
if is_forum and not is_each and utils.get_topic(message) != utils.get_topic(i):
|
||||
continue
|
||||
|
||||
if i.from_id == self.tg_id and len(i.text or '') == length and self.is_valid_type(i, types_filter):
|
||||
await message.client.delete_messages(message.peer_id, [i.id])
|
||||
|
||||
await utils.answer(message, self.strings["purge_length_complete"])
|
||||
|
||||
async def nopurgecmd(self, message: Message):
|
||||
"""
|
||||
Interrupt the deletion process
|
||||
Use in the chat where you've previously started deletion
|
||||
"""
|
||||
chat_id = utils.get_chat_id(message)
|
||||
|
||||
status = self.db.get(__name__, "status", {})
|
||||
_status = status.get(chat_id, None)
|
||||
status[chat_id] = False
|
||||
self.db.set(__name__, "status", status)
|
||||
|
||||
if _status is True:
|
||||
await utils.answer(message, self.strings["disabled"])
|
||||
elif _status is False:
|
||||
await utils.answer(message, self.strings["enabled"])
|
||||
else:
|
||||
await utils.answer(message, self.strings["none"])
|
||||
|
||||
|
||||
def get_types_filter(self, message: Message):
|
||||
""" Get the types filter from the command arguments."""
|
||||
args = utils.get_args_raw(message).split()
|
||||
types_filter = []
|
||||
valid_types = ["-img", "-voice", "-file", "-all"]
|
||||
is_each = "-all" in args
|
||||
|
||||
for i, arg in enumerate(args):
|
||||
if arg in valid_types:
|
||||
_args = " ".join(args[:i])
|
||||
args_ = " ".join(args[i:])
|
||||
break
|
||||
|
||||
if "-img" in args_:
|
||||
types_filter.append("img")
|
||||
if "-voice" in args_:
|
||||
types_filter.append("voice")
|
||||
if "-file" in args_:
|
||||
types_filter.append("file")
|
||||
if "-all" in args_:
|
||||
is_each = True
|
||||
|
||||
return _args, types_filter, is_each
|
||||
|
||||
def is_valid_type(self, message: Message, types_filter):
|
||||
""" Check if the message matches the specified types filter. """
|
||||
if not types_filter:
|
||||
return True # No filtering means all types are valid
|
||||
|
||||
if "img" in types_filter and message.photo:
|
||||
return True
|
||||
if "voice" in types_filter and message.voice:
|
||||
return True
|
||||
if "file" in types_filter and isinstance(message.document, DocumentAttributeFilename):
|
||||
return True
|
||||
|
||||
return False
|
||||
74
coddrago/modules/DoxTool.py
Normal file
74
coddrago/modules/DoxTool.py
Normal file
@@ -0,0 +1,74 @@
|
||||
# ---------------------------------------------------------------------------------
|
||||
#░█▀▄░▄▀▀▄░█▀▄░█▀▀▄░█▀▀▄░█▀▀▀░▄▀▀▄░░░█▀▄▀█
|
||||
#░█░░░█░░█░█░█░█▄▄▀░█▄▄█░█░▀▄░█░░█░░░█░▀░█
|
||||
#░▀▀▀░░▀▀░░▀▀░░▀░▀▀░▀░░▀░▀▀▀▀░░▀▀░░░░▀░░▒▀
|
||||
# Name: Dox?
|
||||
# Description: Your Best doxing tool!
|
||||
# Author: @codrago_m
|
||||
# ---------------------------------------------------------------------------------
|
||||
# 🔒 Licensed under the GNU AGPLv3
|
||||
# 🌐 https://www.gnu.org/licenses/agpl-3.0.html
|
||||
# ---------------------------------------------------------------------------------
|
||||
# Author: @codrago
|
||||
# Commands: gb, deanon
|
||||
# scope: hikka_only
|
||||
# meta developer: @codrago_m
|
||||
# meta banner: https://raw.githubusercontent.com/coddrago/modules/refs/heads/main/banner.png
|
||||
# meta pic: https://envs.sh/HJM.webp
|
||||
# ---------------------------------------------------------------------------------
|
||||
|
||||
__version__ = (1, 0, 0)
|
||||
|
||||
from telethon.tl.types import Message # type: ignore
|
||||
from .. import loader, utils
|
||||
import asyncio, random
|
||||
|
||||
@loader.tds
|
||||
class dox(loader.Module):
|
||||
"""Maybe... doxing tool?"""
|
||||
|
||||
strings = {
|
||||
"name": "DoxTool",
|
||||
"gb_1": "Searching for the victim's number...",
|
||||
"gb_2": "Searching for the victim's address and name...",
|
||||
"gb_3": "Searching for parents...",
|
||||
"gb_4": "Searching for a school...",
|
||||
"gb_5": "Finding parents' jobs...",
|
||||
"gb_r": "My owner behaved badly, so I decided to leak info about him!\n\n├ Phone: wrecked\n├ Country: normal\n├ Region: of liars\n├ Parents: soon will be gone\n├ Address: a ditch on Arbat\n├ Name: why were you born\n├ Middle name: missing\n├ Surname: missing\n├ How many times screwed: 32\n├ Gender: linoleum\n├ House: a ditch on Arbat\n├ Sucks per day: 20 (times) for 10 rub\n├ Hospital: not allowed in\n├ Poop color: none, doesn’t eat\n├ Prostate: massaged\n├ Mouth: ruined\n└ #####################\n\nMother: a prostitute\nMother’s workplace: the highway\nCountry: in the CIS\nCity: how should I know?\nBorn: somewhere under a fence\n\nFather: a homeless\nWorkplace: begging on the street\nCountry: in the CIS\nCity: how should I know?\nBorn: in the sewers\nSchool: of fools",
|
||||
"info": "This module is created solely for entertainment purposes, its functionality is solely for the sake of a joke"
|
||||
}
|
||||
strings_ru = {
|
||||
"name": "DoxTool",
|
||||
"gb_1": "Поиск номера жертвы...",
|
||||
"gb_2": "Поиск адреса и имени жертвы...",
|
||||
"gb_3": "Поиск родителей...",
|
||||
"gb_4": "Поиск школы...",
|
||||
"gb_5": "Поиск работы родителей...",
|
||||
"gb_r": "Мой хозяин плохо себя вел, и я решил слить инфу о нем!\n\n├ Телефон: разъебанный\n├ Страна: обычная\n├ Регион: пиздоболов\n├ Родители: скоро не будет\n├ Адрес: канава на Арбате\n├ Имя: нахуй ты родился\n├ Отчество: отсутствует\n├ Фамилия: отсутствует\n├ Сколько раз ебали в дырку: 32\n├ Пол: ленолиум\n├ Дом: канава на Арбате\n├ Сосёт в день: 20 (раз) за 10 руб\n├ Больница: не пускают\n├ Цвет говна: нету, ибо не хавает\n├ Простата: массирована\n├ Рот: выебан\n└ #####################\n\nМать: шлюха\nМесто работы матери: трасса\nСтрана: состоящаяся в СНГ\nГород: я ебу?\nРодилась: где-то под забором\n\nОтец: бомж,\nМесто работы: на улице бичевать, просить мелочь\nСтрана: состоящаяся в СНГ\nГород: я ебу?\nРодился: в канализации\nШкола: далбоебов",
|
||||
"info": "Этот модуль создан исключительно в развлекательных целях, его функциональность сделана исключительно ради шутки"
|
||||
}
|
||||
|
||||
|
||||
|
||||
async def gbcmd(self, message):
|
||||
"""search in databases eye of god!"""
|
||||
await utils.answer(message, self.strings["gb_1"])
|
||||
await asyncio.sleep(1)
|
||||
await message.edit(self.strings["gb_2"])
|
||||
await asyncio.sleep(1)
|
||||
await message.edit(self.strings["gb_3"])
|
||||
await asyncio.sleep(1)
|
||||
await message.edit(self.strings["gb_4"])
|
||||
await asyncio.sleep(1)
|
||||
await message.edit(self.strings["gb_5"])
|
||||
await asyncio.sleep(1)
|
||||
await message.edit(self.strings["gb_r"])
|
||||
|
||||
async def deanoncmd(self, message):
|
||||
"""Full information of user in global database"""
|
||||
deanon = ["It's bad to do something like this...","I’m tired of you!", "One more prank like this and I’ll delete your account.", "Didn’t you understand the first time?", "Why do you keep doing this??", "We both know that this doesn’t do us any good.", "what won't it lead to?"]
|
||||
await utils.answer(message, random.choice(deanon))
|
||||
|
||||
async def dinfocmd(self, message):
|
||||
"""info of module"""
|
||||
await utils.answer(message, self.strings["info"])
|
||||
42
coddrago/modules/ascii_face.py
Normal file
42
coddrago/modules/ascii_face.py
Normal file
@@ -0,0 +1,42 @@
|
||||
# ---------------------------------------------------------------------------------
|
||||
#░█▀▄░▄▀▀▄░█▀▄░█▀▀▄░█▀▀▄░█▀▀▀░▄▀▀▄░░░█▀▄▀█
|
||||
#░█░░░█░░█░█░█░█▄▄▀░█▄▄█░█░▀▄░█░░█░░░█░▀░█
|
||||
#░▀▀▀░░▀▀░░▀▀░░▀░▀▀░▀░░▀░▀▀▀▀░░▀▀░░░░▀░░▒▀
|
||||
# Name: Ascii face
|
||||
# Description: random ascii face from utils
|
||||
# Author: @codrago_m
|
||||
# ---------------------------------------------------------------------------------
|
||||
# 🔒 Licensed under the GNU AGPLv3
|
||||
# 🌐 https://www.gnu.org/licenses/agpl-3.0.html
|
||||
# ---------------------------------------------------------------------------------
|
||||
# Author: @codrago
|
||||
# Commands: ascii
|
||||
# scope: hikka_only
|
||||
# meta developer: @codrago_m
|
||||
# meta banner: https://raw.githubusercontent.com/coddrago/modules/refs/heads/main/banner.png
|
||||
# meta pic: https://envs.sh/HoE.webp
|
||||
# ---------------------------------------------------------------------------------
|
||||
|
||||
__version__ = (1, 0, 0)
|
||||
|
||||
from .. import loader, utils
|
||||
|
||||
@loader.tds
|
||||
class Ascii_face(loader.Module):
|
||||
"""Random Ascii Face from utils"""
|
||||
|
||||
strings = {
|
||||
"name": "Ascii_Face",
|
||||
"ascii_face": "<emoji document_id=5343719226450385808>😛</emoji> <b>Your random AsciiFace:</b> ",
|
||||
}
|
||||
|
||||
strings_ru = {
|
||||
"ascii_face": "<emoji document_id=5343719226450385808>😛</emoji> <b>Ваш рандомный AsciiFace:</b> "
|
||||
}
|
||||
|
||||
async def asciicmd(self, message):
|
||||
"""| Get random ascii face"""
|
||||
|
||||
ascii_face = utils.ascii_face()
|
||||
|
||||
await utils.answer(message, (self.strings["ascii_face"] + f"<code>{ascii_face}</code>"))
|
||||
78
coddrago/modules/autoclicker.py
Normal file
78
coddrago/modules/autoclicker.py
Normal file
@@ -0,0 +1,78 @@
|
||||
# ---------------------------------------------------------------------------------
|
||||
#░█▀▄░▄▀▀▄░█▀▄░█▀▀▄░█▀▀▄░█▀▀▀░▄▀▀▄░░░█▀▄▀█
|
||||
#░█░░░█░░█░█░█░█▄▄▀░█▄▄█░█░▀▄░█░░█░░░█░▀░█
|
||||
#░▀▀▀░░▀▀░░▀▀░░▀░▀▀░▀░░▀░▀▀▀▀░░▀▀░░░░▀░░▒▀
|
||||
# Name: ButtonAutoClicker.
|
||||
# Description: Click on button!
|
||||
# Author: @codrago_m, @unneyon :P
|
||||
# ---------------------------------------------------------------------------------
|
||||
|
||||
# 🔒 Licensed under the GNU AGPLv3
|
||||
# 🌐 https://www.gnu.org/licenses/agpl-3.0.html
|
||||
|
||||
# meta developer: @codrago_m, @unneyon_hmods
|
||||
# meta banner: https://raw.githubusercontent.com/coddrago/modules/refs/heads/main/banner.png
|
||||
# meta pic: https://envs.sh/HJv.webp
|
||||
# ---------------------------------------------------------------------------------
|
||||
|
||||
from telethon import events
|
||||
from .. import loader, utils
|
||||
import asyncio
|
||||
|
||||
@loader.tds
|
||||
class AutoClickerMod(loader.Module):
|
||||
"""Autoclicker for inline buttons."""
|
||||
|
||||
strings = {
|
||||
"name": "AutoClicker",
|
||||
"clicker_on": "<b>AutoClicker on!</b>",
|
||||
"no_args": "<b>Where arguments and reply?</b>",
|
||||
"clicker_off": "<b>AutoClicker off!</b>",
|
||||
"no_button": "<b>There are no inline buttons in the message.</b>",
|
||||
}
|
||||
|
||||
|
||||
async def client_ready(self, client, db):
|
||||
self._client = client
|
||||
self._db = db
|
||||
|
||||
|
||||
async def clickoncmd(self, message):
|
||||
"""[interval button_line button] | Enable Autoclicker"""
|
||||
if not message.is_reply:
|
||||
return await utils.answer(message, self.strings["no_args"])
|
||||
args = utils.get_args(message)
|
||||
reply = await message.get_reply_message()
|
||||
if len(args) < 1:
|
||||
return await utils.answer(message, self.strings["no_args"])
|
||||
|
||||
interval = int(args[0]) if args[0].isdigit() else 20
|
||||
button_line = 0
|
||||
button_item = 0
|
||||
if (len(args) >= 2) and args[1].isdigit():
|
||||
button_line = int(args[1])
|
||||
if (len(args) >= 3) and args[2].isdigit():
|
||||
button_item = int(args[2])
|
||||
|
||||
if reply and reply.buttons:
|
||||
if len(reply.buttons) < button_line+1:
|
||||
button_line = 0
|
||||
if len(reply.buttons[button_line]) < button_item+1:
|
||||
button_item = 0
|
||||
else:
|
||||
return await utils.answer(message, self.strings["no_button"])
|
||||
|
||||
self.clicker = True
|
||||
await utils.answer(message, self.strings["clicker_on"])
|
||||
|
||||
while self.clicker:
|
||||
button = reply.buttons[button_line][button_item]
|
||||
await button.click()
|
||||
await asyncio.sleep(interval)
|
||||
|
||||
|
||||
async def clickoffcmd(self, message):
|
||||
"""| disable autoclicker."""
|
||||
|
||||
self.clicker = False
|
||||
await utils.answer(message, self.strings["clicker_off"])
|
||||
BIN
coddrago/modules/banner.png
Normal file
BIN
coddrago/modules/banner.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 602 KiB |
195
coddrago/modules/compliments.py
Normal file
195
coddrago/modules/compliments.py
Normal file
@@ -0,0 +1,195 @@
|
||||
# ---------------------------------------------------------------------------------
|
||||
#░█▀▄░▄▀▀▄░█▀▄░█▀▀▄░█▀▀▄░█▀▀▀░▄▀▀▄░░░█▀▄▀█
|
||||
#░█░░░█░░█░█░█░█▄▄▀░█▄▄█░█░▀▄░█░░█░░░█░▀░█
|
||||
#░▀▀▀░░▀▀░░▀▀░░▀░▀▀░▀░░▀░▀▀▀▀░░▀▀░░░░▀░░▒▀
|
||||
# Name: Compliments
|
||||
# Description: Compliments for your partner
|
||||
# Author: @codrago_m
|
||||
# ---------------------------------------------------------------------------------
|
||||
# 🔒 Licensed under the GNU AGPLv3
|
||||
# 🌐 https://www.gnu.org/licenses/agpl-3.0.html
|
||||
# ---------------------------------------------------------------------------------
|
||||
# Author: @codrago
|
||||
# Commands: cg
|
||||
# scope: hikka_only
|
||||
# meta developer: @codrago_m
|
||||
# meta banner: https://raw.githubusercontent.com/coddrago/modules/refs/heads/main/banner.png
|
||||
# meta pic: https://envs.sh/HJ6.webp
|
||||
# ---------------------------------------------------------------------------------
|
||||
|
||||
__version__ = (1, 0, 0)
|
||||
|
||||
from .. import loader, utils
|
||||
import asyncio
|
||||
|
||||
@loader.tds
|
||||
class Compliments(loader.Module):
|
||||
"""Compliments for your partner"""
|
||||
|
||||
strings = {
|
||||
"name": "Compliments",
|
||||
"speed_cfg": "Delay between edits"
|
||||
}
|
||||
|
||||
def __init__(self):
|
||||
self.config = loader.ModuleConfig(
|
||||
loader.ConfigValue(
|
||||
"speed",
|
||||
2,
|
||||
lambda: self.strings["speed_cfg"],
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
async def cgcmd(self, message):
|
||||
"""Compliments for girl"""
|
||||
|
||||
await utils.answer(message, "❤ | Знаешь..")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | Я всегда хотел тебе сказать, что...")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 1. Ты прекрасна!")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 2. Ты замечательна!")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 3. Ты любимая!")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 4. Ты желанная!")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 5. Ты лучшая!")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 6. Ты – дар, который нужно ценить.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 7. Ты – настоящая находка в этом мире.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 8. Ты – как весенний день, полный надежды.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 9. С тобой всегда интересно провести время.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 10. Ты умеешь делать даже обыденные вещи особенными.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 11. Твой смех – это музыка для ушей.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 12. Ты делаешь меня счастливым.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 13. Ты освещаешь даже самые серые дни.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 14. Твоя поддержка для меня очень важна.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 15. Ты пример для подражания.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 16. Ты понимаешь меня так, как никто другой.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 17. Ты – знаешь, как поддерживать в трудную минуту.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 18. Ты создаешь уют вокруг себя.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 19. Ты светишься, как звезда.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 20. Ты наполняешь каждый день смыслом.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 21. Ты — лучик света в пасмурный день.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 22. У тебя потрясающее чувство вкуса.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 23. Улыбка — твое самое красивое оружие.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 24. Ты — редкость в этом мире.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 25. Ты — самый яркий момент моего дня.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 26. Ты словно весна после зимы.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 27. Твоё чувство юмора — настоящее сокровище.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 28. Ты — истинная красота.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 29. Твои достижения впечатляют.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 30. Тебя легко любить.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 31. Ты — счастье в человеческом обличье.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 32. В тебе так много внутреннего света.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 33. Каждый разговор с тобой запоминается.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 34. У тебя невероятная сила характера.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 35. Ты вдохновляешь меня становиться лучше.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 36. Твоё обаяние просто нельзя игнорировать.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 37. Ты — победитель по жизни.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 38. Ты – словно поэма, полная эмоций.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 39. Ты создаёшь уютную атмосферу, куда бы ни шла.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 40. Ты стойка и непоколебима в сложные времена.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 41. Ты — положительный пример для всех нас.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 42. Твой характер прекрасен, как музыка арфы.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 43. Твои глаза прекрасны, как северное сияние.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 44. Ты – волшебница, делающая всё вокруг более ярким.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 45. Ты умеешь находить положительное даже в трудностях.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 46. Ты уникальна и неповторима.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 47. Твоя креативность вдохновляет на свершения.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 48. У тебя потрясающий талант к общению.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 49. Ты красива, даже когда не стараешься.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 50. У тебя есть дар — делать людей счастливыми. ")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 51. Ты — олицетворение красоты.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 52. Ты обладаешь невероятной харизмой.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 53. Твои волосы выглядят великолепно.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 54. В твоем присутствии я чувствую себя комфортно.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 55. Ты — цветок в саду жизни.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 56. Ты — мечта, которая стала явью.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 57. Твоя энергия заряжает окружающих.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 58. Ты словно лучик солнца.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 59. Ты — невероятный человек.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 60. Ты умеешь видеть красоту в глупостях.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 61. Ты демонстрируешь мне невероятную смелость.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 62. Ты — источник вдохновения.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 63. Ты освещаешь каждый мой день, включая этот.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 64. Ты — загадка, которую интересно разгадать.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 65. Твои глаза как океан.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 66. Ты умеешь создавать уют.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 67. Ты — художник своей жизни.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 68. Ты даришь тепло и заботу.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 69. У тебя великолепный вкус в одежде.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | 70. Ты — звезда в моем небе.")
|
||||
await asyncio.sleep(self.config["speed"])
|
||||
await message.edit("❤ | Моя любимая, все эти комплименты именно для тебя! Ведь... я люблю тебя. <emoji document_id=5287454910059654880>❤️</emoji>")
|
||||
|
||||
|
||||
|
||||
|
||||
57
coddrago/modules/emojidown.py
Normal file
57
coddrago/modules/emojidown.py
Normal file
@@ -0,0 +1,57 @@
|
||||
# ---------------------------------------------------------------------------------
|
||||
#░█▀▄░▄▀▀▄░█▀▄░█▀▀▄░█▀▀▄░█▀▀▀░▄▀▀▄░░░█▀▄▀█
|
||||
#░█░░░█░░█░█░█░█▄▄▀░█▄▄█░█░▀▄░█░░█░░░█░▀░█
|
||||
#░▀▀▀░░▀▀░░▀▀░░▀░▀▀░▀░░▀░▀▀▀▀░░▀▀░░░░▀░░▒▀
|
||||
# Name: EmojiDownloader
|
||||
# Description: Download emoji from reply
|
||||
# Author: @codrago_m
|
||||
# ---------------------------------------------------------------------------------
|
||||
# 🔒 Licensed under the GNU AGPLv3
|
||||
# 🌐 https://www.gnu.org/licenses/agpl-3.0.html
|
||||
# ---------------------------------------------------------------------------------
|
||||
# Author: @codrago
|
||||
# Commands: emojidown
|
||||
# scope: hikka_only
|
||||
# meta developer: @codrago_m
|
||||
# meta banner: https://raw.githubusercontent.com/coddrago/modules/refs/heads/main/banner.png
|
||||
# meta pic: https://envs.sh/Hod.webp
|
||||
# ---------------------------------------------------------------------------------
|
||||
|
||||
__version__ = (1, 0, 0)
|
||||
from .. import loader, utils
|
||||
from telethon.tl.types import Message # type: ignore
|
||||
|
||||
|
||||
@loader.tds
|
||||
class EmojiDownloadMod(loader.Module):
|
||||
"""Download emoji from reply"""
|
||||
|
||||
strings = {
|
||||
"name": "EmojiDownload",
|
||||
}
|
||||
|
||||
def __init__(self):
|
||||
self.bot = "@emojidownloadbot"
|
||||
|
||||
async def on_dlmod(self):
|
||||
await utils.dnd(self._client, self.bot, True)
|
||||
|
||||
async def emojidowncmd(self, message: Message):
|
||||
"""[reply] | Download emoji from reply"""
|
||||
reply = await message.get_reply_message()
|
||||
if not getattr(reply, "id", None):
|
||||
await utils.answer(message, "<emoji document_id=5328145443106873128>✖️</emoji> Where is reply for your emoji?")
|
||||
if self.client.hikka_me.premium == False:
|
||||
await utils.answer(message, "<emoji document_id=5328145443106873128>✖️</emoji> Sorry, but module only for premium users")
|
||||
return
|
||||
|
||||
try:
|
||||
async with self._client.conversation(self.bot) as conv:
|
||||
reply = await message.get_reply_message()
|
||||
await conv.send_message(reply)
|
||||
emoji = await conv.get_response()
|
||||
await conv.mark_read()
|
||||
await message.delete()
|
||||
await utils.answer(message, emoji)
|
||||
except ValueError:
|
||||
await utils.answer(message, "<emoji document_id=5328145443106873128>✖️</emoji> Where is reply for your emoji?")
|
||||
87
coddrago/modules/figlet.py
Normal file
87
coddrago/modules/figlet.py
Normal file
@@ -0,0 +1,87 @@
|
||||
# ---------------------------------------------------------------------------------
|
||||
#░█▀▄░▄▀▀▄░█▀▄░█▀▀▄░█▀▀▄░█▀▀▀░▄▀▀▄░░░█▀▄▀█
|
||||
#░█░░░█░░█░█░█░█▄▄▀░█▄▄█░█░▀▄░█░░█░░░█░▀░█
|
||||
#░▀▀▀░░▀▀░░▀▀░░▀░▀▀░▀░░▀░▀▀▀▀░░▀▀░░░░▀░░▒▀
|
||||
# Name: Figlet
|
||||
# Description: Tool for Figlet
|
||||
# Author: @codrago_m
|
||||
# ---------------------------------------------------------------------------------
|
||||
# 🔒 Licensed under the GNU AGPLv3
|
||||
# 🌐 https://www.gnu.org/licenses/agpl-3.0.html
|
||||
# ---------------------------------------------------------------------------------
|
||||
# Author: @codrago
|
||||
# Commands: figlet
|
||||
# scope: hikka_only
|
||||
# meta developer: @codrago_m
|
||||
# meta banner: https://raw.githubusercontent.com/coddrago/modules/refs/heads/main/banner.png
|
||||
# meta pic: https://envs.sh/Hou.webp
|
||||
# ---------------------------------------------------------------------------------
|
||||
|
||||
__version__ = (1, 0, 0)
|
||||
|
||||
import subprocess
|
||||
import traceback
|
||||
from .. import loader, utils
|
||||
|
||||
@loader.tds
|
||||
class Figlet(loader.Module):
|
||||
"""Tool for work with figlet"""
|
||||
|
||||
strings = {
|
||||
"name": "Figlet",
|
||||
"not_installed": "<emoji document_id=5328145443106873128>✖️</emoji> <b>You don't have Figlet installed! Install it with <code>.terminal sudo apt install figlet -y</code></b>",
|
||||
"no_args": "<emoji document_id=5328145443106873128>✖️</emoji> <b>Where args?</b>"
|
||||
}
|
||||
|
||||
strings_ru = {
|
||||
"not_installed": "<emoji document_id=5328145443106873128>✖️</emoji> <b>У вас не установлен Figlet! Установите его командой <code>.terminal sudo apt install figlet -y</code></b>",
|
||||
"no_args": "<emoji document_id=5328145443106873128>✖️</emoji> <b>Где аргументы?</b>"
|
||||
}
|
||||
|
||||
def __init__(self):
|
||||
self.config = loader.ModuleConfig(
|
||||
loader.ConfigValue(
|
||||
"font",
|
||||
"standard",
|
||||
"Select font for figlet",
|
||||
validator=loader.validators.String(),
|
||||
),
|
||||
)
|
||||
|
||||
async def figletcmd(self, message):
|
||||
"""[args] | run figlet command"""
|
||||
|
||||
args=utils.get_args_raw(message)
|
||||
|
||||
if not args:
|
||||
await utils.answer(message, self.strings["no_args"])
|
||||
else:
|
||||
try:
|
||||
result = subprocess.run(["figlet", "-f", f"{self.config['font']}", f"{args}"], capture_output=True, text=True)
|
||||
output = result.stdout
|
||||
await utils.answer(message, f"<pre>ᅠ\n{utils.escape_html(output)}</pre>")
|
||||
|
||||
except FileNotFoundError:
|
||||
await utils.answer(message, self.strings["not_installed"])
|
||||
|
||||
async def figlistcmd(self, message):
|
||||
"""| see list of all fonts"""
|
||||
fonts = [
|
||||
"banner",
|
||||
"big",
|
||||
"block",
|
||||
"bubble",
|
||||
"digital",
|
||||
"ivrit",
|
||||
"lean",
|
||||
"mini",
|
||||
"mnemonic",
|
||||
"script",
|
||||
"shadow",
|
||||
"slant",
|
||||
"small",
|
||||
"smscript",
|
||||
"smshadow",
|
||||
"smslant",
|
||||
]
|
||||
await utils.answer(message, "<b>List of available fonts:</b>\n" + "\n".join(fonts))
|
||||
20
coddrago/modules/full.txt
Normal file
20
coddrago/modules/full.txt
Normal file
@@ -0,0 +1,20 @@
|
||||
dice
|
||||
clickon
|
||||
modlist
|
||||
loli
|
||||
DoxTool
|
||||
id
|
||||
randomizer
|
||||
compliments
|
||||
pinterest
|
||||
DelMessTools
|
||||
hentai
|
||||
speedtest
|
||||
ascii_face
|
||||
pmban
|
||||
emojidown
|
||||
figlet
|
||||
promoclaimer
|
||||
passwordgen
|
||||
send
|
||||
lastfm
|
||||
165
coddrago/modules/hentai.py
Normal file
165
coddrago/modules/hentai.py
Normal file
@@ -0,0 +1,165 @@
|
||||
# ---------------------------------------------------------------------------------
|
||||
#░█▀▄░▄▀▀▄░█▀▄░█▀▀▄░█▀▀▄░█▀▀▀░▄▀▀▄░░░█▀▄▀█
|
||||
#░█░░░█░░█░█░█░█▄▄▀░█▄▄█░█░▀▄░█░░█░░░█░▀░█
|
||||
#░▀▀▀░░▀▀░░▀▀░░▀░▀▀░▀░░▀░▀▀▀▀░░▀▀░░░░▀░░▒▀
|
||||
# Name: Hentai!
|
||||
# Description: random hentai media
|
||||
# Author: @codrago_m
|
||||
# ---------------------------------------------------------------------------------
|
||||
# 🔒 Licensed under the GNU AGPLv3
|
||||
# 🌐 https://www.gnu.org/licenses/agpl-3.0.html
|
||||
# ---------------------------------------------------------------------------------
|
||||
# Author: @codrago
|
||||
# Commands: fem, sfw, furry, nsfw, loli
|
||||
# scope: hikka_only
|
||||
# meta developer: @codrago_m
|
||||
# meta banner: https://mods.codrago.top/banners/loli.png
|
||||
# meta pic: https://envs.sh/HJ-.webp
|
||||
# ---------------------------------------------------------------------------------
|
||||
|
||||
__version__ = (1, 0, 0)
|
||||
|
||||
import os
|
||||
import logging
|
||||
from .. import loader, utils
|
||||
import random
|
||||
import time
|
||||
import datetime
|
||||
from telethon import functions
|
||||
from telethon.tl.custom import Message
|
||||
|
||||
logger = logging.getLogger("Hentai")
|
||||
|
||||
@loader.tds
|
||||
class Hentai(loader.Module):
|
||||
"""Send to you random hentai media!"""
|
||||
strings = {
|
||||
"name": "Hentai",
|
||||
"loading_photo_loli": "<emoji document_id=5215327832040811010>⏳</emoji> <b>loading your loli photo...</b>",
|
||||
"error_loading": "<b>Failed to get photos. Please unblock @ferganteusbot</b>",
|
||||
"search": "<emoji document_id=5328311576736833844>🔴</emoji> loading your media..."
|
||||
}
|
||||
|
||||
strings_ru = {
|
||||
"name": "Hentai",
|
||||
"loading_photo_loli": "<emoji document_id=5215327832040811010>⏳</emoji> <b>загрузка вашей лоли фотографии...</b>",
|
||||
"error_loading": "<b>Не удалось получить фотографии. Пожалуйста, разблокируйте @ferganteusbot</b>",
|
||||
"search": "<emoji document_id=5328311576736833844>🔴</emoji> загрузка вашего медиа..."
|
||||
}
|
||||
|
||||
async def lolicmd(self, message):
|
||||
"""| random loli photo"""
|
||||
|
||||
await utils.answer(message, self.strings("loading_photo_loli"))
|
||||
|
||||
async with self._client.conversation("@ferganteusbot") as conv:
|
||||
try:
|
||||
lh = await conv.send_message("/lh")
|
||||
|
||||
|
||||
except Exception as e:
|
||||
return await utils.answer(message, self.strings("error_loading"))
|
||||
|
||||
otvet = await conv.get_response()
|
||||
await lh.delete()
|
||||
if otvet.media:
|
||||
await message.client.send_message(
|
||||
message.peer_id,
|
||||
message=otvet,
|
||||
reply_to=getattr(message, "reply_to_msg_id", None))
|
||||
await otvet.delete()
|
||||
await message.delete()
|
||||
|
||||
async def femcmd(self, message):
|
||||
"""| random femboy media"""
|
||||
|
||||
await utils.answer(message, self.strings("search"))
|
||||
|
||||
async with self._client.conversation("@ferganteusbot") as conv:
|
||||
try:
|
||||
fm = await conv.send_message("/fm")
|
||||
|
||||
|
||||
except Exception as e:
|
||||
return await utils.answer(message, self.strings("error_loading"))
|
||||
|
||||
response = await conv.get_response()
|
||||
await fm.delete()
|
||||
if response.media:
|
||||
await message.client.send_message(
|
||||
message.peer_id,
|
||||
message=response,
|
||||
reply_to=getattr(message, "reply_to_msg_id", None))
|
||||
await response.delete()
|
||||
await message.delete()
|
||||
|
||||
async def sfwcmd(self, message):
|
||||
"""| random SFW media"""
|
||||
|
||||
await utils.answer(message, self.strings("search"))
|
||||
|
||||
async with self._client.conversation("@ferganteusbot") as conv:
|
||||
try:
|
||||
rc = await conv.send_message("/rc")
|
||||
|
||||
|
||||
except Exception as e:
|
||||
return await utils.answer(message, self.strings("error_loading"))
|
||||
|
||||
response = await conv.get_response()
|
||||
await rc.delete()
|
||||
if response.media:
|
||||
await message.client.send_message(
|
||||
message.peer_id,
|
||||
message=response,
|
||||
reply_to=getattr(message, "reply_to_msg_id", None))
|
||||
await response.delete()
|
||||
await message.delete()
|
||||
|
||||
async def furrycmd(self, message: Message):
|
||||
"""| to get random furry media"""
|
||||
await message.edit(self.strings("search"))
|
||||
time.sleep(0.5)
|
||||
chat = "furrylov"
|
||||
result = await message.client(
|
||||
functions.messages.GetHistoryRequest(
|
||||
peer=chat,
|
||||
offset_id=0,
|
||||
offset_date=datetime.datetime.now(),
|
||||
add_offset=random.choice(range(1, 12436, 2)),
|
||||
limit=1,
|
||||
max_id=0,
|
||||
min_id=0,
|
||||
hash=0,
|
||||
),
|
||||
)
|
||||
await message.delete()
|
||||
await message.client.send_file(
|
||||
message.to_id,
|
||||
result.messages[0].media,
|
||||
reply_to=getattr(message, "reply_to_msg_id", None),
|
||||
)
|
||||
|
||||
async def nsfwcmd(self, message: Message):
|
||||
"""| to get random NSFW media"""
|
||||
await message.edit(self.strings("search"))
|
||||
time.sleep(0.5)
|
||||
chat = "hdjrkdjrkdkd"
|
||||
result = await message.client(
|
||||
functions.messages.GetHistoryRequest(
|
||||
peer=chat,
|
||||
offset_id=0,
|
||||
offset_date=datetime.datetime.now(),
|
||||
add_offset=random.choice(range(1, 851, 2)),
|
||||
limit=1,
|
||||
max_id=0,
|
||||
min_id=0,
|
||||
hash=0,
|
||||
),
|
||||
)
|
||||
await message.delete()
|
||||
await message.client.send_file(
|
||||
message.to_id,
|
||||
result.messages[0].media,
|
||||
reply_to=getattr(message, "reply_to_msg_id", None),
|
||||
)
|
||||
89
coddrago/modules/id.py
Normal file
89
coddrago/modules/id.py
Normal file
@@ -0,0 +1,89 @@
|
||||
# ---------------------------------------------------------------------------------
|
||||
#░█▀▄░▄▀▀▄░█▀▄░█▀▀▄░█▀▀▄░█▀▀▀░▄▀▀▄░░░█▀▄▀█
|
||||
#░█░░░█░░█░█░█░█▄▄▀░█▄▄█░█░▀▄░█░░█░░░█░▀░█
|
||||
#░▀▀▀░░▀▀░░▀▀░░▀░▀▀░▀░░▀░▀▀▀▀░░▀▀░░░░▀░░▒▀
|
||||
# Name: ID
|
||||
# Description: Tool for ID's
|
||||
# Author: @codrago_m
|
||||
# ---------------------------------------------------------------------------------
|
||||
# 🔒 Licensed under the GNU AGPLv3
|
||||
# 🌐 https://www.gnu.org/licenses/agpl-3.0.html
|
||||
# ---------------------------------------------------------------------------------
|
||||
# Author: @codrago
|
||||
# Commands: id, chatid, userid
|
||||
# scope: hikka_only
|
||||
# meta developer: @codrago_m
|
||||
# meta banner: https://raw.githubusercontent.com/coddrago/modules/refs/heads/main/banner.png
|
||||
# meta pic: https://envs.sh/HJX.webp
|
||||
# ---------------------------------------------------------------------------------
|
||||
|
||||
__version__ = (1, 0, 0)
|
||||
|
||||
from .. import loader, utils
|
||||
import telethon as tl
|
||||
|
||||
@loader.tds
|
||||
class ID(loader.Module):
|
||||
"""ID of all!"""
|
||||
|
||||
strings = {
|
||||
"name": "ID",
|
||||
"Error_reply": "<emoji document_id=5328145443106873128>✖️</emoji> <b>Where your reply?</b>",
|
||||
"not_chat": "<emoji document_id=5328145443106873128>✖️</emoji> <b>This is not a chat!</b>"
|
||||
}
|
||||
|
||||
strings_ru = {
|
||||
"Error_reply": "<emoji document_id=5328145443106873128>✖️</emoji> <b>Где твой реплай?</b>",
|
||||
"not_chat": "<emoji document_id=5328145443106873128>✖️</emoji> <b>Это не чат!</b>"
|
||||
}
|
||||
|
||||
def __init__(self):
|
||||
self.config = loader.ModuleConfig(
|
||||
loader.ConfigValue(
|
||||
"bot_api_id",
|
||||
"True",
|
||||
"Bot API id for channels and chats",
|
||||
validator=loader.validators.Boolean(),
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
async def useridcmd(self, message):
|
||||
"""[reply or username] | Get User ID"""
|
||||
args = utils.get_args_raw(message)
|
||||
reply = await message.get_reply_message()
|
||||
|
||||
try:
|
||||
if args:
|
||||
user = await message.client.get_entity(
|
||||
args if not args.isdigit() else int(args)
|
||||
)
|
||||
else:
|
||||
user = await message.client.get_entity(reply.sender_id)
|
||||
except ValueError:
|
||||
user = await message.client.get_entity(message.sender_id)
|
||||
|
||||
if isinstance(user, tl.types.User):
|
||||
await utils.answer(message, f"<emoji document_id=5301034196490268401>🪐</emoji> <bUser:</b> <code>{user.first_name}</code>\n<emoji document_id=5314260526803462610>😴</emoji> <b>User ID:</b> <code>{user.id}</code>")
|
||||
|
||||
elif self.config["bot_api_id"] == True:
|
||||
await utils.answer(message, f"<emoji document_id=5301034196490268401>🪐</emoji> <bUser:</b> <code>{user.title}</code>\n<emoji document_id=5314260526803462610>😴</emoji> <b>User ID:</b> <code>-100{user.id}</code>")
|
||||
|
||||
else:
|
||||
await utils.answer(message, f"<emoji document_id=5301034196490268401>🪐</emoji> <bUser:</b> <code>{user.title}</code>\n<emoji document_id=5314260526803462610>😴</emoji> <b>User ID:</b> <code>{user.id}</code>")
|
||||
|
||||
async def idcmd(self, message):
|
||||
"""| Get your ID"""
|
||||
|
||||
user = await message.client.get_entity(message.sender_id)
|
||||
|
||||
await utils.answer(message, f"<emoji document_id=5301034196490268401>🪐</emoji><b> Your Nick:</b> {user.first_name}\n<emoji document_id=5314260526803462610>😴</emoji> <b>Your ID</b>: <code>{message.sender_id}</code>")
|
||||
|
||||
async def chatidcmd(self, message):
|
||||
"""| Get chat ID"""
|
||||
|
||||
if self.config["bot_api_id"] == True:
|
||||
await utils.answer(message, f"<emoji document_id=5301034196490268401>🪐</emoji><code> {message.chat.title}</code>\n<emoji document_id=5314260526803462610>😴</emoji> <b>Chat ID</b>: <code>-100{message.peer_id.channel_id}</code>")
|
||||
|
||||
else:
|
||||
await utils.answer(message, f"<emoji document_id=5301034196490268401>🪐</emoji><code> {message.chat.title}</code>\n<emoji document_id=5314260526803462610>😴</emoji> <b>Chat ID</b>: <code>{message.peer_id.channel_id}</code>")
|
||||
124
coddrago/modules/lastfm.py
Normal file
124
coddrago/modules/lastfm.py
Normal file
@@ -0,0 +1,124 @@
|
||||
# ---------------------------------------------------------------------------------
|
||||
#░█▀▄░▄▀▀▄░█▀▄░█▀▀▄░█▀▀▄░█▀▀▀░▄▀▀▄░░░█▀▄▀█
|
||||
#░█░░░█░░█░█░█░█▄▄▀░█▄▄█░█░▀▄░█░░█░░░█░▀░█
|
||||
#░▀▀▀░░▀▀░░▀▀░░▀░▀▀░▀░░▀░▀▀▀▀░░▀▀░░░░▀░░▒▀
|
||||
# Name: LastFM
|
||||
# Description: Module for music from different services
|
||||
# Author: @codrago_m
|
||||
# ---------------------------------------------------------------------------------
|
||||
# 🔒 Licensed under the GNU AGPLv3
|
||||
# 🌐 https://www.gnu.org/licenses/agpl-3.0.html
|
||||
# ---------------------------------------------------------------------------------
|
||||
# Author: @codrago
|
||||
# Commands: nowplay
|
||||
# scope: heroku_only
|
||||
# meta developer: @codrago_m
|
||||
# meta banner: https://raw.githubusercontent.com/coddrago/modules/refs/heads/main/banner.png
|
||||
# meta pic: https://envs.sh/Hob.webp
|
||||
# ---------------------------------------------------------------------------------
|
||||
|
||||
from .. import loader, utils
|
||||
from herokutl import events
|
||||
import requests
|
||||
import asyncio
|
||||
|
||||
|
||||
@loader.tds
|
||||
class lastfmmod(loader.Module):
|
||||
"""Module for music from different services"""
|
||||
def __init__(self):
|
||||
self.config = loader.ModuleConfig(
|
||||
loader.ConfigValue(
|
||||
"username_lastfm",
|
||||
None,
|
||||
lambda: self.strings["_doc_username_lastfm"],
|
||||
),
|
||||
loader.ConfigValue(
|
||||
"text",
|
||||
"<emoji document_id=6007938409857815902>🎧</emoji> <b>now playing...</b>\n"
|
||||
"<emoji document_id=5915480455603295660>🎶</emoji><b> playlist: </b><code>{song_album}</code>\n"
|
||||
"<emoji document_id=5891249688933305846>🎵</emoji> <b>track:</b> <code>{song_name}</code>\n"
|
||||
"<emoji document_id=5897554554894946515>🎤</emoji> <b>artist:</b> <code>{song_artist}</code>",
|
||||
lambda: self.strings["_doc_text"],
|
||||
),
|
||||
)
|
||||
|
||||
strings = {
|
||||
"name": "LastFm",
|
||||
"loading":"<emoji document_id=5873204392429096339>⌨️</emoji> Loading song...",
|
||||
"bot_no_result": "<emoji document_id=5465665476971471368>❌</emoji> Nothing found.\nTitle: {song_name}\nAuthor: {song_artist}\nAlbum:{song_album}",
|
||||
"_doc_text": "The text that will be written next to the file",
|
||||
"_doc_username_lastfm": "Your username from last.fm",
|
||||
"nick_error": "<emoji document_id=5465665476971471368>❌</emoji> Put your nickname from last.fm",
|
||||
"tutorial": "Go to last.fm and register.\nBE SURE to remember the username and password, they will come in handy later.\nLet's look at the VK version\nAfter that, go to the @vkxci channel, download VK X and log in to your VK account, then go to settings and click «Integrations», select Last FM.\nEnter the username and password.\nThen you're almost done!\nWrite <code>{prefix}fcfg lastfm username_lastfm</code> {username}\nUse the <code>{prefix}nowplay</code> command and enjoy life!",
|
||||
}
|
||||
|
||||
strings_ru = {
|
||||
"name": "LastFm",
|
||||
"loading": "<emoji document_id=5873204392429096339>⌨️</emoji> Загрузка трека...",
|
||||
"bot_no_result": "<emoji document_id=5465665476971471368>❌</emoji> Ничего не найдено.\nНазвание: {song_name}\nИсполнитель: {song_artist}\nАльбом: {song_album}",
|
||||
"_doc_text": "Текст, который будет написан рядом с файлом",
|
||||
"_doc_username_lastfm": "Ваш username с last.fm",
|
||||
"nick_error": "<emoji document_id=5465665476971471368>❌</emoji> Укажите ваш никнейм с last.fm",
|
||||
"tutorial": "Зайдите на last.fm и зарегистрируйтесь.\nОБЯЗАТЕЛЬНО запомните логин и пароль, они пригодятся позже.\nРассмотрим вариант для VK\nПосле этого зайдите в канал @vkxci, скачайте VK X и авторизуйтесь в своём аккаунте VK, затем зайдите в настройки и нажмите «Интеграции», выберите Last FM.\nВведите логин и пароль.\nЗатем вы почти закончили!\nНапишите <code>{prefix}fcfg lastfm username_lastfm</code> {username}\nИспользуйте команду <code>{prefix}nowplay</code> и наслаждайтесь жизнью!",
|
||||
}
|
||||
|
||||
@loader.command(alias="np")
|
||||
async def nowplay(self, message):
|
||||
"""| send playing track"""
|
||||
|
||||
lastfm_username = self.config["username_lastfm"]
|
||||
API_KEY = "460cda35be2fbf4f28e8ea7a38580730" # Облегчение жизни школьникам
|
||||
|
||||
if not lastfm_username:
|
||||
response_text = self.strings["nick_error"]
|
||||
await self.invoke("config", "lastfm", message=message)
|
||||
await utils.answer(message, response_text)
|
||||
else:
|
||||
try:
|
||||
current_track_url = f'http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&nowplaying=true&user={lastfm_username}&api_key={API_KEY}&format=json'
|
||||
response = requests.get(current_track_url)
|
||||
data = response.json()
|
||||
|
||||
if 'recenttracks' in data and 'track' in data['recenttracks'] and data['recenttracks']['track']:
|
||||
nowplaying_track = None
|
||||
for track in data['recenttracks']['track']:
|
||||
if '@attr' in track and 'nowplaying' in track['@attr']:
|
||||
nowplaying_track = track
|
||||
break
|
||||
|
||||
if nowplaying_track:
|
||||
song_name = nowplaying_track.get('name', 'Unknown song')
|
||||
song_artist = nowplaying_track.get('artist', {}).get('#text', 'Unknown Artist')
|
||||
if nowplaying_track.get('album', {}).get('#text') == nowplaying_track.get('name'):
|
||||
song_album = "single"
|
||||
else:
|
||||
song_album = nowplaying_track.get('album', {}).get('#text', 'Unknown Album')
|
||||
response_text = f"/search {song_name} - {song_artist}"
|
||||
|
||||
try:
|
||||
async with message.client.conversation("@LyaDownbot") as conv:
|
||||
await conv.send_message(response_text)
|
||||
while True:
|
||||
response_bot = await conv.get_response()
|
||||
if "Не удалось найти трек" in response_bot.text:
|
||||
await utils.answer(message, self.strings["bot_no_result"])
|
||||
return
|
||||
|
||||
if "Ищем треки..." in response_bot.text:
|
||||
await utils.answer(message, self.strings["loading"])
|
||||
|
||||
if response_bot.media:
|
||||
await message.client.send_file(message.chat_id, response_bot.media, caption = self.config["text"].format(song_artist=song_artist, song_album=song_album, song_name=song_name))
|
||||
await message.delete()
|
||||
return
|
||||
except Exception as e:
|
||||
await utils.answer(message, f"<pre><code class='language-python'>{e}</code></pre>")
|
||||
except Exception as e:
|
||||
await utils.answer(message, f"<pre><code class='language-python'>{e}</code></pre>")
|
||||
|
||||
@loader.command()
|
||||
async def tutorl(self, message):
|
||||
"""| tutorial"""
|
||||
|
||||
await utils.answer(message, self.strings['tutorial'].format(prefix = self.get_prefix(), username="{username}"))
|
||||
95
coddrago/modules/loli.py
Normal file
95
coddrago/modules/loli.py
Normal file
@@ -0,0 +1,95 @@
|
||||
# ---------------------------------------------------------------------------------
|
||||
#░█▀▄░▄▀▀▄░█▀▄░█▀▀▄░█▀▀▄░█▀▀▀░▄▀▀▄░░░█▀▄▀█
|
||||
#░█░░░█░░█░█░█░█▄▄▀░█▄▄█░█░▀▄░█░░█░░░█░▀░█
|
||||
#░▀▀▀░░▀▀░░▀▀░░▀░▀▀░▀░░▀░▀▀▀▀░░▀▀░░░░▀░░▒▀
|
||||
# Name: Loli Hentai!
|
||||
# Description: words superfluous?
|
||||
# Author: @codrago_m
|
||||
# ---------------------------------------------------------------------------------
|
||||
# 🔒 Licensed under the GNU AGPLv3
|
||||
# 🌐 https://www.gnu.org/licenses/agpl-3.0.html
|
||||
# ---------------------------------------------------------------------------------
|
||||
# Author: @codrago
|
||||
# Commands: loli, lolic
|
||||
# scope: hikka_only
|
||||
# meta developer: @codrago_m
|
||||
# meta banner: https://raw.githubusercontent.com/coddrago/modules/refs/heads/main/banner.png
|
||||
# meta pic: https://envs.sh/HJm.webp
|
||||
# ---------------------------------------------------------------------------------
|
||||
|
||||
__version__ = (1, 6, 0)
|
||||
import os
|
||||
import logging
|
||||
from .. import loader, utils
|
||||
import random
|
||||
import time
|
||||
import datetime
|
||||
from telethon import functions
|
||||
from telethon.tl.custom import Message
|
||||
|
||||
logger = logging.getLogger("LoliHentai")
|
||||
|
||||
@loader.tds
|
||||
class lolihentai(loader.Module):
|
||||
"""Your the best friend in loli hentai"""
|
||||
|
||||
strings = {
|
||||
"name": "LoliHentai",
|
||||
"loading_photo": "<emoji document_id=5215327832040811010>⏳</emoji> <b>loading your loli photo...</b>",
|
||||
"error_loading": "<b>Failed to get photos. Please unblock @ferganteusbot</b>",
|
||||
"search": "<emoji document_id=5328311576736833844>🔴</emoji> loading your photo..."
|
||||
}
|
||||
|
||||
strings_ru = {
|
||||
"name": "LoliHentai",
|
||||
"loading_photo": "<emoji document_id=5215327832040811010>⏳</emoji> <b>загрузка вашей лоли фотографии...</b>",
|
||||
"error_loading": "<b>Не удалось получить фотографии. Пожалуйста, разблокируйте @ferganteusbot</b>",
|
||||
"search": "<emoji document_id=5328311576736833844>🔴</emoji> загрузка вашей фотографии..."
|
||||
}
|
||||
|
||||
async def lolicmd(self, message):
|
||||
"""-> random loli photo"""
|
||||
|
||||
await utils.answer(message, self.strings("loading_photo"))
|
||||
|
||||
async with self._client.conversation("@ferganteusbot") as conv:
|
||||
try:
|
||||
lh = await conv.send_message("/lh")
|
||||
|
||||
|
||||
except Exception as e:
|
||||
return await utils.answer(message, self.strings("error_loading"))
|
||||
|
||||
otvet = await conv.get_response()
|
||||
await lh.delete()
|
||||
if otvet.photo:
|
||||
await message.client.send_message(
|
||||
message.peer_id,
|
||||
message=otvet,
|
||||
reply_to=getattr(message, "reply_to_msg_id", None))
|
||||
await otvet.delete()
|
||||
await message.delete()
|
||||
|
||||
async def loliccmd(self, message: Message):
|
||||
"""-> to get your loli"""
|
||||
await message.edit(self.strings("search"))
|
||||
time.sleep(0.5)
|
||||
chat = "hdjrkdjrkdkd"
|
||||
result = await message.client(
|
||||
functions.messages.GetHistoryRequest(
|
||||
peer=chat,
|
||||
offset_id=0,
|
||||
offset_date=datetime.datetime.now(),
|
||||
add_offset=random.choice(range(1, 851, 2)),
|
||||
limit=1,
|
||||
max_id=0,
|
||||
min_id=0,
|
||||
hash=0,
|
||||
),
|
||||
)
|
||||
await message.delete()
|
||||
await message.client.send_file(
|
||||
message.to_id,
|
||||
result.messages[0].media,
|
||||
reply_to=getattr(message, "reply_to_msg_id", None),
|
||||
)
|
||||
145
coddrago/modules/modlist.py
Normal file
145
coddrago/modules/modlist.py
Normal file
@@ -0,0 +1,145 @@
|
||||
# ---------------------------------------------------------------------------------
|
||||
#░█▀▄░▄▀▀▄░█▀▄░█▀▀▄░█▀▀▄░█▀▀▀░▄▀▀▄░░░█▀▄▀█
|
||||
#░█░░░█░░█░█░█░█▄▄▀░█▄▄█░█░▀▄░█░░█░░░█░▀░█
|
||||
#░▀▀▀░░▀▀░░▀▀░░▀░▀▀░▀░░▀░▀▀▀▀░░▀▀░░░░▀░░▒▀
|
||||
# Name: ModulesList.
|
||||
# Description: Channels of modules for userbot Hikka.
|
||||
# Author: @codrago
|
||||
# ---------------------------------------------------------------------------------
|
||||
|
||||
# 🔒 Licensed under the GNU AGPLv3
|
||||
# 🌐 https://www.gnu.org/licenses/agpl-3.0.html
|
||||
|
||||
# meta developer: @codrago_m
|
||||
# meta banner: https://raw.githubusercontent.com/coddrago/modules/refs/heads/main/banner.png
|
||||
# meta pic: https://envs.sh/HJH.webp
|
||||
# ---------------------------------------------------------------------------------
|
||||
|
||||
from telethon.types import Message
|
||||
|
||||
from .. import loader, utils
|
||||
|
||||
from datetime import datetime as dt
|
||||
import datetime
|
||||
import json
|
||||
import requests
|
||||
|
||||
|
||||
@loader.tds
|
||||
class ModulesList(loader.Module):
|
||||
"""Модуль для быстрого доступа к каналам с модулями"""
|
||||
|
||||
strings = {
|
||||
"name": "ModList",
|
||||
"setted": "Text successfully added",
|
||||
"added": "Chat <code>{}</code> added",
|
||||
"chat_added": "Chat already added!",
|
||||
"channels": (
|
||||
"<emoji document_id=5188377234380954537>🌘</emoji> Community-made modules\n"
|
||||
),
|
||||
"officialChannels": (
|
||||
"<emoji document_id=5188377234380954537>🌘</emoji> Community-made modules\n"
|
||||
"\n<emoji document_id=5445096582238181549>🦋</emoji> <b>@morisummermods</b>"
|
||||
"\n<emoji document_id=5449380056201697322>💚</emoji> <b>@nalinormods</b>"
|
||||
"\n<emoji document_id=5373026167722876724>🤩</emoji> <b>@AstroModules</b>"
|
||||
"\n<emoji document_id=5249042457731024510>💪</emoji> <b>@vsecoder_m</b>"
|
||||
"\n<emoji document_id=5371037748188683677>☺️</emoji> <b>@mm_mods</b>"
|
||||
"\n<emoji document_id=5370856741086960948>😈</emoji> <b>@apodiktum_modules</b>"
|
||||
"\n<emoji document_id=5370947515220761242>😇</emoji> <b>@wilsonmods</b>"
|
||||
"\n<emoji document_id=5467406098367521267>👑</emoji> <b>@DorotoroMods</b>"
|
||||
"\n<emoji document_id=5469986291380657759>✌️</emoji> <b>@HikkaFTGmods</b>"
|
||||
"\n<emoji document_id=5472091323571903308>🎈</emoji> <b>@nercymods</b>"
|
||||
"\n<emoji document_id=5298799263013151249>😐</emoji> <b>@sqlmerr_m</b>"
|
||||
"\n<emoji document_id=5231165412275668380>🥰</emoji> <b>@AuroraModules</b>"
|
||||
"\n<emoji document_id=5418360054338314186>📢</emoji> <b>@codrago_m</b>"
|
||||
),
|
||||
}
|
||||
strings_ru = {
|
||||
"name": "ModList",
|
||||
"setted": "Текст успешно поставлен",
|
||||
"added": "Чат <code>{}</code> добавлен",
|
||||
"chat_added": "Чат уже добавлен!",
|
||||
}
|
||||
|
||||
async def client_ready(self, client, db):
|
||||
self.db = db
|
||||
self._text = self.get("text", self.strings["channels"])
|
||||
self._offtext = self.get("offtext", self.strings["officialChannels"])
|
||||
self._floodwait: dict = self.get("floodwait", {})
|
||||
|
||||
def __init__(self):
|
||||
self.config = loader.ModuleConfig(
|
||||
loader.ConfigValue(
|
||||
"ids",
|
||||
[0],
|
||||
lambda: "айди где будет работать заметка BOT API ID REQUIRED",
|
||||
validator=loader.validators.Union(
|
||||
loader.validators.Series(), loader.validators.TelegramID()
|
||||
),
|
||||
),
|
||||
loader.ConfigValue(
|
||||
"linktodata",
|
||||
"https://github.com/coddrago/modules/raw/main/modules.json",
|
||||
lambda: 'link for modules',
|
||||
validator=loader.validators.Link()
|
||||
),
|
||||
)
|
||||
self._ids: list = self.config["ids"]
|
||||
|
||||
def get_data(self, official: bool=False, unofficial: bool=False):
|
||||
if official:
|
||||
data: dict = json.loads(
|
||||
requests.get(self.config['linktodata']).text
|
||||
)['official']
|
||||
elif unofficial:
|
||||
data: dict = json.loads(
|
||||
requests.get(self.config['linktodata']).text
|
||||
)['unofficial']
|
||||
|
||||
developers = []
|
||||
|
||||
for username, emoji in data.items():
|
||||
developers.append(f'{emoji} <b>@{username}</b>')
|
||||
|
||||
return developers
|
||||
|
||||
@loader.watcher()
|
||||
async def watcher_modules(self, message: Message):
|
||||
self._floodwait: dict = self.get("floodwait", {})
|
||||
if message.chat_id in self.config["ids"] and message.raw_text == "#modules":
|
||||
if message.from_id not in self._floodwait.keys():
|
||||
await message.reply(self._offtext)
|
||||
now = dt.now()
|
||||
fw_time = now + datetime.timedelta(seconds=3.5)
|
||||
self._floodwait.update({message.from_id: fw_time})
|
||||
else:
|
||||
time = self._floodwait.get(message.from_id)
|
||||
if dt.now() > time:
|
||||
self._floodwait.pop(message.from_id)
|
||||
|
||||
else:
|
||||
return
|
||||
|
||||
@loader.command(alias="mlist", ru_doc=" | Быстрый доступ к каналам с модулями ")
|
||||
async def modlist(self, message: Message):
|
||||
""" | Quick access to channels with modules"""
|
||||
devs_unoff = self.get_data(unofficial=True)
|
||||
devs_off = self.get_data(official=True)
|
||||
|
||||
await utils.answer(message, '\n'.join(devs_off + devs_unoff))
|
||||
|
||||
@loader.command(alias="offmlist", ru_doc=" | Оффициальные каналы с модулями ")
|
||||
async def offmodlist(self, message: Message):
|
||||
""" | Official channel with modules"""
|
||||
devs = self.get_data(official=True)
|
||||
|
||||
await utils.answer(message, '\n'.join(devs))
|
||||
|
||||
@loader.command(rudoc="[BOT API ID] | Добавить чат")
|
||||
async def addmchat(self, message: Message):
|
||||
"""[BOT API ID] | add chat"""
|
||||
if message.chat_id not in self.config["ids"]:
|
||||
self.config["ids"].append(message.chat_id)
|
||||
await utils.answer(message, self.strings["added"].format(message.chat_id))
|
||||
else:
|
||||
await utils.answer(message, self.strings["chat_added"])
|
||||
30
coddrago/modules/modules.json
Normal file
30
coddrago/modules/modules.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"official": {
|
||||
"hikarimods": "<emoji document_id=5370547013815376328>😶🌫️</emoji>",
|
||||
"morisummermods": "<emoji document_id=5445096582238181549>🦋</emoji>",
|
||||
"nalinormods": "<emoji document_id=5449380056201697322>💚</emoji>",
|
||||
"AstroModules": "<emoji document_id=5373026167722876724>🤩</emoji>",
|
||||
"vsecoder_m": "<emoji document_id=5249042457731024510>💪</emoji>",
|
||||
"mm_mods": "<emoji document_id=5371037748188683677>☺️</emoji>",
|
||||
"apodiktum_modules": "<emoji document_id=5370856741086960948>😈</emoji>",
|
||||
"wilsonmods": "<emoji document_id=5370947515220761242>😇</emoji>",
|
||||
"DorotoroMods": "<emoji document_id=5467406098367521267>👑</emoji>",
|
||||
"HikkaFTGMods": "<emoji document_id=5469986291380657759>✌️</emoji>",
|
||||
"nercymods": "<emoji document_id=5472091323571903308>🎈</emoji>",
|
||||
"sqlmerr_m": "<emoji document_id=5298799263013151249>😐</emoji>",
|
||||
"AuroraModules": "<emoji document_id=5296274178725396201>🥰</emoji>",
|
||||
"codrago_m": "<emoji document_id=5418360054338314186>📢</emoji>",
|
||||
"kmodules": "<emoji document_id=5370869711888194012>👾</emoji>",
|
||||
"hikka_mods": "<emoji document_id=5436024756610546212>⚡</emoji>",
|
||||
"famods": "<emoji document_id=5373141891321699086>😎</emoji>"
|
||||
},
|
||||
"unofficial": {
|
||||
"angellmodules": " <emoji document_id=5285445393646115760>😝</emoji>",
|
||||
"BHikkaMods": "<emoji document_id=5429400349377051725>😄</emoji>",
|
||||
"HikamoruMods": "<emoji document_id=5325842550362218999>😼</emoji>",
|
||||
"angellmodules": "<emoji document_id=5352962421273159283>👅</emoji>",
|
||||
"AmekaMods": "<emoji document_id=5264913427041631157>🦋</emoji>",
|
||||
"aki_modules": "<emoji document_id=4969741112429249159>🚨</emoji>",
|
||||
"unneyon_hmods": "<emoji document_id=5474304919651491706>🎻</emoji>"
|
||||
}
|
||||
}
|
||||
62
coddrago/modules/passwordgen.py
Normal file
62
coddrago/modules/passwordgen.py
Normal file
@@ -0,0 +1,62 @@
|
||||
# ---------------------------------------------------------------------------------
|
||||
#░█▀▄░▄▀▀▄░█▀▄░█▀▀▄░█▀▀▄░█▀▀▀░▄▀▀▄░░░█▀▄▀█
|
||||
#░█░░░█░░█░█░█░█▄▄▀░█▄▄█░█░▀▄░█░░█░░░█░▀░█
|
||||
#░▀▀▀░░▀▀░░▀▀░░▀░▀▀░▀░░▀░▀▀▀▀░░▀▀░░░░▀░░▒▀
|
||||
# Name: Password Generator
|
||||
# Description: Generate password
|
||||
# Author: @codrago_m
|
||||
# ---------------------------------------------------------------------------------
|
||||
# 🔒 Licensed under the GNU AGPLv3
|
||||
# 🌐 https://www.gnu.org/licenses/agpl-3.0.html
|
||||
# ---------------------------------------------------------------------------------
|
||||
# Author: @codrago
|
||||
# Commands: pass, passg
|
||||
# meta developer: @codrago_m
|
||||
# meta banner: https://raw.githubusercontent.com/coddrago/modules/refs/heads/main/banner.png
|
||||
# meta pic: https://envs.sh/Hoe.webp
|
||||
# ---------------------------------------------------------------------------------
|
||||
|
||||
from .. import loader, utils
|
||||
import string
|
||||
import random
|
||||
|
||||
@loader.tds
|
||||
class PassGen(loader.Module):
|
||||
"""Generate password"""
|
||||
|
||||
strings = {
|
||||
"name": "PassGen",
|
||||
"no_args": "<emoji document_id=5328145443106873128>✖️</emoji> <b>Where args?</b>",
|
||||
"pass": "<emoji document_id=5832546462478635761>🔒</emoji> <b>Here your password:</b> ",
|
||||
}
|
||||
|
||||
strings_ru = {
|
||||
"no_args": "<emoji document_id=5328145443106873128>✖️</emoji> <b>Где аргументы?</b>",
|
||||
"pass": "<emoji document_id=5832546462478635761>🔒</emoji> <b>Твой пароль:</b> ",
|
||||
}
|
||||
|
||||
@loader.command()
|
||||
async def passcmd(self, message):
|
||||
"""| Generate password from utils"""
|
||||
|
||||
args = int(utils.get_args_raw(message))
|
||||
password = utils.rand(args)
|
||||
|
||||
if not args:
|
||||
await utils.answer(message, self.strings["no_args"])
|
||||
else:
|
||||
await utils.answer(message, f"{self.strings['pass']},<code>{password}</code>")
|
||||
|
||||
@loader.command()
|
||||
async def passgcmd(self, message):
|
||||
"""| Generate password from string"""
|
||||
|
||||
args = int(utils.get_args_raw(message))
|
||||
characters = string.ascii_letters + string.digits + string.punctuation
|
||||
password = ''.join(random.choice(characters) for _ in range(args))
|
||||
|
||||
if not args:
|
||||
await utils.answer(message, self.strings["no_args"])
|
||||
else:
|
||||
await utils.answer(message, f"{self.strings['pass']}, <code>{password}</code>")
|
||||
|
||||
48
coddrago/modules/pinterest.py
Normal file
48
coddrago/modules/pinterest.py
Normal file
@@ -0,0 +1,48 @@
|
||||
# ---------------------------------------------------------------------------------
|
||||
#░█▀▄░▄▀▀▄░█▀▄░█▀▀▄░█▀▀▄░█▀▀▀░▄▀▀▄░░░█▀▄▀█
|
||||
#░█░░░█░░█░█░█░█▄▄▀░█▄▄█░█░▀▄░█░░█░░░█░▀░█
|
||||
#░▀▀▀░░▀▀░░▀▀░░▀░▀▀░▀░░▀░▀▀▀▀░░▀▀░░░░▀░░▒▀
|
||||
# Name: PinterestDownloader
|
||||
# Description: Gives a link to download a file from Pinterest
|
||||
# Author: @codrago_m
|
||||
# ---------------------------------------------------------------------------------
|
||||
# 🔒 Licensed under the GNU AGPLv3
|
||||
# 🌐 https://www.gnu.org/licenses/agpl-3.0.html
|
||||
# ---------------------------------------------------------------------------------
|
||||
# Author: @codrago
|
||||
# Commands: pinterest
|
||||
# scope: hikka_only
|
||||
# meta developer: @codrago_m
|
||||
# meta banner: https://raw.githubusercontent.com/coddrago/modules/refs/heads/main/banner.png
|
||||
# meta pic: https://envs.sh/HJV.webp
|
||||
# ---------------------------------------------------------------------------------
|
||||
|
||||
__version__ = (1, 0, 0)
|
||||
|
||||
from .. import loader, utils
|
||||
|
||||
@loader.tds
|
||||
class PinterestDownloader(loader.Module):
|
||||
"""Gives a link to download a file from Pinterest"""
|
||||
|
||||
strings = {
|
||||
"name": "PinterestDownloader",
|
||||
"Error": "<emoji document_id=5328145443106873128>✖️</emoji> Where args?",
|
||||
}
|
||||
|
||||
strings_ru = {
|
||||
"Error": "<emoji document_id=5328145443106873128>✖️</emoji> Где аргументы?"
|
||||
}
|
||||
|
||||
async def pinterestcmd(self, message):
|
||||
"""Gives a link to download"""
|
||||
|
||||
args = utils.get_args_raw(message)
|
||||
link = f"https://pinterestdownloader.com?share_url={args}"
|
||||
|
||||
if not args:
|
||||
await utils.answer(message, self.strings["Error"])
|
||||
elif 'pin.it' in args:
|
||||
await utils.answer(message, f'<emoji document_id=5319172556345851345>✨</emoji> <b><u>Pin ready to download!</u></b>\n\n<emoji document_id=5316719099227684154>🌕</emoji> <b>Link for download:</b> <i><a href="{link}">just tap here</a></i>')
|
||||
else:
|
||||
await utils.answer(message, f"<emoji document_id=5319088379281815108>🤷♀️</emoji> '{args}' <b>No have</b> 'pin.it' \n\n<b>Link is invalid</b>")
|
||||
174
coddrago/modules/pmban.py
Normal file
174
coddrago/modules/pmban.py
Normal file
@@ -0,0 +1,174 @@
|
||||
# ---------------------------------------------------------------------------------
|
||||
# ░█▀▄░▄▀▀▄░█▀▄░█▀▀▄░█▀▀▄░█▀▀▀░▄▀▀▄░░░█▀▄▀█
|
||||
# ░█░░░█░░█░█░█░█▄▄▀░█▄▄█░█░▀▄░█░░█░░░█░▀░█
|
||||
# ░▀▀▀░░▀▀░░▀▀░░▀░▀▀░▀░░▀░▀▀▀▀░░▀▀░░░░▀░░▒▀
|
||||
#
|
||||
# _____ _ _
|
||||
# | ____|_ _| |_| |_ __ _ ___ _ _
|
||||
# | _| \ \/ / __| __/ _` / __| | | |
|
||||
# | |___ > <| |_| || (_| \__ \ |_| |
|
||||
# |_____/_/\_\\__|\__\__,_|___/\__, |
|
||||
# |___/
|
||||
# Name: PMBan
|
||||
# Description: Ban in pm for time
|
||||
# Author: @codrago_m, @exttasy1
|
||||
# ---------------------------------------------------------------------------------
|
||||
# 🔒 Licensed under the GNU AGPLv3
|
||||
# 🌐 https://www.gnu.org/licenses/agpl-3.0.html
|
||||
# ---------------------------------------------------------------------------------
|
||||
# Author: @codrago, @exttasy1
|
||||
# Commands: pmban, pmunban
|
||||
# scope: hikka_only
|
||||
# meta developer: @codrago_m, @exttasy1
|
||||
# meta banner: https://raw.githubusercontent.com/coddrago/modules/refs/heads/main/banner.png
|
||||
# meta pic: https://envs.sh/Hoh.webp
|
||||
# ---------------------------------------------------------------------------------
|
||||
|
||||
__version__ = (1, 0, 0)
|
||||
|
||||
from .. import loader, utils
|
||||
import telethon, asyncio, re, pymorphy2, math, time, logging
|
||||
from apscheduler.schedulers.asyncio import AsyncIOScheduler
|
||||
|
||||
logging.getLogger('apscheduler').setLevel(logging.WARNING)
|
||||
logging.getLogger('pymorphy2').setLevel(logging.WARNING)
|
||||
|
||||
@loader.tds
|
||||
class PMBan(loader.Module):
|
||||
"""Ban in pm for time"""
|
||||
|
||||
strings = {
|
||||
"name": "PMBan",
|
||||
}
|
||||
|
||||
@staticmethod
|
||||
def _pluralize(morph, count, word):
|
||||
word_morph = morph.parse(word)[0]
|
||||
return word_morph.make_agree_with_number(count).word
|
||||
|
||||
def format_time(self, seconds):
|
||||
morph = pymorphy2.MorphAnalyzer()
|
||||
|
||||
if seconds < 0 or seconds == 0:
|
||||
return "forever"
|
||||
|
||||
days = math.floor(seconds / (60 * 60 * 24))
|
||||
seconds %= (60 * 60 * 24)
|
||||
hours = math.floor(seconds / (60 * 60))
|
||||
seconds %= (60 * 60)
|
||||
minutes = math.floor(seconds / 60)
|
||||
seconds = math.floor(seconds % 60)
|
||||
|
||||
time_parts = []
|
||||
if days > 0:
|
||||
time_parts.append(f"for {days} {self._pluralize(morph, days, 'day')}")
|
||||
if hours > 0:
|
||||
time_parts.append(f"for {hours} {self._pluralize(morph, hours, 'hour')}")
|
||||
if minutes > 0:
|
||||
time_parts.append(f"for {minutes} {self._pluralize(morph, minutes, 'minute')}")
|
||||
if seconds > 0 or not time_parts:
|
||||
time_parts.append(f"for {seconds} {self._pluralize(morph, seconds, 'second')}")
|
||||
|
||||
return " ".join(time_parts)
|
||||
|
||||
|
||||
@staticmethod
|
||||
def convert_time(text: str) -> int:
|
||||
try:
|
||||
if not str(text)[:-1].isdigit():
|
||||
return 0
|
||||
|
||||
if "d" in str(text):
|
||||
text = int(text[:-1]) * 60 * 60 * 24
|
||||
|
||||
if "h" in str(text):
|
||||
text = int(text[:-1]) * 60 * 60
|
||||
|
||||
if "m" in str(text):
|
||||
text = int(text[:-1]) * 60
|
||||
|
||||
if "s" in str(text):
|
||||
text = int(text[:-1])
|
||||
|
||||
text = int(re.sub(r"[^0-9]", "", str(text)))
|
||||
except ValueError:
|
||||
return 0
|
||||
|
||||
return text
|
||||
|
||||
|
||||
async def loop_unban(self):
|
||||
ban_list = self.get('ban_list')
|
||||
|
||||
for user in ban_list:
|
||||
user_id, time_ban = next(iter(user.items()))
|
||||
|
||||
if time_ban[0] <= 0:
|
||||
continue
|
||||
|
||||
end_ban = time_ban[0] + time_ban[1]
|
||||
|
||||
if end_ban <= time.time():
|
||||
await self.client(telethon.tl.functions.contacts.UnblockRequest(id=int(user_id)))
|
||||
await self.client.send_message(int(user_id), f"<b><emoji document_id=5021905410089550576>✅</emoji> You have been successfully unbanned.</b>")
|
||||
|
||||
ban_list = [d for d in ban_list if int(user_id) not in d]
|
||||
self.set('ban_list', ban_list)
|
||||
|
||||
|
||||
async def client_ready(self):
|
||||
if not (ban_list := self.get('ban_list')) or not isinstance(ban_list, list): self.set('ban_list', [])
|
||||
self.scheduler = AsyncIOScheduler()
|
||||
self.scheduler.add_job(self.loop_unban, 'interval', seconds=3)
|
||||
self.scheduler.start()
|
||||
|
||||
async def on_unload(self):
|
||||
self.scheduler.shutdown()
|
||||
|
||||
|
||||
@loader.command()
|
||||
async def pmban(self, message):
|
||||
"""| ban in PM for time"""
|
||||
|
||||
if not (args := utils.get_args_raw(message)):
|
||||
stime = 0
|
||||
|
||||
ban_list = self.get('ban_list')
|
||||
|
||||
if any(message.chat_id in d for d in ban_list):
|
||||
await utils.answer(message, f"<b><emoji document_id=5980953710157632545>❌</emoji> User already has been banned</b>")
|
||||
return
|
||||
|
||||
if args:
|
||||
stime = self.convert_time(args)
|
||||
str_time = self.format_time(seconds=stime).replace("minutes", "minute").replace("second", "second")
|
||||
|
||||
await self.client(telethon.tl.functions.contacts.BlockRequest(id=message.chat_id))
|
||||
|
||||
await utils.answer(message, f"<b><emoji document_id=5021905410089550576>✅</emoji> User succesfully banned {str_time}.</b>")
|
||||
|
||||
ban_list.append({message.chat_id: [stime, int(time.time())]})
|
||||
self.set('ban_list', ban_list)
|
||||
|
||||
|
||||
@loader.command()
|
||||
async def pmunban(self, message):
|
||||
"""| unban in PM"""
|
||||
ban_list = self.get('ban_list')
|
||||
|
||||
print(ban_list)
|
||||
reply = await message.get_reply_message()
|
||||
|
||||
if not reply:
|
||||
await utils.answer(message, f"<b><emoji document_id=5980953710157632545>❌</emoji> User not found, please write this command in response to user messages.</b>")
|
||||
return
|
||||
|
||||
if not any(reply.from_id in d for d in ban_list):
|
||||
await utils.answer(message, f"<b><emoji document_id=5980953710157632545>❌</emoji> User not banned</b>")
|
||||
return
|
||||
|
||||
await self.client(telethon.tl.functions.contacts.UnblockRequest(id=reply.from_id))
|
||||
await utils.answer(message, f"<b><emoji document_id=5021905410089550576>✅</emoji> User succesfully unbanned.</b>")
|
||||
|
||||
ban_list = [d for d in ban_list if reply.from_id not in d]
|
||||
self.set('ban_list', ban_list)
|
||||
97
coddrago/modules/promoclaimer.py
Normal file
97
coddrago/modules/promoclaimer.py
Normal file
@@ -0,0 +1,97 @@
|
||||
# ---------------------------------------------------------------------------------
|
||||
# ░█▀▄░▄▀▀▄░█▀▄░█▀▀▄░█▀▀▄░█▀▀▀░▄▀▀▄░░░█▀▄▀█
|
||||
# ░█░░░█░░█░█░█░█▄▄▀░█▄▄█░█░▀▄░█░░█░░░█░▀░█
|
||||
# ░▀▀▀░░▀▀░░▀▀░░▀░▀▀░▀░░▀░▀▀▀▀░░▀▀░░░░▀░░▒▀
|
||||
# Name: PromoClaimer
|
||||
# Description: Automatically claim https://t.me/StableWaifuBot promo from any chat
|
||||
# Author: @codrago_m
|
||||
# ---------------------------------------------------------------------------------
|
||||
# 🔒 Licensed under the GNU AGPLv3
|
||||
# 🌐 https://www.gnu.org/licenses/agpl-3.0.html
|
||||
# ---------------------------------------------------------------------------------
|
||||
# Author: @codrago
|
||||
# Commands: checktokens
|
||||
# scope: hikka_only
|
||||
# meta developer: @codrago_m
|
||||
# meta banner: https://raw.githubusercontent.com/coddrago/modules/refs/heads/main/banner.png
|
||||
# meta pic: https://envs.sh/HoF.webp
|
||||
# ---------------------------------------------------------------------------------
|
||||
|
||||
__version__ = (1, 0, 0)
|
||||
|
||||
import logging
|
||||
|
||||
from telethon.errors import AlreadyInConversationError
|
||||
from telethon.tl.types import Message
|
||||
import re
|
||||
|
||||
from .. import loader, utils
|
||||
|
||||
logger = logging.getLogger('PromoClaimer')
|
||||
|
||||
@loader.tds
|
||||
class PromoClaimerMod(loader.Module):
|
||||
"""Automatically claim https://t.me/StableWaifuBot promo from any chat"""
|
||||
strings = {
|
||||
"name": "PromoClaimer",
|
||||
"claimed_promo": "[PromoClaimer] 👌 I successfully claimed promo {promo} for {amount} tokens!",
|
||||
"error_watcher": "[PromoClaimer] ⛔️ An error occurred while watching for messages:\n{e}",
|
||||
"invalid_promo": "[PromoClaimer] 😢 Promo code {promo} is invalid!",
|
||||
"already_claimed": "[PromoClaimer] 😢 Promo code {promo} has already been claimed!",
|
||||
}
|
||||
|
||||
strings_ru = {
|
||||
"claimed_promo": "[PromoClaimer] 👌 Я успешно активировал промокод {promo} на {amount} токен(-ов)!",
|
||||
"error_watcher": "[PromoClaimer] ⛔️ Во время отслеживания сообщений произошла ошибка:\n{e}",
|
||||
"invalid_promo": "[PromoClaimer] 😢 Промокод {promo} недействителен, либо уже истек!",
|
||||
"already_claimed": "[PromoClaimer] 😢 Промокод {promo} уже активирован!",
|
||||
"_cls_doc": "Автоматически забирать промокоды для https://t.me/StableWaifuBot",
|
||||
}
|
||||
|
||||
@loader.command(ru_doc='| Посмотреть баланс токенов')
|
||||
async def checktokens(self, message: Message):
|
||||
"""| check tokens balance"""
|
||||
|
||||
try:
|
||||
async with self.client.conversation('@StableWaifuBot') as conv:
|
||||
msg = await conv.send_message('/tokens')
|
||||
response = await conv.get_response()
|
||||
tokens = response.text.splitlines()[0]
|
||||
await conv.mark_read()
|
||||
await msg.delete()
|
||||
await response.delete()
|
||||
|
||||
await utils.answer(message, tokens)
|
||||
|
||||
except AlreadyInConversationError:
|
||||
pass
|
||||
|
||||
@loader.watcher()
|
||||
async def watcher(self, message: Message):
|
||||
try:
|
||||
pattern = r'https://t\.me/StableWaifuBot\?start=promo_(\w+)'
|
||||
matches = re.findall(pattern, message.text)
|
||||
|
||||
for match in matches:
|
||||
async with self.client.conversation('StableWaifuBot') as conv:
|
||||
promo = 'promo_' + match
|
||||
msg = await conv.send_message(f'/start {promo}')
|
||||
response = await conv.get_response()
|
||||
|
||||
await conv.mark_read()
|
||||
await msg.delete()
|
||||
await response.delete()
|
||||
if response.text == '🥲 Промокод недействителен или уже истёк!':
|
||||
logger.info(self.strings("invalid_promo").format(promo=promo))
|
||||
elif response.text == '❌ Этот промокод уже активирован, проверь выше!':
|
||||
logger.info(self.strings('already_claimed').format(promo=promo))
|
||||
|
||||
else:
|
||||
amount = response.text.split('(+')[1]
|
||||
logger.info(self.strings('claimed_promo').format(promo=promo, amount=amount))
|
||||
|
||||
except Exception as e:
|
||||
logger.info(self.strings('error_watcher').format(e=str(e)))
|
||||
|
||||
|
||||
|
||||
62
coddrago/modules/randnum.py
Normal file
62
coddrago/modules/randnum.py
Normal file
@@ -0,0 +1,62 @@
|
||||
# ---------------------------------------------------------------------------------
|
||||
#░█▀▄░▄▀▀▄░█▀▄░█▀▀▄░█▀▀▄░█▀▀▀░▄▀▀▄░░░█▀▄▀█
|
||||
#░█░░░█░░█░█░█░█▄▄▀░█▄▄█░█░▀▄░█░░█░░░█░▀░█
|
||||
#░▀▀▀░░▀▀░░▀▀░░▀░▀▀░▀░░▀░▀▀▀▀░░▀▀░░░░▀░░▒▀
|
||||
# Name: RandomNumbers
|
||||
# Description:
|
||||
# Author: @codrago
|
||||
# ---------------------------------------------------------------------------------
|
||||
|
||||
# 🔒 Licensed under the GNU AGPLv3
|
||||
# 🌐 https://www.gnu.org/licenses/agpl-3.0.html
|
||||
|
||||
# meta developer: @codrago_m
|
||||
# meta banner: https://raw.githubusercontent.com/coddrago/modules/refs/heads/main/banner.png
|
||||
# meta pic: https://envs.sh/HJ7.webp
|
||||
# ---------------------------------------------------------------------------------
|
||||
|
||||
from .. import loader, utils
|
||||
import requests, random
|
||||
|
||||
class RandomNumbersMod(loader.Module):
|
||||
"""Развлекательный модуль"""
|
||||
|
||||
strings = {"name": "RandomNumbers"}
|
||||
|
||||
def __init__(self):
|
||||
self.config = loader.ModuleConfig(
|
||||
loader.ConfigValue(
|
||||
"min_num",
|
||||
1,
|
||||
lambda: "минимальное число для рандома",
|
||||
validator=loader.validators.Integer(minimum=0),
|
||||
),
|
||||
|
||||
loader.ConfigValue(
|
||||
"max_num",
|
||||
6,
|
||||
lambda: "Максимальное число для рандома",
|
||||
validator=loader.validators.Integer(minimum=1)
|
||||
),
|
||||
)
|
||||
|
||||
async def rnumcmd(self, message):
|
||||
"""Угадывайте рандомные числа!"""
|
||||
min_num = min(self.config["min_num"], self.config["max_num"])
|
||||
max_num = max(self.config["min_num"], self.config["max_num"])
|
||||
num = random.randint(min_num, max_num)
|
||||
args = utils.get_args_raw(message)
|
||||
if not args:
|
||||
await utils.answer(message, f"Где аргументы?\nВведите число в радуисе {min_num} - {max_num}")
|
||||
return
|
||||
if min_num >= max_num:
|
||||
await utils.answer(message, "Ебанутый, не ломай мне модуль! Сделай минимальное число меньше максимального.")
|
||||
return
|
||||
if num == int(args):
|
||||
await utils.answer(message, f"Поздравляю! Вы угадали число!\nЧислом было: {num}")
|
||||
return
|
||||
else:
|
||||
await utils.answer(message, f"Вы не угадали число!\nЧислом было: {num}")
|
||||
return
|
||||
|
||||
|
||||
121
coddrago/modules/randomizer.py
Normal file
121
coddrago/modules/randomizer.py
Normal file
@@ -0,0 +1,121 @@
|
||||
# ---------------------------------------------------------------------------------
|
||||
#░█▀▄░▄▀▀▄░█▀▄░█▀▀▄░█▀▀▄░█▀▀▀░▄▀▀▄░░░█▀▄▀█
|
||||
#░█░░░█░░█░█░█░█▄▄▀░█▄▄█░█░▀▄░█░░█░░░█░▀░█
|
||||
#░▀▀▀░░▀▀░░▀▀░░▀░▀▀░▀░░▀░▀▀▀▀░░▀▀░░░░▀░░▒▀
|
||||
# Name: randomizer
|
||||
# Description: Random it your life!
|
||||
# Author: @codrago_m
|
||||
# ---------------------------------------------------------------------------------
|
||||
# 🔒 Licensed under the GNU AGPLv3
|
||||
# 🌐 https://www.gnu.org/licenses/agpl-3.0.html
|
||||
# ---------------------------------------------------------------------------------
|
||||
# Author: @codrago
|
||||
# Commands: id, chatid, userid
|
||||
# scope: hikka_only
|
||||
# meta developer: @codrago_m
|
||||
# meta banner: https://raw.githubusercontent.com/coddrago/modules/refs/heads/main/banner.png
|
||||
# meta pic: https://envs.sh/HJy.webp
|
||||
# ---------------------------------------------------------------------------------
|
||||
|
||||
__version__ = (1, 0, 0)
|
||||
|
||||
from .. import loader, utils
|
||||
import random
|
||||
from telethon.tl.types import InputPeerChannel
|
||||
|
||||
@loader.tds
|
||||
class Randomizer(loader.Module):
|
||||
"""Random - it's life!"""
|
||||
strings = {
|
||||
"name": "Randomizer",
|
||||
"not_args": "<emoji document_id=5328145443106873128>✖️</emoji> Your arguments were not stated.",
|
||||
"Num1": "Number 1 for RandomCMD",
|
||||
"Num2": "Number 2 for RandomCMD",
|
||||
"Not_chat": "<emoji document_id=5328145443106873128>✖️</emoji> This is not a chat!",
|
||||
"Error_num": "<emoji document_id=5328145443106873128>✖️</emoji> Error with numbers! Check your config",
|
||||
}
|
||||
|
||||
strings_ru = {
|
||||
"not_args": "<emoji document_id=5328145443106873128>✖️</emoji> Ваши аргументы не были указаны.",
|
||||
"Num1": "Число 1 для RandomCMD",
|
||||
"Num2": "Число 2 для RandomCMD",
|
||||
"Not_chat": "<emoji document_id=5328145443106873128>✖️</emoji> Это не чат!",
|
||||
"Error_num": "<emoji document_id=5328145443106873128>✖️</emoji> Ошибка с числами! Проверьте ваш конфиг",
|
||||
}
|
||||
|
||||
|
||||
def __init__(self):
|
||||
self.config = loader.ModuleConfig(
|
||||
loader.ConfigValue(
|
||||
"Num_1",
|
||||
1,
|
||||
lambda: self.strings["Num1"],
|
||||
),
|
||||
|
||||
loader.ConfigValue(
|
||||
"Num_2",
|
||||
10,
|
||||
lambda: self.strings["Num2"],
|
||||
),
|
||||
)
|
||||
|
||||
async def chancecmd(self, message):
|
||||
"""[args] | A chance for your success!"""
|
||||
|
||||
args = utils.get_args_raw(message)
|
||||
chance = random.randint(1, 100)
|
||||
|
||||
if not args:
|
||||
await utils.answer(message, self.strings["not_args"])
|
||||
else:
|
||||
await utils.answer(message, f"<emoji document_id=5298620403395074835>🤩</emoji> The chance that {args} is equal to {chance}%!")
|
||||
|
||||
async def randomcmd(self, message):
|
||||
"""!cfg | random number"""
|
||||
|
||||
min_num = min(self.config["Num_1"], self.config["Num_2"])
|
||||
max_num = max(self.config["Num_1"], self.config["Num_2"])
|
||||
random_num = random.randint(min_num, max_num)
|
||||
|
||||
if min_num >= max_num:
|
||||
await utils.answer(message, self.strings["Error_Num"])
|
||||
else:
|
||||
await utils.answer(message, f"<emoji document_id=5406611523487411073>😇</emoji> Your random number in the range {min_num} - {max_num}: {random_num}")
|
||||
|
||||
async def shipcmd(self, message):
|
||||
"""| Ship from iris?"""
|
||||
|
||||
chat = message.peer_id
|
||||
channel = await self.client.get_entity(chat)
|
||||
participants = await self.client.get_participants(channel)
|
||||
random_user = random.choice(participants)
|
||||
random_user2 = random.choice(participants)
|
||||
user = random_user.id
|
||||
user_name = random_user.first_name
|
||||
user2 = random_user2.id
|
||||
user_name2 = random_user2.first_name
|
||||
loh_a = f'<a href = "tg://user?id={user}">{user_name}</a>'
|
||||
loh_b = f'<a href = "tg://user?id={user2}">{user_name2}</a>'
|
||||
if message.is_private:
|
||||
await utils.answer(message, self.strings["Not_chat"])
|
||||
else:
|
||||
await utils.answer(message, f'<emoji document_id=5341674117642854617>❤️</emoji> Random ship: {loh_a} + {loh_b}\n\n<emoji document_id=5341364514925321015>🌹</emoji> Love and appreciate each other!')
|
||||
|
||||
async def randusercmd(self, message):
|
||||
"""| Random user!"""
|
||||
|
||||
chat = message.peer_id
|
||||
channel = await self.client.get_entity(chat)
|
||||
participants = await self.client.get_participants(channel)
|
||||
random_user = random.choice(participants)
|
||||
user = random_user.id
|
||||
user_name = random_user.first_name
|
||||
|
||||
if message.is_private:
|
||||
await utils.answer(message, self.strings["Not_chat"])
|
||||
else:
|
||||
await utils.answer(message, f'<emoji document_id=5287404392654319394>🔥</emoji> Your random user: <a href = "tg://user?id={user}">{user_name}</a>')
|
||||
|
||||
|
||||
|
||||
|
||||
74
coddrago/modules/send.py
Normal file
74
coddrago/modules/send.py
Normal file
@@ -0,0 +1,74 @@
|
||||
# ---------------------------------------------------------------------------------
|
||||
#░█▀▄░▄▀▀▄░█▀▄░█▀▀▄░█▀▀▄░█▀▀▀░▄▀▀▄░░░█▀▄▀█
|
||||
#░█░░░█░░█░█░█░█▄▄▀░█▄▄█░█░▀▄░█░░█░░░█░▀░█
|
||||
#░▀▀▀░░▀▀░░▀▀░░▀░▀▀░▀░░▀░▀▀▀▀░░▀▀░░░░▀░░▒▀
|
||||
# Name: send
|
||||
# Description: феля не бей меня попросили
|
||||
# Author: @codrago_m
|
||||
# ---------------------------------------------------------------------------------
|
||||
# 🔒 Licensed under the GNU AGPLv3
|
||||
# 🌐 https://www.gnu.org/licenses/agpl-3.0.html
|
||||
# ---------------------------------------------------------------------------------
|
||||
# Author: @codrago
|
||||
# Commands: id, chatid, userid
|
||||
# scope: hikka_only
|
||||
# meta developer: @codrago_m
|
||||
# meta banner: https://raw.githubusercontent.com/coddrago/modules/refs/heads/main/banner.png
|
||||
# meta pic: https://kappa.lol/p3wVI
|
||||
# ---------------------------------------------------------------------------------
|
||||
|
||||
from .. import utils, loader
|
||||
|
||||
@loader.tds
|
||||
class Send(loader.Module):
|
||||
"""| module to send messages"""
|
||||
|
||||
strings = {
|
||||
"name": "Send",
|
||||
"no_args": "<b>Where args?</b>",
|
||||
"nobody_s": "<b>Who should i send it to?</b>",
|
||||
"succesfully_send": "<b>Message succesfully sended</b>",
|
||||
}
|
||||
|
||||
@loader.command()
|
||||
async def send(self, message):
|
||||
"""[user] [text] | Send message to user"""
|
||||
|
||||
try:
|
||||
args = utils.get_args_raw(message)
|
||||
reply = await message.get_reply_message()
|
||||
user = str(args.split(" ")[0])
|
||||
msg = str(args.split(" ", maxsplit=1)[1])
|
||||
|
||||
if msg != None:
|
||||
await self.client.send_message(user, msg)
|
||||
await utils.answer(message, self.strings["succesfully_send"])
|
||||
else:
|
||||
await utils.answer(message, self.strings["no_args"])
|
||||
except Exception as e:
|
||||
await utils.answer(message, f"<pre><code class='language-python'>{e}</code></pre>")
|
||||
|
||||
@loader.command()
|
||||
async def sendsm(self, message):
|
||||
"""[reply or text] | send message to saved messages"""
|
||||
|
||||
try:
|
||||
args = utils.get_args_raw(message)
|
||||
reply = await message.get_reply_message()
|
||||
user = message.sender_id
|
||||
msg = []
|
||||
|
||||
for i in args:
|
||||
msg.append(i)
|
||||
|
||||
if len(msg) <= 1:
|
||||
msgsend = reply
|
||||
else:
|
||||
msgsend = utils.get_args_raw(message)
|
||||
if msgsend:
|
||||
await self.client.send_message(user, msgsend)
|
||||
await utils.answer(message, self.strings["succesfully_send"])
|
||||
else:
|
||||
await utils.answer(message, self.strings["no_args"])
|
||||
except Exception as e:
|
||||
await utils.answer(message, f"<pre><code class='language-python'>{e}</code></pre>")
|
||||
74
coddrago/modules/speedtest.py
Normal file
74
coddrago/modules/speedtest.py
Normal file
@@ -0,0 +1,74 @@
|
||||
# ---------------------------------------------------------------------------------
|
||||
#░█▀▄░▄▀▀▄░█▀▄░█▀▀▄░█▀▀▄░█▀▀▀░▄▀▀▄░░░█▀▄▀█
|
||||
#░█░░░█░░█░█░█░█▄▄▀░█▄▄█░█░▀▄░█░░█░░░█░▀░█
|
||||
#░▀▀▀░░▀▀░░▀▀░░▀░▀▀░▀░░▀░▀▀▀▀░░▀▀░░░░▀░░▒▀
|
||||
# Name: Speedtest
|
||||
# Description: Module to run speedtest using speedtest library
|
||||
# Author: @codrago_m
|
||||
# ---------------------------------------------------------------------------------
|
||||
# 🔒 Licensed under the GNU AGPLv3
|
||||
# 🌐 https://www.gnu.org/licenses/agpl-3.0.html
|
||||
# ---------------------------------------------------------------------------------
|
||||
# Author: @codrago
|
||||
# Commands: speedtest
|
||||
# scope: hikka_only
|
||||
# meta developer: @codrago_m
|
||||
# requires: speedtest-cli
|
||||
# meta banner: https://raw.githubusercontent.com/coddrago/modules/refs/heads/main/banner.png
|
||||
# meta pic: https://envs.sh/HoD.webp
|
||||
# ---------------------------------------------------------------------------------
|
||||
|
||||
import speedtest
|
||||
from .. import loader, utils
|
||||
|
||||
@loader.tds
|
||||
class SpeedTestMod(loader.Module):
|
||||
"""Module to run speedtest using speedtest library"""
|
||||
|
||||
strings = {
|
||||
"name": "SpeedTest",
|
||||
"running": "<emoji document_id=5870718740236079262>🌐</emoji> <b>Running speedtest...</b>",
|
||||
"results": "<emoji document_id=5870718740236079262>🌐</emoji> <b>Speedtest Results:</b>\n\n"
|
||||
"<emoji document_id=5870718740236079262>🌐</emoji> <b>Download:</b> <code>{download} Mbps</code>\n"
|
||||
"<emoji document_id=5870729082517328189>📊</emoji> <b>Upload:</b> <code>{upload} Mbps</code>\n"
|
||||
"<emoji document_id=5222108309795908493>✨</emoji> <b>Ping:</b> {ping} ms",
|
||||
"error": "🚫 <b>Error running speedtest:</b> <code>{error}</code>",
|
||||
}
|
||||
|
||||
strings_ru = {
|
||||
"running": "<emoji document_id=5870718740236079262>🌐</emoji> <b>Запуск теста скорости...</b>",
|
||||
"results": "<emoji document_id=5870718740236079262>🌐</emoji> <b>Результаты теста скорости:</b>\n\n"
|
||||
"<emoji document_id=5870718740236079262>🌐</emoji> <b>Скачивание:</b> <code>{download} Мбит/с</code>\n"
|
||||
"<emoji document_id=5870729082517328189>📊</emoji> <b>Загрузка:</b> <code>{upload} Мбит/с</code>\n"
|
||||
"<emoji document_id=5222108309795908493>✨</emoji> Пинг: {ping} мс",
|
||||
"error": "🚫 <b>Ошибка при запуске теста скорости:</b> <code>{error}</code>",
|
||||
}
|
||||
|
||||
async def client_ready(self, client, db):
|
||||
self.client = client
|
||||
|
||||
async def speedtestcmd(self, message):
|
||||
"""Speedtest of your server internet"""
|
||||
await utils.answer(message, self.strings("running"))
|
||||
|
||||
try:
|
||||
st = speedtest.Speedtest()
|
||||
st.download()
|
||||
st.upload()
|
||||
results = st.results.dict()
|
||||
|
||||
download = results["download"] / 1_000_000 # Convert to Mbps
|
||||
upload = results["upload"] / 1_000_000 # Convert to Mbps
|
||||
ping = results["ping"]
|
||||
|
||||
await utils.answer(
|
||||
message,
|
||||
self.strings("results").format(
|
||||
ping=round(ping, 2),
|
||||
download=round(download, 2),
|
||||
upload=round(upload, 2)
|
||||
)
|
||||
)
|
||||
except Exception as e:
|
||||
await utils.answer(message, self.strings("error").format(error=str(e)))
|
||||
|
||||
Reference in New Issue
Block a user