-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRandomChats.py
138 lines (118 loc) · 5.98 KB
/
RandomChats.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
__version__ = (0, 0, 1)
# *
# * $$\ $$\ $$\ $$\ $$\
# * $$ | \__| $$ | $$ | $$ |
# * $$$$$$$\ $$$$$$$\ $$\ $$$$$$\ $$$$$$\$$$$\ $$$$$$\ $$$$$$$ |$$\ $$\ $$ | $$$$$$\ $$$$$$$\
# * $$ _____|$$ __$$\ $$ |\_$$ _| $$ _$$ _$$\ $$ __$$\ $$ __$$ |$$ | $$ |$$ |$$ __$$\ $$ _____|
# * \$$$$$$\ $$ | $$ |$$ | $$ | $$ / $$ / $$ |$$ / $$ |$$ / $$ |$$ | $$ |$$ |$$$$$$$$ |\$$$$$$\
# * \____$$\ $$ | $$ |$$ | $$ |$$\ $$ | $$ | $$ |$$ | $$ |$$ | $$ |$$ | $$ |$$ |$$ ____| \____$$\
# * $$$$$$$ |$$ | $$ |$$ | \$$$$ |$$ | $$ | $$ |\$$$$$$ |\$$$$$$$ |\$$$$$$ |$$ |\$$$$$$$\ $$$$$$$ |
# * \_______/ \__| \__|\__| \____/ \__| \__| \__| \______/ \_______| \______/ \__| \_______|\_______/
# *
# *
# * © Copyright 2023
# *
# * https://t.me/shitmodules
# *
# 🔒 Code is licensed under CC-BY-NC-ND 4.0 unless otherwise specified.
# 🌐 https://creativecommons.org/licenses/by-nc-nd/4.0/
# You CANNOT edit this file without direct permission from the author.
# You can redistribute this file without any changes.
# scope: hikka_only
# scope: hikka_min 1.6.2
# meta pic: https://raw.githubusercontent.com/kamolgks/assets/main/RandomChats.jpg
# meta banner: https://raw.githubusercontent.com/kamolgks/assets/main/RandomChats.jpg
# meta developer: @shitmodules
from telethon import events, functions
from telethon.tl.types import Message
from asyncio.exceptions import TimeoutError
from telethon.errors.rpcerrorlist import YouBlockedUserError
from .. import loader, utils
@loader.tds
class RandomChatsMod(loader.Module):
"""The module throws off a random chat"""
strings = {
"name": "RandomChats",
"processing": "<emoji document_id=5190568934717270805>🙂</emoji><b>Uploading a chat...</b>",
"un-iris": (
"<emoji document_id=5280821895711697516>⛔️</emoji>"
"<b>Unlock this bot: @iris_moon_bot</b>",
),
"time-err": (
"<emoji document_id=5280821895711697516>⛔️</emoji><b>The waiting time has expired.</b> "
"<b>Either the bot is loaded, or it's dead. Try again a little later</b>"
),
}
strings_ru = {
"processing": "<emoji document_id=5190568934717270805>🙂</emoji><b>Загрузка чата...</b>",
"un-iris": (
"<emoji document_id=5280821895711697516>⛔️</emoji>"
"<b>Разблокируй этого бота: @iris_moon_bot</b>",
),
"time-err": (
"<emoji document_id=5280821895711697516>⛔️</emoji><b>Истекло время ожидания.</b> "
"<b>Либо бот нагружен, либо он умер. Попробуйте немного позже.</b>"
),
}
strings_uz = {
"processing": "<emoji document_id=5190568934717270805>🙂</emoji><b>Chat yuklanmoqda...</b>",
"un-iris": (
"<emoji document_id=5280821895711697516>⛔️</emoji>"
"<b>Ushbu botni qora ro'yxatdan chiqaring: @iris_moon_bot</b>",
),
"time-err": (
"<emoji document_id=5280821895711697516>⛔️</emoji>Kutish vaqti tugadi.</b> "
"<b>Yoki bot Yuklangan yoki u vafot etgan. Birozdan keyin sinab ko'ring."
),
}
strings_kk = {
"processing": "<emoji document_id=5190568934717270805>🙂</emoji><b>Чатты жүктеу...</b>",
"un-iris": (
"<emoji document_id=5280821895711697516>⛔️</emoji>"
"<b>Бұл боттың құлпын ашыңыз: @iris_moon_bot</b>",
),
"time-err": (
"<emoji document_id=5280821895711697516>⛔️</emoji><b>Күту уақыты аяқталды.</b>"
"<b>Не бот жүктелген, не ол қайтыс болды. Сәл кейінірек көріңіз.</b>"
),
}
strings_tr = {
"processing": "<emoji document_id=5190568934717270805>🙂</emoji><b>Sohbet yükleniyor...</b>",
"un-iris": (
"<emoji document_id=5280821895711697516>⛔️</emoji><b> </b>"
"<b>Bu botun engellemesini kaldırın: @iris_moon_bot</b>"
),
"time-err": (
"<emoji document_id=5280821895711697516>⛔️</emoji><b>zaman aşımı süresi doldu.</b>"
"<b>Ya bot yüklendi ya da öldü. Lütfen daha sonra tekrar deneyiniz.</b>"
),
}
@loader.command(
ru_doc="> Кидает рандомную ссылку на чат",
uz_doc="> Tasodifiy chat havolasini tashlaydi",
kk_doc="> Кездейсоқ чат сілтемесін лақтырады",
tr_doc="> Sohbete rastgele bir bağlantı atar",
)
async def rchatcmd(self, message: Message):
"""> Throws a random link to the chat"""
msg = await utils.answer(message, self.strings("processing"))
chat = "@iris_moon_bot"
async with message.client.conversation(chat) as conv:
try:
response = conv.wait_event(events.NewMessage(
incoming=True, from_users=chat))
await message.client.send_message(chat, "🔀 Случайная беседа")
response = await response
except YouBlockedUserError:
await message.edit(self.strings("un-iris"))
return
except TimeoutError:
await utils.answer(message, self.strings("time-err"))
return
if response.text:
await msg.edit(f"<emoji document_id=5190568934717270805>🙂</emoji><b>{response.text}<b>")
await message.client(
functions.messages.DeleteHistoryRequest(
peer="@iris_moon_bot", max_id=0, just_clear=False, revoke=True,
),
)