Spaces:
Sleeping
Sleeping
Captain Ezio
commited on
Commit
·
6d8fd89
1
Parent(s):
b72a89d
done
Browse files- Powers/plugins/bans.py +33 -13
- Powers/plugins/muting.py +8 -0
Powers/plugins/bans.py
CHANGED
@@ -79,9 +79,9 @@ async def tban_usr(c: Gojo, m: Message):
|
|
79 |
await m.stop_propagation()
|
80 |
|
81 |
try:
|
82 |
-
admin =
|
83 |
-
banned =
|
84 |
-
chat_title =
|
85 |
LOGGER.info(f"{m.from_user.id} tbanned {user_id} in {m.chat.id}")
|
86 |
await m.chat.ban_member(
|
87 |
user_id,
|
@@ -283,15 +283,17 @@ async def dtban_usr(c: Gojo, m: Message):
|
|
283 |
await m.stop_propagation()
|
284 |
|
285 |
try:
|
286 |
-
admin =
|
287 |
-
banned =
|
288 |
chat_title = (m.chat.title,)
|
289 |
LOGGER.info(f"{m.from_user.id} dtbanned {user_id} in {m.chat.id}")
|
290 |
await m.chat.ban_member(user_id, until_date=bantime)
|
291 |
await m.reply_to_message.delete()
|
292 |
txt = f"{admin} banned {banned} in <b>{chat_title}</b>!"
|
293 |
-
|
294 |
-
|
|
|
|
|
295 |
keyboard = InlineKeyboardMarkup(
|
296 |
[
|
297 |
[
|
@@ -387,7 +389,10 @@ async def kick_usr(c: Gojo, m: Message):
|
|
387 |
LOGGER.info(f"{m.from_user.id} kicked {user_id} in {m.chat.id}")
|
388 |
await m.chat.ban_member(user_id)
|
389 |
txt = f"{admin} kicked {kicked} in <b>{chat_title}</b>!"
|
390 |
-
|
|
|
|
|
|
|
391 |
# await m.reply_text(txt, reply_to_message_id=r_id)
|
392 |
await m.reply_animation(
|
393 |
reply_to_message_id=r_id,
|
@@ -535,7 +540,10 @@ async def dkick_usr(c: Gojo, m: Message):
|
|
535 |
kicked = await mention_html(user_first_name, user_id)
|
536 |
chat_title = m.chat.title
|
537 |
txt = f"{admin} kicked {kicked} in <b>{chat_title}</b>!"
|
538 |
-
|
|
|
|
|
|
|
539 |
await c.send_message(m.chat.id, txt)
|
540 |
await c.send_animation(
|
541 |
chat_id=m.chat.id,
|
@@ -598,7 +606,10 @@ async def unban_usr(c: Gojo, m: Message):
|
|
598 |
unbanned = await mention_html(user_first_name, user_id)
|
599 |
chat_title = (m.chat.title,)
|
600 |
txt = f"{admin} unbanned {unbanned} in chat <b>{chat_title}</b>!"
|
601 |
-
|
|
|
|
|
|
|
602 |
await m.reply_text(txt)
|
603 |
except ChatAdminRequired:
|
604 |
await m.reply_text(text="I'm not admin or I don't have rights.")
|
@@ -744,7 +755,10 @@ async def dban_usr(c: Gojo, m: Message):
|
|
744 |
await m.reply_to_message.delete()
|
745 |
await m.chat.ban_member(user_id)
|
746 |
txt = f"{m.from_user.mention} banned {m.reply_to_message.from_user.mention} in <b>{m.chat.title}</b>!"
|
747 |
-
|
|
|
|
|
|
|
748 |
keyboard = InlineKeyboardMarkup(
|
749 |
[
|
750 |
[
|
@@ -841,7 +855,10 @@ async def ban_usr(c: Gojo, m: Message):
|
|
841 |
await m.chat.ban_member(user_id)
|
842 |
banned = await mention_html(user_first_name, user_id)
|
843 |
txt = f"{m.from_user.mention} banned {banned} in <b>{m.chat.title}</b>!"
|
844 |
-
|
|
|
|
|
|
|
845 |
keyboard = InlineKeyboardMarkup(
|
846 |
[
|
847 |
[
|
@@ -913,7 +930,10 @@ async def kickme(_, m: Message):
|
|
913 |
LOGGER.info(f"{m.from_user.id} kickme used by {m.from_user.id} in {m.chat.id}")
|
914 |
await m.chat.ban_member(m.from_user.id)
|
915 |
txt = "Why not let me help you!"
|
916 |
-
|
|
|
|
|
|
|
917 |
await m.reply_animation(animation=str(choice(KICK_GIFS)), caption=txt)
|
918 |
await m.chat.unban_member(m.from_user.id)
|
919 |
except RPCError as ef:
|
|
|
79 |
await m.stop_propagation()
|
80 |
|
81 |
try:
|
82 |
+
admin = await mention_html(m.from_user.first_name, m.from_user.id)
|
83 |
+
banned = await mention_html(user_first_name, user_id)
|
84 |
+
chat_title = m.chat.title,
|
85 |
LOGGER.info(f"{m.from_user.id} tbanned {user_id} in {m.chat.id}")
|
86 |
await m.chat.ban_member(
|
87 |
user_id,
|
|
|
283 |
await m.stop_propagation()
|
284 |
|
285 |
try:
|
286 |
+
admin = await mention_html(m.from_user.first_name, m.from_user.id)
|
287 |
+
banned = await mention_html(user_first_name, user_id)
|
288 |
chat_title = (m.chat.title,)
|
289 |
LOGGER.info(f"{m.from_user.id} dtbanned {user_id} in {m.chat.id}")
|
290 |
await m.chat.ban_member(user_id, until_date=bantime)
|
291 |
await m.reply_to_message.delete()
|
292 |
txt = f"{admin} banned {banned} in <b>{chat_title}</b>!"
|
293 |
+
if reason:
|
294 |
+
txt += f"\n<b>Reason</b>: {reason}"
|
295 |
+
else:
|
296 |
+
txt += "\n<b>Reason</b>: Not Specified"
|
297 |
keyboard = InlineKeyboardMarkup(
|
298 |
[
|
299 |
[
|
|
|
389 |
LOGGER.info(f"{m.from_user.id} kicked {user_id} in {m.chat.id}")
|
390 |
await m.chat.ban_member(user_id)
|
391 |
txt = f"{admin} kicked {kicked} in <b>{chat_title}</b>!"
|
392 |
+
if reason:
|
393 |
+
txt += f"\n<b>Reason</b>: {reason}"
|
394 |
+
else:
|
395 |
+
txt += "\n<b>Reason</b>: Not Specified"
|
396 |
# await m.reply_text(txt, reply_to_message_id=r_id)
|
397 |
await m.reply_animation(
|
398 |
reply_to_message_id=r_id,
|
|
|
540 |
kicked = await mention_html(user_first_name, user_id)
|
541 |
chat_title = m.chat.title
|
542 |
txt = f"{admin} kicked {kicked} in <b>{chat_title}</b>!"
|
543 |
+
if reason:
|
544 |
+
txt += f"\n<b>Reason</b>: {reason}"
|
545 |
+
else:
|
546 |
+
txt += "\n<b>Reason</b>: Not Specified"
|
547 |
await c.send_message(m.chat.id, txt)
|
548 |
await c.send_animation(
|
549 |
chat_id=m.chat.id,
|
|
|
606 |
unbanned = await mention_html(user_first_name, user_id)
|
607 |
chat_title = (m.chat.title,)
|
608 |
txt = f"{admin} unbanned {unbanned} in chat <b>{chat_title}</b>!"
|
609 |
+
if reason:
|
610 |
+
txt += f"\n<b>Reason</b>: {reason}"
|
611 |
+
else:
|
612 |
+
txt += "\n<b>Reason</b>: Not Specified"
|
613 |
await m.reply_text(txt)
|
614 |
except ChatAdminRequired:
|
615 |
await m.reply_text(text="I'm not admin or I don't have rights.")
|
|
|
755 |
await m.reply_to_message.delete()
|
756 |
await m.chat.ban_member(user_id)
|
757 |
txt = f"{m.from_user.mention} banned {m.reply_to_message.from_user.mention} in <b>{m.chat.title}</b>!"
|
758 |
+
if reason:
|
759 |
+
txt += f"\n<b>Reason</b>: {reason}"
|
760 |
+
else:
|
761 |
+
txt += "\n<b>Reason</b>: Not Specified"
|
762 |
keyboard = InlineKeyboardMarkup(
|
763 |
[
|
764 |
[
|
|
|
855 |
await m.chat.ban_member(user_id)
|
856 |
banned = await mention_html(user_first_name, user_id)
|
857 |
txt = f"{m.from_user.mention} banned {banned} in <b>{m.chat.title}</b>!"
|
858 |
+
if reason:
|
859 |
+
txt += f"\n<b>Reason</b>: {reason}"
|
860 |
+
else:
|
861 |
+
txt += "\n<b>Reason</b>: Not Specified"
|
862 |
keyboard = InlineKeyboardMarkup(
|
863 |
[
|
864 |
[
|
|
|
930 |
LOGGER.info(f"{m.from_user.id} kickme used by {m.from_user.id} in {m.chat.id}")
|
931 |
await m.chat.ban_member(m.from_user.id)
|
932 |
txt = "Why not let me help you!"
|
933 |
+
if reason:
|
934 |
+
txt += f"\n<b>Reason</b>: {reason}"
|
935 |
+
else:
|
936 |
+
txt += "\n<b>Reason</b>: Not Specified"
|
937 |
await m.reply_animation(animation=str(choice(KICK_GIFS)), caption=txt)
|
938 |
await m.chat.unban_member(m.from_user.id)
|
939 |
except RPCError as ef:
|
Powers/plugins/muting.py
CHANGED
@@ -90,6 +90,8 @@ async def tmute_usr(c: Gojo, m: Message):
|
|
90 |
txt = f"Admin {admin} muted {muted}!"
|
91 |
if reason:
|
92 |
txt += f"\n<b>Reason</b>: {reason}"
|
|
|
|
|
93 |
keyboard = InlineKeyboardMarkup(
|
94 |
[
|
95 |
[
|
@@ -195,6 +197,8 @@ async def dtmute_usr(c: Gojo, m: Message):
|
|
195 |
txt = f"Admin {admin} muted {muted}!"
|
196 |
if reason:
|
197 |
txt += f"\n<b>Reason</b>: {reason}"
|
|
|
|
|
198 |
keyboard = InlineKeyboardMarkup(
|
199 |
[
|
200 |
[
|
@@ -369,6 +373,8 @@ async def mute_usr(c: Gojo, m: Message):
|
|
369 |
txt = f"Admin {admin} muted {muted}!"
|
370 |
if reason:
|
371 |
txt += f"\n<b>Reason</b>: {reason}"
|
|
|
|
|
372 |
keyboard = InlineKeyboardMarkup(
|
373 |
[
|
374 |
[
|
@@ -521,6 +527,8 @@ async def dmute_usr(c: Gojo, m: Message):
|
|
521 |
txt = f"Admin {admin} muted {muted}!"
|
522 |
if reason:
|
523 |
txt += f"\n<b>Reason</b>: {reason}"
|
|
|
|
|
524 |
keyboard = InlineKeyboardMarkup(
|
525 |
[
|
526 |
[
|
|
|
90 |
txt = f"Admin {admin} muted {muted}!"
|
91 |
if reason:
|
92 |
txt += f"\n<b>Reason</b>: {reason}"
|
93 |
+
else:
|
94 |
+
txt += "\n<b>Reason</b>: Not Specified"
|
95 |
keyboard = InlineKeyboardMarkup(
|
96 |
[
|
97 |
[
|
|
|
197 |
txt = f"Admin {admin} muted {muted}!"
|
198 |
if reason:
|
199 |
txt += f"\n<b>Reason</b>: {reason}"
|
200 |
+
else:
|
201 |
+
txt += "\n<b>Reason</b>: Not Specified"
|
202 |
keyboard = InlineKeyboardMarkup(
|
203 |
[
|
204 |
[
|
|
|
373 |
txt = f"Admin {admin} muted {muted}!"
|
374 |
if reason:
|
375 |
txt += f"\n<b>Reason</b>: {reason}"
|
376 |
+
else:
|
377 |
+
txt += "\n<b>Reason</b>: Not Specified"
|
378 |
keyboard = InlineKeyboardMarkup(
|
379 |
[
|
380 |
[
|
|
|
527 |
txt = f"Admin {admin} muted {muted}!"
|
528 |
if reason:
|
529 |
txt += f"\n<b>Reason</b>: {reason}"
|
530 |
+
else:
|
531 |
+
txt += "\n<b>Reason</b>: Not Specified"
|
532 |
keyboard = InlineKeyboardMarkup(
|
533 |
[
|
534 |
[
|