Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 2c5d409

Browse files
committed
fix key error in rm sudo
Signed-off-by: anasty17 <e.anastayyar@gmail.com>
1 parent 0ee7f72 commit 2c5d409

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ programming in Python.
5454
- Download restricted messages (document or link) by tg private/public/super links (task option)
5555
- Choose transfer by bot or user session incase you have a premium plan (global, user option and task option)
5656
- Mix upload between user and bot session with respect to file size (global, user option and task option)
57-
- Upload with custom layout multiple thumbnail (global, user option and task option)
57+
- Upload with custom layout multiple thubnmail (global, user option and task option)
5858
- Topics support
5959

6060
</details>

‎bot/modules/chat_permission.py‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ async def unauthorize(_, message):
7474
await database.update_user_data(chat_id)
7575
msg = "Unauthorized"
7676
else:
77-
msg = "Already Unauthorized!"
77+
msg = "Already Unauthorized! Authorized Chats added from config must be removed from config."
7878
await send_message(message, msg)
7979

8080

@@ -106,10 +106,13 @@ async def remove_sudo(_, message):
106106
id_ = int(msg[1].strip())
107107
elif reply_to := message.reply_to_message:
108108
id_ = reply_to.from_user.id if reply_to.from_user else reply_to.sender_chat.id
109-
if id_ and id_ not in user_data or user_data[id_].get("SUDO"):
110-
update_user_ldata(id_, "SUDO", False)
111-
await database.update_user_data(id_)
112-
msg = "Demoted"
109+
if id_:
110+
if id_ in user_data and user_data[id_].get("SUDO"):
111+
update_user_ldata(id_, "SUDO", False)
112+
await database.update_user_data(id_)
113+
msg = "Demoted"
114+
else:
115+
msg = "Already Not Sudo! Sudo users added from config must be removed from config."
113116
else:
114117
msg = "Give ID or Reply To message of whom you want to remove from Sudo"
115118
await send_message(message, msg)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /