mirror of
https://github.com/MuRuLOSE/limoka.git
synced 2026-06-16 14:34:17 +02:00
Commited backup
This commit is contained in:
44
shadowhikka/sh.modules/100Percent.py
Normal file
44
shadowhikka/sh.modules/100Percent.py
Normal file
@@ -0,0 +1,44 @@
|
||||
# █▀ █░█ ▄▀█ █▀▄ █▀█ █░█░█
|
||||
# ▄█ █▀█ █▀█ █▄▀ █▄█ ▀▄▀▄▀
|
||||
|
||||
# Copyleft 2022 t.me/shadow_modules
|
||||
# This module is free software
|
||||
# You can edit this module
|
||||
|
||||
# meta developer: @shadow_modules
|
||||
# scope: hikka_only
|
||||
# scope: hikka_min 1.3.0
|
||||
# meta banner: https://i.imgur.com/g7yk55s.jpeg
|
||||
|
||||
from .. import loader, utils
|
||||
from telethon.tl.types import Message # type: ignore
|
||||
|
||||
|
||||
@loader.tds
|
||||
class PercentMod(loader.Module):
|
||||
"""Create your text with inline percentages"""
|
||||
|
||||
strings = {"name": "Percent", "no_args": "❗ You didn't provide arguments"}
|
||||
|
||||
strings_ru = {
|
||||
"_cls_doc": "Создайте свой текст с инлайн процентами",
|
||||
"no_args": "❗ Вы не указали аргументы",
|
||||
}
|
||||
|
||||
@loader.command(
|
||||
ru_doc="<Текст с процентами> <Текст в конце> [интервал] -> Для создания"
|
||||
)
|
||||
async def percentcmd(self, message: Message):
|
||||
"""<Text with percentages> <Text at the end> [interval] -> For creating"""
|
||||
args = utils.get_args(message)
|
||||
if len(args) not in {2, 3}:
|
||||
await utils.answer(message, self.strings("no_args"))
|
||||
return
|
||||
|
||||
interval = args[-1] if args[-1].isdigit() else 0.2
|
||||
await self.animate(
|
||||
message,
|
||||
[f"{args[0]} {x}%" for x in range(100)] + [args[1]],
|
||||
interval=int(interval),
|
||||
inline=True,
|
||||
)
|
||||
115
shadowhikka/sh.modules/CheckerUsernames.py
Normal file
115
shadowhikka/sh.modules/CheckerUsernames.py
Normal file
@@ -0,0 +1,115 @@
|
||||
# █▀ █░█ ▄▀█ █▀▄ █▀█ █░█░█
|
||||
# ▄█ █▀█ █▀█ █▄▀ █▄█ ▀▄▀▄▀
|
||||
|
||||
# Copyright 2023 t.me/shadow_modules
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# meta developer: @shadow_modules
|
||||
# meta banner: https://i.imgur.com/aGGx93G.jpeg
|
||||
|
||||
import pytz # type: ignore
|
||||
from .. import loader, utils
|
||||
from telethon.tl.types import Message # type: ignore
|
||||
from telethon.tl.functions.channels import CreateChannelRequest # type: ignore
|
||||
from telethon.tl.functions.channels import UpdateUsernameRequest # type: ignore
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
@loader.tds
|
||||
class CheckerUsernamesMod(loader.Module):
|
||||
"""Check of avaliable usernames"""
|
||||
|
||||
strings = {
|
||||
"name": "CheckerUsernames",
|
||||
"off": "<emoji document_id=5350311258220404874>❗️</emoji> <b>Checker disabled</b>",
|
||||
"on": "<emoji document_id=5776375003280838798>✅</emoji> <b>Checker enabled</b>",
|
||||
"catching": "<b>👍 I caught the username\n🧐 Username: @{user}\n<b>⏰ Catch time: {time}</b>",
|
||||
}
|
||||
strings_ru = {
|
||||
"off": "<emoji document_id=5350311258220404874>❗️</emoji> <b>Проверка юзернеймов выключена</b>",
|
||||
"on": "<emoji document_id=5776375003280838798>✅</emoji> <b>Проверка юзернеймов включена</b>",
|
||||
"catching": "<b>👍 Я словил юзернейм\n🧐 Юзернейм: @{user}\n<b>⏰ Время ловли: {time}</b>",
|
||||
}
|
||||
|
||||
def __init__(self):
|
||||
self.config = loader.ModuleConfig(
|
||||
loader.ConfigValue(
|
||||
"usernames",
|
||||
["onetimeusername"],
|
||||
lambda: "Usernames for check",
|
||||
validator=loader.validators.Series(
|
||||
validator=loader.validators.String()
|
||||
),
|
||||
),
|
||||
loader.ConfigValue(
|
||||
"text",
|
||||
"OCCUPIED BY SH. MODULE",
|
||||
lambda: "Usernames for check",
|
||||
validator=loader.validators.String(),
|
||||
),
|
||||
loader.ConfigValue(
|
||||
"delay",
|
||||
5,
|
||||
lambda: "Delay for check username",
|
||||
validator=loader.validators.Integer(minimum=0),
|
||||
),
|
||||
loader.ConfigValue(
|
||||
"time",
|
||||
"Europe/Kiev",
|
||||
lambda: "Timezone",
|
||||
validator=loader.validators.String(),
|
||||
),
|
||||
)
|
||||
|
||||
@loader.loop(30, autostart=True)
|
||||
async def checker(self):
|
||||
if not self.get("status"):
|
||||
return
|
||||
current_time = (
|
||||
datetime.now(pytz.timezone(self.config["time"]))
|
||||
.replace(microsecond=0)
|
||||
.time()
|
||||
)
|
||||
usernames = self.config["usernames"]
|
||||
for username in usernames:
|
||||
try:
|
||||
await self.client.get_entity(username)
|
||||
except ValueError:
|
||||
chan = await self.client(
|
||||
CreateChannelRequest(
|
||||
title="occupied shadow",
|
||||
about="GEAR SHADOW",
|
||||
)
|
||||
)
|
||||
await self.client(UpdateUsernameRequest(chan.chats[0].id, username))
|
||||
await self.client.send_message(chan.chats[0].id, self.config["text"])
|
||||
await self.inline.bot.send_message(
|
||||
self._tg_id,
|
||||
self.strings("catching").format(
|
||||
user=(await self.client.get_entity(chan.chats[0].id)).username,
|
||||
time=current_time,
|
||||
),
|
||||
)
|
||||
continue
|
||||
|
||||
async def cusercmd(self, message: Message):
|
||||
"""Off/On checker username"""
|
||||
if self.get("status"):
|
||||
await utils.answer(message, self.strings("off"))
|
||||
return self.set("status", False)
|
||||
else:
|
||||
await utils.answer(message, self.strings("on"))
|
||||
self.set("status", True)
|
||||
|
||||
async def timezonescmd(self, message: Message):
|
||||
"""All timezones for config"""
|
||||
await message.delete()
|
||||
await self.invoke("e", "import pytz; pytz.all_timezones", message.peer_id)
|
||||
64
shadowhikka/sh.modules/ConvertTime.py
Normal file
64
shadowhikka/sh.modules/ConvertTime.py
Normal file
@@ -0,0 +1,64 @@
|
||||
# █▀ █░█ ▄▀█ █▀▄ █▀█ █░█░█
|
||||
# ▄█ █▀█ █▀█ █▄▀ █▄█ ▀▄▀▄▀
|
||||
|
||||
# Copyright 2023 t.me/shadow_modules
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# meta developer: @shadow_modules
|
||||
# meta banner: https://i.imgur.com/KiCMAfX.jpg
|
||||
|
||||
from .. import loader, utils
|
||||
from telethon.tl.types import Message # type: ignore
|
||||
|
||||
|
||||
async def convert(self, message, args):
|
||||
days, remainder = divmod(args, 86400)
|
||||
hours, remainder = divmod(remainder, 3600)
|
||||
minutes = divmod(remainder, 60)
|
||||
seconds = divmod(remainder, 60)
|
||||
|
||||
time_parts = [
|
||||
f"<emoji document_id=5469947168523558652>☀️</emoji><b> {days} Days</b>"
|
||||
if days > 0
|
||||
else None,
|
||||
f"<emoji document_id=6334620339720423126>🕛</emoji> <b> {hours} Hours</b>"
|
||||
if hours > 0
|
||||
else None,
|
||||
f"<emoji document_id=6334540900005315791>🕰️</emoji><b> {minutes[0]} Minutes</b>"
|
||||
if minutes[0] > 0
|
||||
else None,
|
||||
f"<emoji document_id=6334768915524093741>⏲️</emoji><b> {seconds[0]} Seconds</b>",
|
||||
]
|
||||
|
||||
time_string = "\n".join(part for part in time_parts if part is not None)
|
||||
if not args:
|
||||
await utils.answer(message, self.strings("no_args"))
|
||||
|
||||
await utils.answer(message, time_string)
|
||||
|
||||
|
||||
@loader.tds
|
||||
class ConvertTimeMod(loader.Module):
|
||||
"""Convert time in days, hours, minutes and seconds"""
|
||||
|
||||
strings = {
|
||||
"name": "ConvertTime",
|
||||
"no_args": "<emoji document_id=5350311258220404874>❗️</emoji> <b>Arguments entered incorrectly</b>",
|
||||
}
|
||||
strings_ru = {
|
||||
"no_args": "<emoji document_id=5350311258220404874>❗️</emoji> <b>Не правильно введены аргументы</b>",
|
||||
}
|
||||
|
||||
async def ctimecmd(self, message: Message):
|
||||
"""ctime <int: time for convert>"""
|
||||
args = utils.get_args_raw(message)
|
||||
time_values = int(args)
|
||||
await convert(self, message, time_values)
|
||||
76
shadowhikka/sh.modules/FoxAndDogsGallery.py
Normal file
76
shadowhikka/sh.modules/FoxAndDogsGallery.py
Normal file
@@ -0,0 +1,76 @@
|
||||
# █▀ █░█ ▄▀█ █▀▄ █▀█ █░█░█
|
||||
# ▄█ █▀█ █▀█ █▄▀ █▄█ ▀▄▀▄▀
|
||||
|
||||
# Copyright 2023 t.me/shadow_modules
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# meta developer: @shadow_modules
|
||||
# scope: hikka_only
|
||||
# meta banner: https://i.imgur.com/nZalKg2.jpeg
|
||||
|
||||
import requests
|
||||
import random
|
||||
from .. import loader, utils
|
||||
from telethon.tl.types import Message # type: ignore
|
||||
|
||||
|
||||
async def photofox() -> str:
|
||||
"""Fox photo handler"""
|
||||
return (await utils.run_sync(requests.get, "https://randomfox.ca/floof")).json()[
|
||||
"image"
|
||||
]
|
||||
|
||||
|
||||
async def photodog() -> str:
|
||||
"""Dog photo handler"""
|
||||
return (await utils.run_sync(requests.get, "https://random.dog/woof.json")).json()[
|
||||
"url"
|
||||
]
|
||||
|
||||
|
||||
async def randomapi():
|
||||
randomapis = random.choice(
|
||||
["https://randomfox.ca/floof", "https://random.dog/woof.json"]
|
||||
)
|
||||
if randomapis == "https://randomfox.ca/floof":
|
||||
return (
|
||||
await utils.run_sync(requests.get, "https://randomfox.ca/floof")
|
||||
).json()["image"]
|
||||
elif randomapis == "https://random.dog/woof.json":
|
||||
return (
|
||||
await utils.run_sync(requests.get, "https://random.dog/woof.json")
|
||||
).json()["url"]
|
||||
|
||||
|
||||
@loader.tds
|
||||
class FoxGalerryMod(loader.Module):
|
||||
"""🦊 Foxes, Dogs 🐶"""
|
||||
|
||||
strings = {"name": "FoxGallery"}
|
||||
|
||||
strings_ru = {
|
||||
"_cls_doc": "🦊 Лисички, Песики 🐶",
|
||||
"_cmd_doc_foxes": "🦊 Лисички",
|
||||
"_cmd_doc_dogs": "🐶 Песики",
|
||||
"_cmd_doc_random": "🦊 Лисички и Песики 🐶",
|
||||
}
|
||||
|
||||
async def foxescmd(self, message: Message):
|
||||
"""🦊 Sending photos with foxes"""
|
||||
await self.inline.gallery(message, photofox)
|
||||
|
||||
async def dogscmd(self, message: Message):
|
||||
"""🐶 Sending photos with dogs"""
|
||||
await self.inline.gallery(message, photodog)
|
||||
|
||||
async def randomcdfcmd(self, message: Message):
|
||||
"""Photos of dogs 🐶 and foxes 🦊"""
|
||||
await self.inline.gallery(message, randomapi)
|
||||
42
shadowhikka/sh.modules/GForYou.py
Normal file
42
shadowhikka/sh.modules/GForYou.py
Normal file
@@ -0,0 +1,42 @@
|
||||
# █▀ █░█ ▄▀█ █▀▄ █▀█ █░█░█
|
||||
# ▄█ █▀█ █▀█ █▄▀ █▄█ ▀▄▀▄▀
|
||||
|
||||
# Copyright 2023 t.me/shadow_modules
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# meta developer: @shadow_modules
|
||||
# meta banner: https://i.imgur.com/pmh9eAE.jpeg
|
||||
|
||||
from .. import loader, utils
|
||||
from telethon.tl.types import Message # type: ignore
|
||||
|
||||
|
||||
@loader.tds
|
||||
class GYForYouMod(loader.Module):
|
||||
"""Погуглю за тебя"""
|
||||
|
||||
strings = {
|
||||
"name": "GYForYou",
|
||||
"google": "<emoji document_id=5300882244842300470>👩💻</emoji><b> I googled for you</b>\n",
|
||||
"no_args": "❌ No args",
|
||||
}
|
||||
strings_ru = {
|
||||
"google": "<emoji document_id=5300882244842300470>👩💻</emoji><b> Я погуглил за тебя</b>\n",
|
||||
"no_args": "❌ Нет аргументов",
|
||||
}
|
||||
|
||||
async def googlecmd(self, message: Message):
|
||||
"""<args>"""
|
||||
args = utils.get_args_raw(message).replace(" ", "+")
|
||||
if not args:
|
||||
await utils.answer(message, self.strings("no_args"))
|
||||
return
|
||||
await utils.answer(message, self.strings("google") + f"https://track24.ru/google/?q={args}")
|
||||
74
shadowhikka/sh.modules/GPT2.py
Normal file
74
shadowhikka/sh.modules/GPT2.py
Normal file
@@ -0,0 +1,74 @@
|
||||
# █▀ █░█ ▄▀█ █▀▄ █▀█ █░█░█
|
||||
# ▄█ █▀█ █▀█ █▄▀ █▄█ ▀▄▀▄▀
|
||||
|
||||
# Copyright 2023 t.me/shadow_modules
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
# meta developer: @shadow_modules
|
||||
# meta banner: https://i.imgur.com/fdEskim.jpeg
|
||||
|
||||
|
||||
import openai # type: ignore
|
||||
from .. import loader, utils
|
||||
from telethon.tl.types import Message # type: ignore
|
||||
|
||||
|
||||
@loader.tds
|
||||
class GPT2Mod(loader.Module):
|
||||
"""ChatGPT в модуле"""
|
||||
|
||||
strings = {
|
||||
"name": "ChatGPT",
|
||||
"wait": "<emoji document_id=5471981853445463256>🤖</emoji><b> GPT-2 is generating response, please wait</b>",
|
||||
"quest": "\n\n\n<emoji document_id=5819167501912640906>❔</emoji><b> Your question to GPT-2 was:</b> {args}",
|
||||
"args_err": "<emoji document_id=5215534321183499254>⛔️</emoji><b> You didn't ask a question GPT-2</b>",
|
||||
"conf_err": "<emoji document_id=5215534321183499254>⛔️</emoji><b> You didn't provide an api key for GPT-2</b>",
|
||||
}
|
||||
strings_ru = {
|
||||
"wait": "<emoji document_id=5471981853445463256>🤖</emoji><b> GPT-2 генерирует ответ, подождите</b>",
|
||||
"quest": "\n\n\n<emoji document_id=5819167501912640906>❔</emoji><b> Ваш вопрос к GPT-2 был:</b> {args}",
|
||||
"args_err": "<emoji document_id=5215534321183499254>⛔️</emoji><b> Вы не задали вопрос GPT-2</b>",
|
||||
"conf_err": "<emoji document_id=5215534321183499254>⛔️</emoji><b> Вы не указали api key для GPT-2</b>",
|
||||
}
|
||||
|
||||
def __init__(self):
|
||||
self.config = loader.ModuleConfig(
|
||||
loader.ConfigValue(
|
||||
"api_key",
|
||||
None,
|
||||
lambda: "Api key for GPT-2",
|
||||
validator=loader.validators.Hidden(),
|
||||
),
|
||||
)
|
||||
|
||||
async def gptcmd(self, message: Message):
|
||||
""".gpt <args>"""
|
||||
args = utils.get_args_raw(message)
|
||||
if not args:
|
||||
await utils.answer(message, self.strings("args_err"))
|
||||
return
|
||||
if self.config["api_key"] is None:
|
||||
await utils.answer(message, self.strings("conf_err"))
|
||||
return
|
||||
await utils.answer(message, self.strings("wait").format(args=args))
|
||||
openai.api_key = self.config["api_key"]
|
||||
model_engine = "text-davinci-003"
|
||||
completion = openai.Completion.create(
|
||||
engine=model_engine,
|
||||
prompt=args,
|
||||
max_tokens=1024,
|
||||
n=1,
|
||||
stop=None,
|
||||
temperature=0.5,
|
||||
)
|
||||
response = completion.choices[0].text
|
||||
await utils.answer(message, response + self.strings("quest").format(args=args))
|
||||
168
shadowhikka/sh.modules/HentaiManga.py
Normal file
168
shadowhikka/sh.modules/HentaiManga.py
Normal file
@@ -0,0 +1,168 @@
|
||||
# █▀ █░█ ▄▀█ █▀▄ █▀█ █░█░█
|
||||
# ▄█ █▀█ █▀█ █▄▀ █▄█ ▀▄▀▄▀
|
||||
|
||||
# Copyright 2023 t.me/shadow_modules
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# meta developer: @shadow_modules, @toxicuse, @vsecoder
|
||||
# meta banner: https://i.imgur.com/8UYznku.jpeg
|
||||
|
||||
import requests # type: ignore
|
||||
from .. import loader, utils # type: ignore
|
||||
from telethon.tl.types import Message # type: ignore
|
||||
from ..inline.types import InlineCall # type: ignore
|
||||
|
||||
|
||||
async def request(url: str = "https://janda.sinkaroid.org/3hentai/random") -> dict:
|
||||
"""Manga handler"""
|
||||
return (await utils.run_sync(requests.get, url)).json()["data"]
|
||||
|
||||
|
||||
@loader.tds
|
||||
class HentaiMangaMod(loader.Module):
|
||||
strings = {
|
||||
"name": "HentaiManga",
|
||||
"message": "<b>Title:</b> <code>{title}</code>\n<b>Pages:</b> {total}\n<b>Tags:</b> {tags}\n\n"
|
||||
"Command to get this manga: <code>.ghm {api} {id}</code>",
|
||||
"time": "<b>Wait...</b>",
|
||||
"warn-form": (
|
||||
"<b>⚠️ Attention!</b>\n<b>😰 This module is 18+\n"
|
||||
"✉️ In many chats it is prohibited</b>\n<b>✅ If you agree with what you can get"
|
||||
"ban - click on the button below</b>"
|
||||
),
|
||||
"yes": "✅ Yes",
|
||||
"no": "❌ No",
|
||||
"args_error": "<b>Not enough arguments</b>",
|
||||
"not_found": "<b>Not found</b>",
|
||||
}
|
||||
strings_ru = {
|
||||
"message": "<b>Название:</b> <code>{title}</code>\n<b>Страниц:</b> {total}\n<b>Теги:</b> {tags}\n\n"
|
||||
"Команда для получения этой манги: <code>.ghm {api} {id}</code>",
|
||||
"time": "<b>Ожидайте...</b>",
|
||||
"warn-form": (
|
||||
"<b>⚠️ Внимание!</b>\n<b>😰 Данный модуль 18+\n"
|
||||
"✉️ Во многих чатах он запрещен</b>\n<b>✅ Если вы согласны с тем что можете получить"
|
||||
" бан - нажмите на кнопку ниже</b>"
|
||||
),
|
||||
"yes": "✅ Да",
|
||||
"no": "❌ Нет",
|
||||
"args_error": "<b>Недостаточно аргументов</b>",
|
||||
"not_found": "<b>Не найдено</b>",
|
||||
}
|
||||
|
||||
def __init__(self):
|
||||
self.name = self.strings["name"]
|
||||
|
||||
async def client_ready(self, client, _):
|
||||
self.apis = {
|
||||
"3hentai": {
|
||||
"random": "https://janda.sinkaroid.org/3hentai/random",
|
||||
"get": "https://janda.sinkaroid.org/3hentai/get?book={id}",
|
||||
},
|
||||
"asmhentai": {
|
||||
"random": "https://janda.sinkaroid.org/asmhentai/random",
|
||||
"get": "https://janda.sinkaroid.org/asmhentai/get?book={id}",
|
||||
},
|
||||
"hentaifox": {
|
||||
"random": "https://janda.sinkaroid.org/hentaifox/random",
|
||||
"get": "https://janda.sinkaroid.org/hentaifox/get?book={id}",
|
||||
},
|
||||
}
|
||||
|
||||
async def gallery(self, message: Message, mang: dict, api: str = "3hentai"):
|
||||
await self.inline.gallery(
|
||||
caption=self.strings["message"].format(
|
||||
title=mang["title"].replace("[", "").replace("]", ""),
|
||||
total=mang["total"],
|
||||
tags=", ".join(mang["tags"]),
|
||||
api=api,
|
||||
id=mang["id"],
|
||||
),
|
||||
message=message,
|
||||
next_handler=mang["image"],
|
||||
)
|
||||
|
||||
async def warn(self, message: Message):
|
||||
await self.inline.form(
|
||||
message=message,
|
||||
text=self.strings["warn-form"],
|
||||
reply_markup=[
|
||||
[
|
||||
{
|
||||
"text": self.strings["yes"],
|
||||
"callback": self.inline_call_answer,
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
"text": self.strings["no"],
|
||||
"callback": self.delete_module,
|
||||
"args": (message,),
|
||||
},
|
||||
],
|
||||
],
|
||||
)
|
||||
|
||||
@loader.command(alias="rhm")
|
||||
async def rnd_hentai_mangacmd(self, message: Message):
|
||||
"""
|
||||
{hentai_api_name: optional} - рандомная хентай-манга
|
||||
"""
|
||||
|
||||
args = utils.get_args_raw(message).split(" ")
|
||||
|
||||
if not self.db.get(__name__, "warn", False):
|
||||
await self.warn(message)
|
||||
return
|
||||
|
||||
await utils.answer(message, self.strings["time"])
|
||||
|
||||
api = args[0] if args and args[0] in self.apis else "3hentai"
|
||||
|
||||
mang = await request(self.apis[api]["random"])
|
||||
|
||||
await self.gallery(message, mang, api)
|
||||
|
||||
@loader.command(alias="ghm")
|
||||
async def get_hentai_mangacmd(self, message: Message):
|
||||
"""
|
||||
{hentai_api_name} {id} - получить хентай-мангу
|
||||
"""
|
||||
|
||||
args = utils.get_args_raw(message).split(" ")
|
||||
|
||||
if len(args) < 2:
|
||||
return await utils.answer(message, self.strings["args_error"])
|
||||
|
||||
if not self.db.get(__name__, "warn", False):
|
||||
await self.warn(message)
|
||||
return
|
||||
|
||||
await utils.answer(message, self.strings["time"])
|
||||
|
||||
if args[0] not in self.apis:
|
||||
return await utils.answer(message, self.strings["args_error"])
|
||||
|
||||
mang = await request(self.apis[args[0]]["get"].format(id=args[1]))
|
||||
|
||||
if not mang:
|
||||
return await utils.answer(message, self.strings["not_found"])
|
||||
|
||||
await self.gallery(message, mang, args[0])
|
||||
|
||||
async def inline_call_answer(self, call: InlineCall):
|
||||
self.db.set(__name__, "warn", True)
|
||||
await call.delete()
|
||||
|
||||
@loader.owner
|
||||
async def delete_module(self, call: InlineCall, message):
|
||||
await call.delete()
|
||||
await self.invoke("unloadmod", "HentaiManga", message.peer_id)
|
||||
187
shadowhikka/sh.modules/InlineVizitka.py
Normal file
187
shadowhikka/sh.modules/InlineVizitka.py
Normal file
@@ -0,0 +1,187 @@
|
||||
# █▀ █░█ ▄▀█ █▀▄ █▀█ █░█░█
|
||||
# ▄█ █▀█ █▀█ █▄▀ █▄█ ▀▄▀▄▀
|
||||
|
||||
# Copyright 2023 t.me/shadow_modules
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import logging
|
||||
from telethon.tl.types import Message
|
||||
from .. import loader, utils # type: ignore
|
||||
|
||||
# scope: hikka_only
|
||||
# meta developer: @shadow_modules, @dan_endy, @hikarimods
|
||||
# meta banner: https://i.imgur.com/SbLqMlM.jpeg
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@loader.tds
|
||||
class InlineVizitkaMod(loader.Module):
|
||||
"""You information in inline vizitka"""
|
||||
|
||||
strings = {
|
||||
"name": "InlineVizitka",
|
||||
"mysocial": "<b>✨ My social networks</b>",
|
||||
"userules": (
|
||||
"<b>How this module is used</b>\n1. Links to social networks must be"
|
||||
" entered in <code>{prefix}config</code>\n2. Links in the config must start"
|
||||
" with https:// otherwise there will be an <b>error</b>"
|
||||
),
|
||||
}
|
||||
|
||||
strings_ru = {
|
||||
"mysocial": "<b>✨ Мои соцсети</b>",
|
||||
"userules": (
|
||||
"<b>Как пользоваться данным модулем</b>\n1. Ссылки на соц.сети надо вводить"
|
||||
" в <code>{prefix}config</code>\n2. Ссылки в конфиге должны начинаться с"
|
||||
" https:// иначе будет <b>ошибка</b>"
|
||||
),
|
||||
}
|
||||
|
||||
def __init__(self):
|
||||
self.config = loader.ModuleConfig(
|
||||
loader.ConfigValue(
|
||||
"custom_message",
|
||||
None,
|
||||
lambda: "Custom message in .vizitka",
|
||||
),
|
||||
loader.ConfigValue(
|
||||
"VK",
|
||||
"🚫 Link not set",
|
||||
lambda: "You VK LINK",
|
||||
),
|
||||
loader.ConfigValue(
|
||||
"discord",
|
||||
"🚫 Link not set",
|
||||
lambda: "You discord LINK",
|
||||
),
|
||||
loader.ConfigValue(
|
||||
"twitter",
|
||||
"🚫 Link not set",
|
||||
lambda: "You twitter LINK",
|
||||
),
|
||||
loader.ConfigValue(
|
||||
"inst",
|
||||
"🚫 Link not set",
|
||||
lambda: "You instagram LINK",
|
||||
),
|
||||
loader.ConfigValue(
|
||||
"grustno",
|
||||
"🚫 Link not set",
|
||||
lambda: "You grustnogram LINK",
|
||||
),
|
||||
loader.ConfigValue(
|
||||
"telegram",
|
||||
"🚫 Link not set",
|
||||
lambda: "You telegram chanel LINK",
|
||||
),
|
||||
loader.ConfigValue(
|
||||
"gitlab",
|
||||
"🚫 Link not set",
|
||||
lambda: "You gitlab account LINK",
|
||||
),
|
||||
loader.ConfigValue(
|
||||
"github",
|
||||
"🚫 Link not set",
|
||||
lambda: "You github account LINK",
|
||||
),
|
||||
loader.ConfigValue(
|
||||
"twitch",
|
||||
"🚫 Link not set",
|
||||
lambda: "You twitch LINK",
|
||||
),
|
||||
loader.ConfigValue(
|
||||
"anixart",
|
||||
"🚫 Link not set",
|
||||
lambda: "You anixart LINK",
|
||||
),
|
||||
loader.ConfigValue(
|
||||
"xda",
|
||||
"🚫 Link not set",
|
||||
lambda: "You xda LINK",
|
||||
),
|
||||
loader.ConfigValue(
|
||||
"4pda",
|
||||
"🚫 Link not set",
|
||||
lambda: "You 4pda LINK",
|
||||
),
|
||||
loader.ConfigValue(
|
||||
"tiktok",
|
||||
"🚫 Link not set",
|
||||
lambda: "You tiktok LINK",
|
||||
),
|
||||
loader.ConfigValue(
|
||||
"pinterest",
|
||||
"🚫 Link not set",
|
||||
lambda: "You pinterest LINK",
|
||||
),
|
||||
loader.ConfigValue(
|
||||
"spotify",
|
||||
"🚫 Link not set",
|
||||
lambda: "You spotify LINK",
|
||||
),
|
||||
loader.ConfigValue(
|
||||
"pixiv",
|
||||
"🚫 Link not set",
|
||||
lambda: "You pixiv LINK",
|
||||
),
|
||||
)
|
||||
|
||||
@loader.unrestricted
|
||||
async def vizitkacmd(self, message: Message):
|
||||
"""Command for displaying a business card"""
|
||||
await self.inline.form(
|
||||
message=message,
|
||||
text=self.config["custom_message"] or "<b>✨ Мои соцсети</b>",
|
||||
reply_markup=[
|
||||
[
|
||||
{"text": "🥱 Discord", "callback": self.inline__callAnswer},
|
||||
{"text": "🦢 VK", "url": self.config["VK"]},
|
||||
],
|
||||
[
|
||||
{"text": "❤ Instagram", "url": self.config["inst"]},
|
||||
{"text": "🖤 Grustnogram", "url": self.config["grustno"]},
|
||||
],
|
||||
[
|
||||
{"text": "🌐 Twitter", "url": self.config["twitter"]},
|
||||
{"text": "💫 TG Channel", "url": self.config["telegram"]},
|
||||
],
|
||||
[
|
||||
{"text": "🌚 GitHub", "url": self.config["github"]},
|
||||
{"text": "☀ GitLab", "url": self.config["gitlab"]},
|
||||
],
|
||||
[
|
||||
{"text": "😽 Anixart", "url": self.config["anixart"]},
|
||||
{"text": "📱 4PDA", "url": self.config["4pda"]},
|
||||
],
|
||||
[
|
||||
{"text": "📺 Twitch", "url": self.config["twitch"]},
|
||||
{"text": "📴 XDA", "url": self.config["xda"]},
|
||||
],
|
||||
[
|
||||
{"text": "🤣 Tik tok", "url": self.config["tiktok"]},
|
||||
{"text": "🎧 Spotify", "url": self.config["spotify"]},
|
||||
],
|
||||
[
|
||||
{"text": "🖌 Pixiv", "url": self.config["pixiv"]},
|
||||
{"text": "🖌 Pinterest", "url": self.config["pinterest"]},
|
||||
],
|
||||
],
|
||||
)
|
||||
|
||||
async def inline__callAnswer(self, call):
|
||||
await call.answer(self.config["discord"], show_alert=True)
|
||||
|
||||
async def vizinfocmd(self, message: Message):
|
||||
await utils.answer(
|
||||
message,
|
||||
self.strings("userules").format(prefix=self.get_prefix()),
|
||||
)
|
||||
169
shadowhikka/sh.modules/MyVizitka.py
Normal file
169
shadowhikka/sh.modules/MyVizitka.py
Normal file
@@ -0,0 +1,169 @@
|
||||
# █▀ █░█ ▄▀█ █▀▄ █▀█ █░█░█
|
||||
# ▄█ █▀█ █▀█ █▄▀ █▄█ ▀▄▀▄▀
|
||||
|
||||
# Copyright 2023 t.me/shadow_modules
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# meta developer: @shadow_modules
|
||||
# scope: hikka_only
|
||||
# scope: hikka_min 1.3.0
|
||||
# meta banner: https://i.imgur.com/4aQGHmR.jpeg
|
||||
|
||||
from .. import loader, utils
|
||||
from ..inline.types import InlineQuery # type: ignore
|
||||
|
||||
import logging
|
||||
|
||||
from telethon.tl.types import Message # type: ignore
|
||||
from telethon.utils import get_display_name # type: ignore
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@loader.tds
|
||||
class MyVizitkaMod(loader.Module):
|
||||
strings = {"name": "MyVizitka"}
|
||||
|
||||
def __init__(self):
|
||||
self.config = loader.ModuleConfig(
|
||||
loader.ConfigValue(
|
||||
"custom_message",
|
||||
"<b>Тест</b>",
|
||||
lambda: "Custom message in .myvizit\nMay contain {me}, {prefix}, {platform} keywords",
|
||||
),
|
||||
loader.ConfigValue(
|
||||
"button_1",
|
||||
["My chat", "https://t.me/shadowmodschat"],
|
||||
lambda: "You 1 button",
|
||||
validator=loader.validators.Series(min_len=0, max_len=2),
|
||||
),
|
||||
loader.ConfigValue(
|
||||
"button_2",
|
||||
["My channel", "https://t.me/shadow_modules"],
|
||||
lambda: "You 2 button",
|
||||
validator=loader.validators.Series(min_len=0, max_len=2),
|
||||
),
|
||||
loader.ConfigValue(
|
||||
"button_3",
|
||||
["My account", "https://t.me/shadow_hikka"],
|
||||
lambda: "You 3 button",
|
||||
validator=loader.validators.Series(min_len=0, max_len=2),
|
||||
),
|
||||
loader.ConfigValue(
|
||||
"button_4",
|
||||
[],
|
||||
lambda: "You 4 button",
|
||||
validator=loader.validators.Series(min_len=0, max_len=2),
|
||||
),
|
||||
loader.ConfigValue(
|
||||
"button_5",
|
||||
[],
|
||||
lambda: "You 5 button",
|
||||
validator=loader.validators.Series(min_len=0, max_len=2),
|
||||
),
|
||||
loader.ConfigValue(
|
||||
"button_6",
|
||||
[],
|
||||
lambda: "You 6 button",
|
||||
validator=loader.validators.Series(min_len=0, max_len=2),
|
||||
),
|
||||
loader.ConfigValue(
|
||||
"file_url",
|
||||
"https://i.pinimg.com/564x/b9/30/e6/b930e6476d705d7e92f7b961e61d5141.jpg",
|
||||
lambda: "Direct link to photo/video/gif/music",
|
||||
),
|
||||
loader.ConfigValue(
|
||||
"type_file",
|
||||
"photo",
|
||||
lambda: "Type of file specified in file_url",
|
||||
validator=loader.validators.Choice(["photo", "video", "audio", "gif"]),
|
||||
),
|
||||
)
|
||||
|
||||
def _get_mark(self, btn_count: int) -> dict:
|
||||
btn_count = str(btn_count)
|
||||
|
||||
return (
|
||||
{
|
||||
"text": self.config[f"button_{btn_count}"][0],
|
||||
"url": self.config[f"button_{btn_count}"][1],
|
||||
}
|
||||
if self.config[f"button_{btn_count}"]
|
||||
else None
|
||||
)
|
||||
|
||||
async def client_ready(self):
|
||||
self.me = await self._client.get_me()
|
||||
|
||||
@loader.unrestricted
|
||||
async def myvizitcmd(self, message: Message):
|
||||
"""Command for displaying a business card"""
|
||||
m = {x: self._get_mark(x) for x in range(7)}
|
||||
me = (
|
||||
"<b><a"
|
||||
f' href="tg://user?id={self.me.id}">{get_display_name(self.me)}</a></b>'
|
||||
)
|
||||
prefix = self.get_prefix()
|
||||
platform = utils.get_named_platform()
|
||||
await self.inline.form(
|
||||
disable_security=True,
|
||||
message=message,
|
||||
text=self.config["custom_message"].format(
|
||||
me=me, prefix=prefix, platform=platform
|
||||
),
|
||||
reply_markup=[
|
||||
[
|
||||
*([m[1]] if m[1] else []),
|
||||
*([m[2]] if m[2] else []),
|
||||
*([m[3]] if m[3] else []),
|
||||
],
|
||||
[
|
||||
*([m[4]] if m[4] else []),
|
||||
*([m[5]] if m[5] else []),
|
||||
*([m[6]] if m[6] else []),
|
||||
],
|
||||
],
|
||||
**{self.config["type_file"]: self.config["file_url"]},
|
||||
)
|
||||
|
||||
@loader.inline_handler(ru_doc="Моя визитка")
|
||||
async def myvizit(self, _: InlineQuery) -> dict:
|
||||
"""My inline card"""
|
||||
m = {x: self._get_mark(x) for x in range(7)}
|
||||
me = (
|
||||
"<b><a"
|
||||
f' href="tg://user?id={self.me.id}">{get_display_name(self.me)}</a></b>'
|
||||
)
|
||||
prefix = self.get_prefix()
|
||||
platform = utils.get_named_platform()
|
||||
|
||||
return {
|
||||
"title": "MyVizitka",
|
||||
"description": "My business card",
|
||||
"message": self.config["custom_message"].format(
|
||||
me=me,
|
||||
prefix=prefix,
|
||||
platform=platform,
|
||||
),
|
||||
"thumb": "https://upload.wikimedia.org/wikipedia/commons/thumb/5/5a/Info_Simple_bw.svg/1200px-Info_Simple_bw.svg.png",
|
||||
"reply_markup": [
|
||||
[
|
||||
*([m[1]] if m[1] else []),
|
||||
*([m[2]] if m[2] else []),
|
||||
*([m[3]] if m[3] else []),
|
||||
],
|
||||
[
|
||||
*([m[4]] if m[4] else []),
|
||||
*([m[5]] if m[5] else []),
|
||||
*([m[6]] if m[6] else []),
|
||||
],
|
||||
],
|
||||
}
|
||||
169
shadowhikka/sh.modules/NewsLetter.py
Normal file
169
shadowhikka/sh.modules/NewsLetter.py
Normal file
@@ -0,0 +1,169 @@
|
||||
# █▀ █░█ ▄▀█ █▀▄ █▀█ █░█░█
|
||||
# ▄█ █▀█ █▀█ █▄▀ █▄█ ▀▄▀▄▀
|
||||
|
||||
# Copyright 2023 t.me/shadow_modules
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import asyncio
|
||||
from .. import loader, utils
|
||||
from telethon.tl.types import Message # type: ignore
|
||||
from ..inline.types import InlineCall # type: ignore
|
||||
|
||||
# meta developer: @shadow_modules
|
||||
# scope: hikka_only
|
||||
# scope: hikka_min 1.3.0
|
||||
# meta banner: https://i.imgur.com/Hy9ABNY.jpeg
|
||||
|
||||
|
||||
@loader.tds
|
||||
class NewsLetterMod(loader.Module):
|
||||
"""newsletter for chats"""
|
||||
|
||||
strings = {
|
||||
"name": "NewsLetter",
|
||||
"succnews": (
|
||||
"<b><emoji document_id=5776375003280838798>✅</emoji> Newsletter successfully sent</b>\n<b><emoji document_id=5228686859663585439>👁🗨</emoji> Id сhats that were"
|
||||
" sent:</b>\n{}"
|
||||
),
|
||||
"nochat": "<emoji document_id=5350311258220404874>❗️</emoji> <b>You did not specify chats for mailing</b>",
|
||||
"warnform": (
|
||||
"<b>⚠️ Attention!</b>\n<b>😰 When sending a newsletter to a lot of chats,"
|
||||
" there may be a flood</b>\n<b>✅ If you agree that you can get a flood,"
|
||||
" click on the button below</b>"
|
||||
),
|
||||
"noargs": "<b><emoji document_id=5350311258220404874>❗️</emoji> There are no messages to send</b>",
|
||||
"yes": "✅ Yes",
|
||||
"no": "❌ No",
|
||||
"off": "<emoji document_id=5350311258220404874>❗️</emoji> <b>Mailing disabled</b>",
|
||||
"on": "<emoji document_id=5776375003280838798>✅</emoji> <b>Mailing enabled</b>",
|
||||
"no_delay": "<emoji document_id=5350311258220404874>❗️</emoji> <b>You did not indicate the delay between shipments</b>",
|
||||
"no_text": "<emoji document_id=5350311258220404874>❗️</emoji> <b>You did not indicate the text that will be written in the newsletter</b>",
|
||||
}
|
||||
strings_ru = {
|
||||
"succnews": (
|
||||
"<b><emoji document_id=5776375003280838798>✅</emoji> Рассылка успешно отправлена</b>\n<b><emoji document_id=5228686859663585439>👁🗨</emoji> Айди чатов в которые была"
|
||||
" отправлена рассылка:</b>\n{}"
|
||||
),
|
||||
"warnform": (
|
||||
"<b>⚠️ Внимание!</b>\n<b>😰 При отправке рассылки во многое количество чатов"
|
||||
" может быть флудвейт</b>\n<b>✅ Если вы согласны с тем что можете получить"
|
||||
" флудвейт - нажмите на кнопку ниже</b>"
|
||||
),
|
||||
"noargs": "<b><emoji document_id=5350311258220404874>❗️</emoji> Нет сообщения что-бы рассылать</b>",
|
||||
"nochat": "<emoji document_id=5350311258220404874>❗️</emoji> <b>Вы не указали чаты для рассылки</b>",
|
||||
"yes": "✅ Да",
|
||||
"no": "❌ Нет",
|
||||
"off": "<emoji document_id=5350311258220404874>❗️</emoji> <b>Рассылка выключена</b>",
|
||||
"on": "<emoji document_id=5776375003280838798>✅</emoji> <b>Рассылка включена</b>",
|
||||
"no_delay": "<emoji document_id=5350311258220404874>❗️</emoji> <b>Вы не указали задержку между отправками</b>",
|
||||
"no_text": "<emoji document_id=5350311258220404874>❗️</emoji> <b>Вы не указали текст который будет писать в рассылке</b>",
|
||||
}
|
||||
|
||||
def __init__(self):
|
||||
self.config = loader.ModuleConfig(
|
||||
loader.ConfigValue(
|
||||
"chats",
|
||||
[],
|
||||
lambda: "Chat for newsletter",
|
||||
validator=loader.validators.Series(
|
||||
validator=loader.validators.TelegramID()
|
||||
),
|
||||
),
|
||||
loader.ConfigValue(
|
||||
"delay",
|
||||
5,
|
||||
lambda: "Delay for send message",
|
||||
validator=loader.validators.Integer(minimum=0),
|
||||
),
|
||||
loader.ConfigValue(
|
||||
"url",
|
||||
"https://github.githubassets.com/assets/GitHub-Mark-ea2971cee799.png",
|
||||
lambda: "Url for photo",
|
||||
validator=loader.validators.Link(),
|
||||
),
|
||||
loader.ConfigValue(
|
||||
"text",
|
||||
"",
|
||||
lambda: "Text for send",
|
||||
validator=loader.validators.String(),
|
||||
),
|
||||
)
|
||||
|
||||
async def sendnewscmd(self, message: Message):
|
||||
"""<message> or reply"""
|
||||
if not self.db.get(__name__, "warn", False):
|
||||
await self.inline.form(
|
||||
message=message,
|
||||
text=self.strings("warnform"),
|
||||
reply_markup=[
|
||||
[
|
||||
{
|
||||
"text": self.strings("yes"),
|
||||
"callback": self.inline__callAnswer,
|
||||
"args": ("yes",),
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
"text": self.strings("no"),
|
||||
"callback": self.inline__callAnswer,
|
||||
"args": ("no",),
|
||||
},
|
||||
],
|
||||
],
|
||||
)
|
||||
return
|
||||
args = utils.get_args_raw(message)
|
||||
reply = await message.get_reply_message()
|
||||
chats = self.config["chats"]
|
||||
if not chats:
|
||||
await utils.answer(message, self.strings("nochat"))
|
||||
return
|
||||
try:
|
||||
if reply:
|
||||
for chat in chats:
|
||||
await self.client.send_message(chat, reply)
|
||||
if not reply:
|
||||
for chat in chats:
|
||||
await self.client.send_message(chat, args)
|
||||
except ValueError:
|
||||
await utils.answer(message, self.strings("noargs"))
|
||||
return
|
||||
|
||||
await utils.answer(
|
||||
message,
|
||||
self.strings("succnews").format(
|
||||
"\n".join([f"<code>{s}</code>" for s in list(map(str, chats))])
|
||||
),
|
||||
)
|
||||
|
||||
async def newsdelaycmd(self, message: Message):
|
||||
"""Delayed mailing and photos"""
|
||||
if not self.config["delay"]:
|
||||
return await utils.answer(message, self.strings("no_delay"))
|
||||
if not self.config["text"]:
|
||||
return await utils.answer(message, self.strings("no_text"))
|
||||
if self.get("status"):
|
||||
await utils.answer(message, self.strings("off"))
|
||||
return self.set("status", False)
|
||||
else:
|
||||
await utils.answer(message, self.strings("on"))
|
||||
self.set("status", True)
|
||||
while True:
|
||||
if not self.get("status"):
|
||||
break
|
||||
for chat in self.config["chats"]:
|
||||
await self.client.send_file(chat, self.config["url"], caption=self.config["text"])
|
||||
await asyncio.sleep(self.config["delay"])
|
||||
|
||||
async def inline__callAnswer(self, call: InlineCall, value: str):
|
||||
self.db.set(__name__, "warn", True)
|
||||
await call.delete()
|
||||
45
shadowhikka/sh.modules/RandomMemes.py
Normal file
45
shadowhikka/sh.modules/RandomMemes.py
Normal file
@@ -0,0 +1,45 @@
|
||||
# █▀ █░█ ▄▀█ █▀▄ █▀█ █░█░█
|
||||
# ▄█ █▀█ █▀█ █▄▀ █▄█ ▀▄▀▄▀
|
||||
|
||||
# Copyright 2023 t.me/shadow_modules
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from .. import loader, utils
|
||||
|
||||
from telethon.tl.types import Message # type: ignore
|
||||
|
||||
# meta developer: @shadow_modules
|
||||
# scope: hikka_only
|
||||
# scope: hikka_min 1.3.0
|
||||
# meta banner: https://i.imgur.com/nw5hP8P.jpeg
|
||||
|
||||
|
||||
@loader.tds
|
||||
class RandomMemesMod(loader.Module):
|
||||
"""RandomMemes"""
|
||||
|
||||
strings = {"name": "RandomMemes"}
|
||||
|
||||
def __init__(self):
|
||||
self.bot = "@ffmemesbot"
|
||||
|
||||
async def on_dlmod(self):
|
||||
await utils.dnd(self._client, self.bot, True)
|
||||
|
||||
async def randmemescmd(self, message: Message):
|
||||
"""See random memes"""
|
||||
async with self._client.conversation(self.bot) as conv:
|
||||
msg = await conv.send_message("/start")
|
||||
phtmem = await conv.get_response()
|
||||
await msg.delete()
|
||||
await phtmem.delete()
|
||||
await message.delete()
|
||||
await utils.answer(message, phtmem)
|
||||
56
shadowhikka/sh.modules/StickerDownload.py
Normal file
56
shadowhikka/sh.modules/StickerDownload.py
Normal file
@@ -0,0 +1,56 @@
|
||||
# █▀ █░█ ▄▀█ █▀▄ █▀█ █░█░█
|
||||
# ▄█ █▀█ █▀█ █▄▀ █▄█ ▀▄▀▄▀
|
||||
|
||||
# Copyright 2023 t.me/shadow_modules
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# meta developer: @shadow_modules
|
||||
# scope: hikka_only
|
||||
# scope: hikka_min 1.3.0
|
||||
# meta banner: https://i.imgur.com/1UnAXNf.jpeg
|
||||
|
||||
from .. import loader, utils
|
||||
from telethon.tl.types import Message # type: ignore
|
||||
|
||||
|
||||
@loader.tds
|
||||
class StickerDownloadMod(loader.Module):
|
||||
"""Sticker Downloader"""
|
||||
|
||||
strings = {
|
||||
"name": "StickerDownload",
|
||||
"filerr": "<b>😥 Specify a sticker replay to it</b>",
|
||||
}
|
||||
strings_ru = {"filerr": "<b>😥 Укажи стикер реплаем на него</b>"}
|
||||
|
||||
def __init__(self):
|
||||
self.bot = "@Stickerdownloadbot"
|
||||
|
||||
async def on_dlmod(self):
|
||||
await utils.dnd(self._client, self.bot, True)
|
||||
|
||||
async def stickdowncmd(self, message: Message):
|
||||
"""stickdown <reply for sticker>"""
|
||||
reply = await message.get_reply_message()
|
||||
if not getattr(reply, "sticker", None):
|
||||
await utils.answer(message, self.strings("filerr"))
|
||||
return
|
||||
|
||||
try:
|
||||
async with self._client.conversation(self.bot) as conv:
|
||||
reply = await message.get_reply_message()
|
||||
await conv.send_message(reply)
|
||||
phtmem = await conv.get_response()
|
||||
await conv.mark_read()
|
||||
await message.delete()
|
||||
await utils.answer(message, phtmem)
|
||||
except ValueError:
|
||||
await utils.answer(message, self.strings("filerr"))
|
||||
110
shadowhikka/sh.modules/TableInfo.py
Normal file
110
shadowhikka/sh.modules/TableInfo.py
Normal file
@@ -0,0 +1,110 @@
|
||||
# █▀ █░█ ▄▀█ █▀▄ █▀█ █░█░█
|
||||
# ▄█ █▀█ █▀█ █▄▀ █▄█ ▀▄▀▄▀
|
||||
|
||||
# Copyright 2023 t.me/shadow_modules
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# meta developer: @shadow_modules
|
||||
# scope: hikka_only
|
||||
# scope: hikka_min 1.3.0
|
||||
# meta banner: https://i.imgur.com/GLgp9u1.jpeg
|
||||
|
||||
import logging
|
||||
from .. import loader, utils
|
||||
from telethon.tl.functions.channels import CreateChannelRequest # type: ignore
|
||||
from telethon.tl.types import Message # type: ignore
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class TableMod(loader.Module):
|
||||
"""Information in parents"""
|
||||
|
||||
strings = {
|
||||
"name": "TableMod",
|
||||
"no_args": "<b>😥 Arguments not found</b>",
|
||||
"args_incorrect": "<b>😰 Arguments are not correct\n✔ Example arguments: </b><code>.tableadd name|age|day|year|hobby|userid|geo</code>",
|
||||
"success": "<b>😊 Successfully added</b>",
|
||||
"dont_touch": "💾 Do not touch this chat\n😊It was created for the TableInfo module to work",
|
||||
}
|
||||
|
||||
strings_ru = {
|
||||
"no_args": "<b>😥 Аргументы не найдены</b>",
|
||||
"args_incorrect": "<b>😰 Аргументы не правильные\n✔ Пример аргументов: </b><code>.tableadd name|age|day|year|hobby|userid|geo</code>",
|
||||
"success": "😊 Информация успешно добавлена",
|
||||
"dont_touch": "💾 Не трогайте этот чат\n😊Он был создан для работы модуля TableInfo",
|
||||
}
|
||||
|
||||
async def getchat(self, reset: bool = False) -> int:
|
||||
chat_id = self.get("chat_id")
|
||||
if not reset:
|
||||
if chat_id:
|
||||
return chat_id
|
||||
chat_id = [
|
||||
chat
|
||||
for chat in await self.client.get_dialogs()
|
||||
if chat.name == "TableInfo"
|
||||
]
|
||||
if chat_id:
|
||||
return chat_id[0].id
|
||||
chat_id = (
|
||||
(
|
||||
await self.client(
|
||||
CreateChannelRequest(
|
||||
title="TableInfo",
|
||||
about=self.strings("dont_touch"),
|
||||
megagroup=True,
|
||||
)
|
||||
)
|
||||
)
|
||||
.chats[0]
|
||||
.id
|
||||
)
|
||||
await utils.set_avatar(
|
||||
client=self.client,
|
||||
peer=chat_id,
|
||||
avatar="https://i.pinimg.com/736x/08/16/de/0816de86e13fa2b099c2546aa9c4a205.jpg",
|
||||
)
|
||||
self.set("chat_id", chat_id)
|
||||
return chat_id
|
||||
|
||||
async def tableaddcmd(self, message: Message):
|
||||
args = utils.get_args_raw(message)
|
||||
if not args:
|
||||
await utils.answer(message, self.strings("no_args"))
|
||||
return
|
||||
|
||||
args = args.split("|")
|
||||
|
||||
if len(args) != 7:
|
||||
await utils.answer(message, self.strings("args_incorrect"))
|
||||
return
|
||||
|
||||
name, age, day, year, hobby, userid, geo = args
|
||||
chat = await self.getchat()
|
||||
text = (
|
||||
f"👨🦰 <b>Имя:</b> <i>{name}</i>\n"
|
||||
f"📟 <b>Возраст:</b> <i>{age}</i>\n"
|
||||
f"🎂 <b>День рождения:</b> <i>{day}</i>\n"
|
||||
f"📅 <b>Год рождения:</b> <i>{year}</i>\n"
|
||||
f"🎭 <b>Хобби:</b> <i>{hobby}</i>\n"
|
||||
f"🖥 <b>Айди пользователя:</b> <a href='tg://user?id={userid}'>{userid}</a>\n"
|
||||
f"📍 <b>Местоположение:</b> <i>{geo}</i>\n"
|
||||
)
|
||||
|
||||
try:
|
||||
await self.client.send_message(chat, text)
|
||||
except Exception as e:
|
||||
logger.debug(f"Error while sending message to chat: {e}")
|
||||
chat = await self.getchat(True)
|
||||
await self.client.send_message(chat, text)
|
||||
|
||||
await utils.answer(message, self.strings("success"))
|
||||
64
shadowhikka/sh.modules/VKInline.py
Normal file
64
shadowhikka/sh.modules/VKInline.py
Normal file
@@ -0,0 +1,64 @@
|
||||
# █▀ █░█ ▄▀█ █▀▄ █▀█ █░█░█
|
||||
# ▄█ █▀█ █▀█ █▄▀ █▄█ ▀▄▀▄▀
|
||||
|
||||
# Copyright 2023 t.me/shadow_modules
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from .. import loader, utils
|
||||
from telethon.tl.types import Message # type: ignore
|
||||
|
||||
# meta developer: @shadow_modules, @dan_endy
|
||||
# scope: hikka_only
|
||||
# meta banner: https://i.imgur.com/8prGakZ.jpeg
|
||||
|
||||
|
||||
@loader.tds
|
||||
class VKInlineMod(loader.Module):
|
||||
"""Your vk in inline"""
|
||||
|
||||
strings = {
|
||||
"name": "MyVKInline",
|
||||
"myvk": "<b>👾 My VK</b>",
|
||||
"clickvk": "🦢 Click",
|
||||
"novk": "<b>😰 You didn't enter your VK</b>",
|
||||
}
|
||||
|
||||
strings_ru = {
|
||||
"myvk": "<b>👾 Мой VK</b>",
|
||||
"clickvk": "🦢 Нажми",
|
||||
"novk": "<b>😰 Вы не ввели свой вк</b>",
|
||||
}
|
||||
|
||||
def __init__(self):
|
||||
self.config = loader.ModuleConfig(
|
||||
loader.ConfigValue(
|
||||
"VK",
|
||||
None,
|
||||
lambda: "Your VK",
|
||||
validator=loader.validators.Link(),
|
||||
)
|
||||
)
|
||||
|
||||
@loader.unrestricted
|
||||
async def myvkcmd(self, message: Message):
|
||||
"""The command to display your VK"""
|
||||
if not self.config["VK"]:
|
||||
await utils.answer(message, self.strings("novk", message))
|
||||
return
|
||||
elif "https://" in self.config["VK"]:
|
||||
await self.inline.form(
|
||||
text=self.strings("myvk"),
|
||||
message=message,
|
||||
reply_markup={
|
||||
"text": self.strings("clickvk"),
|
||||
"url": self.config["VK"],
|
||||
},
|
||||
)
|
||||
31
shadowhikka/sh.modules/VulgarStories.py
Normal file
31
shadowhikka/sh.modules/VulgarStories.py
Normal file
@@ -0,0 +1,31 @@
|
||||
# █▀ █░█ ▄▀█ █▀▄ █▀█ █░█░█
|
||||
# ▄█ █▀█ █▀█ █▄▀ █▄█ ▀▄▀▄▀
|
||||
|
||||
# Copyright 2023 t.me/shadow_modules
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# meta developer: @shadow_modules
|
||||
# meta banner: https://i.imgur.com/GqPSdtT.jpeg
|
||||
|
||||
import random
|
||||
from .. import loader, utils
|
||||
from telethon.tl.types import Message # type: ignore
|
||||
|
||||
@loader.tds
|
||||
class VulgarStories(loader.Module):
|
||||
"""VulgarStories"""
|
||||
|
||||
strings = {"name": "VulgarStories"}
|
||||
|
||||
async def vstorcmd(self, message: Message):
|
||||
"""Vulgar Stories for geys."""
|
||||
persik = random.choice(await self.client.get_messages("pirsikowe", limit=100))
|
||||
await utils.answer(message, persik)
|
||||
14
shadowhikka/sh.modules/full.txt
Normal file
14
shadowhikka/sh.modules/full.txt
Normal file
@@ -0,0 +1,14 @@
|
||||
FoxAndDogsGallery
|
||||
InlineVizitka
|
||||
RandomMemes
|
||||
SHChat
|
||||
StickerDownload
|
||||
VKInline
|
||||
trysamp
|
||||
TableInfo
|
||||
MyVizitka
|
||||
NewsLetter
|
||||
100Percent
|
||||
GPT2
|
||||
HentaiManga
|
||||
ConvertTime
|
||||
1
shadowhikka/sh.modules/meduim.txt
Normal file
1
shadowhikka/sh.modules/meduim.txt
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
shadowhikka/sh.modules/minimal.txt
Normal file
1
shadowhikka/sh.modules/minimal.txt
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
35
shadowhikka/sh.modules/trysamp.py
Normal file
35
shadowhikka/sh.modules/trysamp.py
Normal file
@@ -0,0 +1,35 @@
|
||||
# █▀ █░█ ▄▀█ █▀▄ █▀█ █░█░█
|
||||
# ▄█ █▀█ █▀█ █▄▀ █▄█ ▀▄▀▄▀
|
||||
|
||||
# Copyright 2023 t.me/shadow_modules
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# meta developer: @shadow_modules
|
||||
# meta banner: https://i.imgur.com/aGGx93G.jpeg
|
||||
|
||||
import random
|
||||
from .. import loader, utils
|
||||
from telethon.tl.types import Message # type: ignore
|
||||
|
||||
tryrandom = ["Удачно", "Не удачно", "Не удачно", "Удачно"]
|
||||
|
||||
@loader.tds
|
||||
class TrySampMod(loader.Module):
|
||||
"""Try such as in samp"""
|
||||
|
||||
strings = {"name": "TrySamp"}
|
||||
|
||||
async def trycmd(self, message: Message):
|
||||
"""try you luck"""
|
||||
args = utils.get_args_raw(message)
|
||||
await utils.answer(
|
||||
message, f"<b>{random.choice(tryrandom)} | {args}</b>" if args else f"<b>{random.choice(tryrandom)}</b>"
|
||||
)
|
||||
Reference in New Issue
Block a user