mirror of
https://github.com/MuRuLOSE/limoka.git
synced 2026-06-16 14:34:17 +02:00
Added and updated repositories 2025-07-11 08:27:20
This commit is contained in:
@@ -1,169 +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 []),
|
||||
],
|
||||
],
|
||||
}
|
||||
# █▀ █░█ ▄▀█ █▀▄ █▀█ █░█░█
|
||||
# ▄█ █▀█ █▀█ █▄▀ █▄█ ▀▄▀▄▀
|
||||
|
||||
# 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 []),
|
||||
],
|
||||
],
|
||||
}
|
||||
|
||||
@@ -1,169 +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()
|
||||
# █▀ █░█ ▄▀█ █▀▄ █▀█ █░█░█
|
||||
# ▄█ █▀█ █▀█ █▄▀ █▄█ ▀▄▀▄▀
|
||||
|
||||
# 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()
|
||||
|
||||
@@ -1,45 +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)
|
||||
# █▀ █░█ ▄▀█ █▀▄ █▀█ █░█░█
|
||||
# ▄█ █▀█ █▀█ █▄▀ █▄█ ▀▄▀▄▀
|
||||
|
||||
# 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)
|
||||
|
||||
@@ -1,56 +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"))
|
||||
# █▀ █░█ ▄▀█ █▀▄ █▀█ █░█░█
|
||||
# ▄█ █▀█ █▀█ █▄▀ █▄█ ▀▄▀▄▀
|
||||
|
||||
# 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"))
|
||||
|
||||
@@ -1,110 +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"))
|
||||
# █▀ █░█ ▄▀█ █▀▄ █▀█ █░█░█
|
||||
# ▄█ █▀█ █▀█ █▄▀ █▄█ ▀▄▀▄▀
|
||||
|
||||
# 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"))
|
||||
|
||||
@@ -1,64 +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"],
|
||||
},
|
||||
)
|
||||
# █▀ █░█ ▄▀█ █▀▄ █▀█ █░█░█
|
||||
# ▄█ █▀█ █▀█ █▄▀ █▄█ ▀▄▀▄▀
|
||||
|
||||
# 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"],
|
||||
},
|
||||
)
|
||||
|
||||
@@ -1,35 +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>"
|
||||
)
|
||||
# █▀ █░█ ▄▀█ █▀▄ █▀█ █░█░█
|
||||
# ▄█ █▀█ █▀█ █▄▀ █▄█ ▀▄▀▄▀
|
||||
|
||||
# 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