forked from hikariatama/ftg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhikarichat.py
executable file
ยท6186 lines (5436 loc) ยท 216 KB
/
hikarichat.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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
__version__ = (13, 0, 3)
# โ โ โ โโโ โโโ โโโ โ
# โโโ โ โ โ โโโ โโโ โ
# ยฉ Copyright 2022
# https://t.me/hikariatama
#
# ๐ Licensed under the GNU AGPLv3
# ๐ https://www.gnu.org/licenses/agpl-3.0.html
# meta pic: https://static.hikari.gay/hikarichat_icon.png
# meta banner: https://mods.hikariatama.ru/badges/hikarichat.jpg
# meta desc: Chat administrator toolkit, now with powerful free version
# meta developer: @hikarimods
# scope: disable_onload_docs
# scope: inline
# scope: hikka_only
# scope: hikka_min 1.3.0
# requires: aiohttp websockets
import abc
import asyncio
import contextlib
import functools
import imghdr
import io
import json
import logging
import random
import re
import time
import typing
from math import ceil
from types import FunctionType
import aiohttp
import requests
import websockets
from aiogram.types import CallbackQuery, ChatPermissions
from aiogram.utils.exceptions import MessageCantBeDeleted, MessageToDeleteNotFound
from telethon.errors import ChatAdminRequiredError, UserAdminInvalidError
from telethon.errors.rpcerrorlist import WebpageCurlFailedError
from telethon.tl.functions.channels import (
EditAdminRequest,
EditBannedRequest,
GetFullChannelRequest,
GetParticipantRequest,
InviteToChannelRequest,
)
from telethon.tl.functions.messages import EditChatDefaultBannedRightsRequest
from telethon.tl.types import (
Channel,
ChannelParticipantCreator,
Chat,
ChatAdminRights,
ChatBannedRights,
DocumentAttributeAnimated,
Message,
MessageEntitySpoiler,
MessageMediaUnsupported,
User,
UserStatusOnline,
)
from .. import loader, utils
from ..inline.types import InlineCall, InlineMessage
try:
from PIL import Image, ImageDraw, ImageFont
except ImportError:
PIL_AVAILABLE = False
else:
PIL_AVAILABLE = True
logger = logging.getLogger(__name__)
version = f"v{__version__[0]}.{__version__[1]}.{__version__[2]}stable"
ver = f"<i>HikariChat {version}</i>"
FLOOD_TIMEOUT = 0.8
FLOOD_TRESHOLD = 4
PROTECTS = {
"antinsfw": "๐ AntiNSFW",
"antiarab": "๐ต๐ธ AntiArab",
"antitagall": "๐ต AntiTagAll",
"antihelp": "๐บ AntiHelp",
"antiflood": "โฑ AntiFlood",
"antichannel": "๐ฏ AntiChannel",
"antispoiler": "๐ป AntiSpoiler",
"report": "๐ฃ Report",
"antiexplicit": "๐คฌ AntiExplicit",
"antiservice": "โ๏ธ AntiService",
"antigif": "๐ AntiGIF",
"antizalgo": "๐ AntiZALGO",
"antistick": "๐จ AntiStick",
"antilagsticks": "โฐ๏ธ AntiLagSticks",
"cas": "๐ก CAS",
"bnd": "๐ฌ BND",
"antiraid": "๐ช AntiRaid",
"banninja": "๐ฅท BanNinja",
"welcome": "๐ Welcome",
"captcha": "๐ฅ Captcha",
}
def fit(line: str, max_size: int) -> str:
if len(line) >= max_size:
return line
offsets_sum = max_size - len(line)
return f"{' ' * ceil(offsets_sum / 2 - 1)}{line}{' ' * int(offsets_sum / 2 - 1)}"
def gen_table(t: typing.List[typing.List[str]]) -> bytes:
table = ""
header = t[0]
rows_sizes = [len(i) + 2 for i in header]
for row in t[1:]:
rows_sizes = [max(len(j) + 2, rows_sizes[i]) for i, j in enumerate(row)]
rows_lines = ["โ" * i for i in rows_sizes]
table += f"โ{('โฏ'.join(rows_lines))}โ\n"
for line in t:
table += (
f"โโฃโฃ {' โโฃโฃ '.join([fit(row, rows_sizes[k]) for k, row in enumerate(line)])} โโฃโฃ\n"
)
table += "โ "
for row in rows_sizes:
table += f"{'โ' * row}โผ"
table = table[:-1] + "โซ\n"
return "\n".join(table.splitlines()[:-1]) + "\n" + f"โ{('โท'.join(rows_lines))}โ\n"
def get_first_name(user: typing.Union[User, Channel]) -> str:
"""Returns first name of user or channel title"""
return utils.escape_html(
user.first_name if isinstance(user, User) else user.title
).strip()
def get_full_name(user: typing.Union[User, Channel]) -> str:
return utils.escape_html(
user.title
if isinstance(user, Channel)
else (
f"{user.first_name} "
+ (user.last_name if getattr(user, "last_name", False) else "")
)
).strip()
BANNED_RIGHTS = {
"view_messages": False,
"send_messages": False,
"send_media": False,
"send_stickers": False,
"send_gifs": False,
"send_games": False,
"send_inline": False,
"send_polls": False,
"change_info": False,
"invite_users": False,
}
class HikariChatAPI:
def __init__(self):
self._bot = "@hikka_userbot"
self._queue = []
self.feds = {}
self.chats = {}
self.variables = {}
self.init_done = asyncio.Event()
self._show_warning = True
self._connected = False
self._inited = False
self._local = False
async def init(
self,
client: "CustomTelegramClient", # type: ignore
db: "Database", # type: ignore
module: loader.Module,
):
"""Entry point"""
self._client = client
self._db = db
self.module = module
if not self.module.get("token"):
await self._get_token()
self._task = asyncio.ensure_future(self._connect())
await self.init_done.wait()
async def _wss(self):
async with websockets.connect(
f"wss://hikarichat.hikariatama.ru/ws/{self.module.get('token')}"
) as wss:
init = json.loads(await wss.recv())
logger.debug(f"HikariChat connection debug info {init}")
if init["event"] == "startup":
self.variables = init["variables"]
elif init["event"] == "license_violation":
await wss.close()
raise Exception("local")
self.init_done.set()
logger.debug("HikariChat connected")
self._show_warning = True
self._connected = True
self._inited = True
while True:
ans = json.loads(await wss.recv())
if ans["event"] == "update_info":
self.chats = ans["chats"]
self.feds = ans["feds"]
await wss.send(json.dumps({"ok": True, "queue": self._queue}))
self._queue = []
for chat in self.chats:
if str(chat) not in self.module._linked_channels:
channel = (
await self._client(GetFullChannelRequest(int(chat)))
).full_chat.linked_chat_id
self.module._linked_channels[str(chat)] = channel or False
if ans["event"] == "queue_status":
await self._client.edit_message(
ans["chat_id"],
ans["message_id"],
ans["text"],
)
async def _connect(self):
while True:
try:
await self._wss()
except Exception:
logger.debug("HikariChat disconnection traceback", exc_info=True)
if not self._inited:
self._local = True
self.variables = json.loads(
(
await utils.run_sync(
requests.get,
"https://gist.githubusercontent.com/hikariatama/31a8246c9c6ad0b451324969d6ff2940/raw/608509efd7fee6fa876227e1c8c3c7dc0a952892/variables.json",
)
).text
)
self._feds = self.module.get("feds", {})
delattr(self, "feds")
self.chats = self.module.get("chats", {})
self._processor_task = asyncio.ensure_future(
self._queue_processor()
)
self.init_done.set()
self._task.cancel()
return
self._connected = False
if self._show_warning:
logger.debug("HikariChat disconnected, retry in 5 sec")
self._show_warning = False
await asyncio.sleep(5)
def request(self, payload: dict, message: typing.Optional[Message] = None):
if isinstance(message, Message):
payload = {
**payload,
**{
"chat_id": utils.get_chat_id(message),
"message_id": message.id,
},
}
self._queue += [payload]
def should_protect(self, chat_id: typing.Union[str, int], protection: str) -> bool:
return (
str(chat_id) in self.chats
and protection in self.chats[str(chat_id)]
and str(self.chats[str(chat_id)][protection][1]) == str(self.module._tg_id)
)
async def nsfw(self, photo: bytes) -> str:
if not self.module.get("token"):
logger.warning("Token is not sent, NSFW check forbidden")
return "sfw"
async with aiohttp.ClientSession() as session:
async with session.request(
"POST",
"https://hikarichat.hikariatama.ru/check_nsfw",
headers={"Authorization": f"Bearer {self.module.get('token')}"},
data={"file": photo},
) as resp:
r = await resp.text()
try:
r = json.loads(r)
except Exception:
logger.exception("Failed to check NSFW")
return "sfw"
if "error" in r and "Rate limit" in r["error"]:
logger.warning("NSFW checker ratelimit exceeded")
return "sfw"
if "success" not in r:
logger.error(f"API error {json.dumps(r, indent=4)}")
return "sfw"
return r["verdict"]
async def _get_token(self):
async with self._client.conversation(self._bot) as conv:
m = await conv.send_message("/token")
r = await conv.get_response()
token = r.raw_text
await m.delete()
await r.delete()
if not token.startswith("kirito_") and not token.startswith("asuna_"):
raise loader.LoadError("Can't get token")
self.module.set("token", token)
await self._client.delete_dialog(self._bot)
def __getattr__(self, attribute: str):
if self._local and attribute == "feds":
return {fed["shortname"]: fed for fed in self._feds.values()}
raise AttributeError
async def _queue_processor(self):
while True:
if not self._queue:
await asyncio.sleep(1)
continue
ERROR = (
"<emoji document_id=5300759756669984376>๐ซ</emoji> <b>API Error:"
" </b><code>{}</code>"
)
async def assert_arguments(args: set, item: dict) -> bool:
if any(i not in item.get("args", {}) for i in args):
if "chat_id" in item:
await self._client.edit_message(
item["chat_id"],
item["message_id"],
(
"<emoji document_id=5300759756669984376>๐ซ</emoji>"
" <b>Bad API arguments, PROKAZNIK!</b>"
),
)
return False
return True
async def error(msg: str, item: dict):
if "chat_id" in item:
await self._client.edit_message(
item["chat_id"],
item["message_id"],
ERROR.format(msg),
)
feds_copy = self._feds.copy()
chats_copy = self.chats.copy()
item = self._queue.pop(0)
u = str(self._client._tg_id)
if item["action"] == "create federation":
if not await assert_arguments({"shortname", "name"}, item):
continue
t = "fed_" + "".join(
[
random.choice(list("abcdefghijklmnopqrstuvwyz1234567890"))
for _ in range(32)
]
)
self._feds[t] = {
"shortname": item["args"]["shortname"],
"name": item["args"]["name"],
"chats": [],
"warns": {},
"admins": [u],
"owner": u,
"fdef": [],
"notes": {},
"uid": t,
}
if item["action"] == "add chat to federation":
if not await assert_arguments({"uid", "cid"}, item):
continue
if item["args"]["uid"] not in self._feds:
await error("Federation doesn't exist", item)
continue
if str(item["args"]["cid"]) in self._feds[item["args"]["uid"]]["chats"]:
await error("Chat is already in this federation", item)
continue
self._feds[item["args"]["uid"]]["chats"] += [str(item["args"]["cid"])]
if item["action"] == "remove chat from federation":
if not await assert_arguments({"uid", "cid"}, item):
continue
if item["args"]["uid"] not in self._feds:
await error("Federation doesn't exist", item)
continue
if (
str(item["args"]["cid"])
not in self._feds[item["args"]["uid"]]["chats"]
):
await error("Chat is not in this federation", item)
continue
self._feds[item["args"]["uid"]]["chats"].remove(
str(item["args"]["cid"])
)
if item["action"] == "update protections":
if not await assert_arguments({"protection", "state", "chat"}, item):
continue
chat, protection, state = (
str(item["args"]["chat"]),
item["args"]["protection"],
item["args"]["state"],
)
if protection not in self.variables["protections"] + ["welcome"]:
await error("Unknown protection type", item)
continue
if (
protection in self.variables["argumented_protects"]
and state not in self.variables["protect_actions"]
or protection not in self.variables["argumented_protects"]
and protection in self.variables["protections"]
and state not in {"on", "off"}
):
await error("Protection state invalid", item)
continue
if chat not in self.chats:
self.chats[chat] = {}
if state == "off":
if protection in self.chats[chat]:
del self.chats[chat][protection]
else:
self.chats[chat][protection] = [state, u]
if item["action"] == "delete federation":
if not await assert_arguments({"uid"}, item):
continue
uid = item["args"]["uid"]
if uid not in self._feds:
await error("Federation doesn't exist", item)
continue
del self._feds[uid]
if item["action"] == "rename federation":
if not await assert_arguments({"uid", "name"}, item):
continue
uid, name = item["args"]["uid"], item["args"]["name"]
if uid not in self._feds:
await error("Federation doesn't exist", item)
continue
self._feds[uid]["name"] = name
if item["action"] == "protect user":
if not await assert_arguments({"uid", "user"}, item):
continue
uid, user = item["args"]["uid"], item["args"]["user"]
user = str(user)
if not user.isdigit():
await error("Unexpected format for user", item)
continue
if uid not in self._feds:
await error("Federation doesn't exist", item)
continue
if user in self._feds[uid]["fdef"]:
self._feds[uid]["fdef"].remove(user)
else:
self._feds[uid]["fdef"] += [user]
if item["action"] == "warn user":
if not await assert_arguments({"uid", "user", "reason"}, item):
continue
uid, user, reason = (
item["args"]["uid"],
item["args"]["user"],
item["args"]["reason"],
)
user = str(user)
if not user.isdigit():
await error("Unexpected format for user", item)
continue
if uid not in self._feds:
await error("Federation doesn't exist", item)
continue
if user not in self._feds[uid]["warns"]:
self._feds[uid]["warns"][user] = []
self._feds[uid]["warns"][user] += [reason]
if item["action"] == "forgive user warn":
if not await assert_arguments({"uid", "user"}, item):
continue
uid, user = item["args"]["uid"], item["args"]["user"]
user = str(user)
if not user.isdigit():
await error("Unexpected format for user", item)
continue
if uid not in self._feds:
await error("Federation doesn't exist", item)
continue
if (
user not in self._feds[uid]["warns"]
or not self._feds[uid]["warns"][user]
):
await error("This user has no warns yet", item)
continue
del self._feds[uid]["warns"][user][-1]
if item["action"] == "clear all user warns":
if not await assert_arguments({"uid", "user"}, item):
continue
uid, user = item["args"]["uid"], item["args"]["user"]
user = str(user)
if not user.isdigit():
if not item["args"].get("silent", False):
await error("Unexpected format for user", item)
continue
if uid not in self._feds:
if not item["args"].get("silent", False):
await error("Federation doesn't exist", item)
continue
if not self._feds[uid].get("warns", {}).get(user):
if not item["args"].get("silent", False):
await error("This user has no warns yet", item)
continue
del self._feds[uid]["warns"][user]
if item["action"] == "clear federation warns":
if not await assert_arguments({"uid"}, item):
continue
uid = item["args"]["uid"]
if uid not in self._feds:
await error("Federation doesn't exist", item)
continue
if not self._feds[uid].get("warns"):
await error("This federation has no warns yet", item)
continue
del self._feds[uid]["warns"]
if item["action"] == "new note":
if not await assert_arguments({"uid", "shortname", "note"}, item):
continue
uid, shortname, note = (
item["args"]["uid"],
item["args"]["shortname"],
item["args"]["note"],
)
if uid not in self._feds:
await error("Federation doesn't exist", item)
continue
self._feds[uid]["notes"][shortname] = {"creator": u, "text": note}
if item["action"] == "delete note":
if not await assert_arguments({"uid", "shortname"}, item):
continue
uid, shortname = item["args"]["uid"], item["args"]["shortname"]
if uid not in self._feds:
await error("Federation doesn't exist", item)
continue
if shortname not in self._feds[uid]["notes"]:
await error(f"Note not found ({uid=}, {shortname=})", item)
continue
del self._feds[uid]["notes"][shortname]
if feds_copy != self._feds:
self.module.set("feds", self._feds)
if chats_copy != self.chats:
self.module.set("chats", self.chats)
api = HikariChatAPI()
def reverse_dict(d: dict) -> dict:
return {val: key for key, val in d.items()}
@loader.tds
class HikariChatMod(loader.Module):
"""
Advanced chat admin toolkit
"""
__metaclass__ = abc.ABCMeta
strings = {
"name": "HikariChat",
"args": (
"<emoji document_id=5300759756669984376>๐ซ</emoji> <b>Args are incorrect</b>"
),
"no_reason": "Not specified",
"antitagall_on": (
"<emoji document_id=5785175271011259591>๐ต</emoji> <b>AntiTagAll is now on"
" in this chat\nAction: {}</b>"
),
"antitagall_off": (
"<emoji document_id=5785175271011259591>๐ต</emoji> <b>AntiTagAll is now off"
" in this chat</b>"
),
"antiarab_on": (
"<emoji document_id=6323257144745395640>๐ต๐ธ</emoji> <b>AntiArab is now on in"
" this chat\nAction: {}</b>"
),
"antiarab_off": (
"<emoji document_id=6323257144745395640>๐ต๐ธ</emoji> <b>AntiArab is now off"
" in this chat</b>"
),
"antilagsticks_on": (
"<emoji document_id=5469654973308476699>๐ฃ</emoji> <b>Destructive stickers"
" protection is now on in this chat</b>"
),
"antilagsticks_off": (
"<emoji document_id=5469654973308476699>๐ฃ</emoji> <b>Destructive stickers"
" protection is now off in this chat</b>"
),
"antizalgo_on": (
"<emoji document_id=5213293263083018856>๐</emoji> <b>AntiZALGO is now on in"
" this chat\nAction: {}</b>"
),
"antizalgo_off": (
"<emoji document_id=5213293263083018856>๐</emoji> <b>AntiZALGO is now off"
" in this chat</b>"
),
"antistick_on": (
"<emoji document_id=5431456208487716895>๐จ</emoji> <b>AntiStick is now on in"
" this chat\nAction: {}</b>"
),
"antistick_off": (
"<emoji document_id=5431456208487716895>๐จ</emoji> <b>AntiStick is now off"
" in this chat</b>"
),
"antihelp_on": (
"<emoji document_id=5467759840463953770>๐บ</emoji> <b>AntiHelp is now on in"
" this chat</b>"
),
"antihelp_off": (
"<emoji document_id=5467759840463953770>๐บ</emoji> <b>AntiHelp is now off in"
" this chat</b>"
),
"antiraid_on": (
"<emoji document_id=6334359218593728345><emoji"
" document_id=6037460928423791421>๐ช</emoji></emoji> <b>AntiRaid is now on"
" in this chat\nAction: {}</b>"
),
"antiraid_off": (
"<emoji document_id=6334359218593728345><emoji"
" document_id=6037460928423791421>๐ช</emoji></emoji> <b>AntiRaid is now off"
" in this chat</b>"
),
"bnd_on": (
"<emoji document_id=5465300082628763143>๐ฌ</emoji> <b>Block-Non-Discussion"
" is now on in this chat\nAction: {}</b>"
),
"bnd_off": (
"<emoji document_id=5465300082628763143>๐ฌ</emoji> <b>Block-Non-Discussion"
" is now off in this chat</b>"
),
"antiraid": (
"<emoji document_id=6334359218593728345><emoji"
" document_id=6037460928423791421>๐ช</emoji></emoji> <b>AntiRaid is On. I {}"
' <a href="{}">{}</a> in chat {}</b>'
),
"antichannel_on": (
"<emoji document_id=5470094069289984325>๐ฏ</emoji> <b>AntiChannel is now on"
" in this chat</b>"
),
"antichannel_off": (
"<emoji document_id=5470094069289984325>๐ฏ</emoji> <b>AntiChannel is now off"
" in this chat</b>"
),
"report_on": (
"<emoji document_id=5213203794619277246>๐ฃ</emoji> <b>Report is now on in"
" this chat</b>"
),
"report_off": (
"<emoji document_id=5213203794619277246>๐ฃ</emoji> <b>Report is now off in"
" this chat</b>"
),
"antiflood_on": (
"<emoji document_id=5384611567125928766>โฑ</emoji> <b>AntiFlood is now on in"
" this chat\nAction: {}</b>"
),
"antiflood_off": (
"<emoji document_id=5384611567125928766>โฑ</emoji> <b>AntiFlood is now off"
" in this chat</b>"
),
"antispoiler_on": (
"<emoji document_id=5798648862591684122>๐ป</emoji> <b>AntiSpoiler is now on"
" in this chat</b>"
),
"antispoiler_off": (
"<emoji document_id=5798648862591684122>๐ป</emoji> <b>AntiSpoiler is now off"
" in this chat</b>"
),
"antigif_on": (
"<emoji document_id=6048825205730577727>๐</emoji> <b>AntiGIF is now on in"
" this chat</b>"
),
"antigif_off": (
"<emoji document_id=6048825205730577727>๐</emoji> <b>AntiGIF is now off in"
" this chat</b>"
),
"antiservice_on": (
"<emoji document_id=5787237370709413702>โ๏ธ</emoji> <b>AntiService is now on"
" in this chat</b>"
),
"antiservice_off": (
"<emoji document_id=5787237370709413702>โ๏ธ</emoji> <b>AntiService is now"
" off in this chat</b>"
),
"banninja_on": (
"<emoji document_id=6323575131239089635>๐ฅท</emoji> <b>BanNinja is now on in"
" this chat</b>"
),
"banninja_off": (
"<emoji document_id=6323575131239089635>๐ฅท</emoji> <b>BanNinja is now off in"
" this chat</b>"
),
"antiexplicit_on": (
"<emoji document_id=5373123633415723713>๐คฌ</emoji> <b>AntiExplicit is now on"
" in this chat\nAction: {}</b>"
),
"antiexplicit_off": (
"<emoji document_id=5373123633415723713>๐คฌ</emoji> <b>AntiExplicit is now"
" off in this chat</b>"
),
"captcha_on": (
"<emoji document_id=5213107179329953547>๐ฅ</emoji> <b>Captcha is now on in"
" this chat\nAction: {}</b>"
),
"captcha_off": (
"<emoji document_id=5213107179329953547>๐ฅ</emoji> <b>Captcha is now off in"
" this chat</b>"
),
"cas_on": (
"<emoji document_id=5300855732009180995>๐ก</emoji> <b>CAS is now on in this"
" chat\nAction: {}</b>"
),
"cas_off": (
"<emoji document_id=5300855732009180995>๐ก</emoji> <b>CAS is now off in this"
" chat</b>"
),
"antinsfw_on": (
"<emoji document_id=4976982981341086273>๐</emoji> <b>AntiNSFW is now on in"
" this chat\nAction: {}</b>"
),
"antinsfw_off": (
"<emoji document_id=4976982981341086273>๐</emoji> <b>AntiNSFW is now off in"
" this chat</b>"
),
"arabic_nickname": (
'<emoji document_id=6323257144745395640>๐ต๐ธ</emoji> <b><a href="{}">{}</a>'
" has hieroglyphics in his nickname.\n๐ Action: I {}</b>"
),
"zalgo": (
'<emoji document_id=5213293263083018856>๐</emoji> <b><a href="{}">{}</a>'
" has ZALGO in his nickname.\n๐ Action: I {}</b>"
),
"bnd": (
'<emoji document_id=5465300082628763143>๐ฌ</emoji> <b><a href="{}">{}</a>'
" sent a message to channel comments without being chat member.\n๐ Action:"
" I {}</b>"
),
"cas": (
'<emoji document_id=5300855732009180995>๐ก</emoji> <b><a href="{}">{}</a>'
" appears to be in Combat Anti Spam database.\n๐ Action: I {}</b>"
),
"stick": (
'<emoji document_id=5431456208487716895>๐จ</emoji> <b><a href="{}">{}</a> is'
" flooding stickers.\n๐ Action: I {}</b>"
),
"explicit": (
'<emoji document_id=5373123633415723713>๐คฌ</emoji> <b><a href="{}">{}</a>'
" sent explicit content.\n๐ Action: I {}</b>"
),
"destructive_stick": (
'<emoji document_id=5300759756669984376>๐ซ</emoji> <b><a href="{}">{}</a>'
" sent destructive sticker.\n๐ Action: I {}</b>"
),
"nsfw_content": (
'<emoji document_id=4976982981341086273>๐</emoji> <b><a href="{}">{}</a>'
" sent NSFW content.\n๐ Action: I {}</b>"
),
"flood": (
'<emoji document_id=5384611567125928766>โฑ</emoji> <b><a href="{}">{}</a> is'
" flooding.\n๐ Action: I {}</b>"
),
"tagall": (
'<emoji document_id=5785175271011259591>๐ต</emoji> <b><a href="{}">{}</a>'
" used TagAll.\n๐ Action: I {}</b>"
),
"fwarn": (
"<emoji document_id=5193091781327068499>๐ฎโโ๏ธ</emoji><emoji"
' document_id=5773781976905421370>๐ผ</emoji> <b><a href="{}">{}</a></b> got'
" {}/{} federative warn\nReason: <b>{}</b>\n\n{}"
),
"no_fed_warns": (
"<emoji document_id=5193091781327068499>๐ฎโโ๏ธ</emoji> <b>This federation has"
" no warns yet</b>"
),
"no_warns": (
'<emoji document_id=5193091781327068499>๐ฎโโ๏ธ</emoji> <b><a href="{}">{}</a>'
" has no warns yet</b>"
),
"warns": (
'<emoji document_id=5193091781327068499>๐ฎโโ๏ธ</emoji> <b><a href="{}">{}</a>'
" has {}/{} warns</b>\n\n<i>{}</i>"
),
"warns_adm_fed": (
"<emoji document_id=5193091781327068499>๐ฎโโ๏ธ</emoji> <b>Warns in this"
" federation</b>:\n"
),
"dwarn_fed": (
"<emoji document_id=5193091781327068499>๐ฎโโ๏ธ</emoji> <b>Forgave last"
' federative warn of <a href="tg://user?id={}">{}</a></b>'
),
"clrwarns_fed": (
"<emoji document_id=5193091781327068499>๐ฎโโ๏ธ</emoji> <b>Forgave all"
' federative warns of <a href="tg://user?id={}">{}</a></b>'
),
"warns_limit": (
'<emoji document_id=5193091781327068499>๐ฎโโ๏ธ</emoji> <b><a href="{}">{}</a>'
" reached warns limit.\nAction: I {}</b>"
),
"welcome": (
"<emoji document_id=5472055112702629499>๐</emoji> <b>Now I will greet"
" people in this chat</b>\n{}"
),
"unwelcome": (
"<emoji document_id=5472055112702629499>๐</emoji> <b>Now I will not greet"
" people in this chat</b>"
),
"chat404": "๐ <b>I am not protecting this chat yet.</b>\n",
"protections": (
"<b><emoji document_id=6323257144745395640>๐ต๐ธ</emoji>"
" <code>.AntiArab</code> - Bans spammy arabs\n<b><emoji"
" document_id=5467759840463953770>๐บ</emoji> <code>.AntiHelp</code> -"
" Removes frequent userbot commands\n<b><emoji"
" document_id=5785175271011259591>๐ต</emoji> <code>.AntiTagAll</code> -"
" Restricts tagging all members\n<b><emoji"
" document_id=5472055112702629499>๐</emoji> <code>.Welcome</code> - Greets"
" new members\n<b><emoji document_id=6334359218593728345><emoji"
" document_id=6037460928423791421>๐ช</emoji></emoji> <code>.AntiRaid</code>"
" - Bans all new members\n<b><emoji"
" document_id=5470094069289984325>๐ฏ</emoji> <code>.AntiChannel</code> -"
" Restricts writing on behalf of channels\n<b><emoji"
" document_id=5798648862591684122>๐ป</emoji> <code>.AntiSpoiler</code> -"
" Restricts spoilers\n<b><emoji document_id=6048825205730577727>๐</emoji>"
" <code>.AntiGIF</code> - Restricts GIFs\n<b>๐ <code>.AntiNSFW</code> -"
" Restricts NSFW photos and stickers\n<b><emoji"
" document_id=5384611567125928766>โฑ</emoji> <code>.AntiFlood</code> -"
" Prevents flooding\n<b><emoji document_id=5373123633415723713>๐คฌ</emoji>"
" <code>.AntiExplicit</code> - Restricts explicit content\n<b><emoji"
" document_id=5787237370709413702>โ๏ธ</emoji> <code>.AntiService</code> -"
" Removes service messages\n<b><emoji"
" document_id=5213293263083018856>๐</emoji> <code>.AntiZALGO</code> -"
" Penalty for users with ZALGO in nickname\n<b><emoji"
" document_id=5431456208487716895>๐จ</emoji> <code>.AntiStick</code> -"
" Prevents stickers flood\n<b><emoji"
" document_id=5213107179329953547>๐ฅ</emoji> <code>.Captcha</code> -"
" Requires every new participant to complete captcha\n<b><emoji"
" document_id=5215470334760721739>๐ก</emoji> <code>.CAS</code> - Check every"
" new participant through Combat Anti Spam\n<b><emoji"
" document_id=5465300082628763143>๐ฌ</emoji> <code>.BND</code> - Restricts"
" messages from users, which are not a participants of chat"
" (comments)\n<b><emoji document_id=6323575131239089635>๐ฅท</emoji>"
" <code>.BanNinja</code> - Automatic version of AntiRaid\n<b>โฐ๏ธ"
" <code>.AntiLagSticks</code> - Bans laggy stickers\n<b>๐พ Admin:"
" </b><code>.ban</code> <code>.kick</code>"
" <code>.mute</code>\n<code>.unban</code> <code>.unmute</code> <b>- Admin"
" tools</b>\n<b><emoji document_id=5193091781327068499>๐ฎโโ๏ธ</emoji>"
" Warns:</b> <code>.warn</code> <code>.warns</code>\n<code>.dwarn</code>"
" <code>.clrwarns</code> <b>- Warning system</b>\n<b><emoji"
" document_id=5773781976905421370>๐ผ</emoji> Federations:</b>"
" <code>.fadd</code> <code>.frm</code>"
" <code>.newfed</code>\n<code>.namefed</code> <code>.fban</code>"
" <code>.rmfed</code> <code>.feds</code>\n<code>.fpromote</code>"
" <code>.fdemote</code>\n<code>.fdef</code> <code>.fdeflist</code> <b>-"
" Controlling multiple chats</b>\n<b>๐ Notes:</b> <code>.fsave</code>"
" <code>.fstop</code> <code>.fnotes</code> <b>- Federative notes</b>"
),
"not_admin": "๐คทโโ๏ธ <b>I'm not admin here, or don't have enough rights</b>",
"mute": (
'<emoji document_id=5372800046284674872>๐ค</emoji> <b><a href="{}">{}</a>'
" was muted {}. Reason: </b><i>{}</i>\n\n{}"
),
"mute_log": (
'<emoji document_id=5372800046284674872>๐ค</emoji> <b><a href="{}">{}</a>'
' was muted {} in <a href="{}">{}</a>. Reason: </b><i>{}</i>\n\n{}'
),
"ban": (
'<emoji document_id=5247152118069992250>๐</emoji> <b><a href="{}">{}</a>'
" was banned {}. Reason: </b><i>{}</i>\n\n{}"
),
"ban_log": (
'<emoji document_id=5247152118069992250>๐</emoji> <b><a href="{}">{}</a>'
' was banned {} in <a href="{}">{}</a>. Reason: </b><i>{}</i>\n\n{}'
),
"kick": (
'<emoji document_id=6037460928423791421>๐ช</emoji> <b><a href="{}">{}</a>'
" was kicked. Reason: </b><i>{}</i>\n\n{}"
),
"kick_log": (
'<emoji document_id=6037460928423791421>๐ช</emoji> <b><a href="{}">{}</a>'
' was kicked in <a href="{}">{}</a>. Reason: </b><i>{}</i>\n\n{}'
),
"unmuted": (
'<emoji document_id=5436040291507247633>๐</emoji> <b><a href="{}">{}</a>'
" was unmuted</b>"
),
"unmuted_log": (
'<emoji document_id=5436040291507247633>๐</emoji> <b><a href="{}">{}</a>'
' was unmuted in <a href="{}">{}</a></b>'
),
"unban": (
'<emoji document_id=5469791106591890404>๐ช</emoji> <b><a href="{}">{}</a>'
" was unbanned</b>"