Skip to content

Commit

Permalink
Modules: Authorize
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulkhatri137 authored Oct 14, 2021
1 parent 2ab0176 commit c3b21c6
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions bot/modules/authorize.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ def authorize(update,context):
if chat_id not in AUTHORIZED_CHATS:
file.write(f'{chat_id}\n')
AUTHORIZED_CHATS.add(chat_id)
msg = 'Chat authorized'
msg = '☑️Chat authorized'
else:
msg = 'Already authorized chat'
msg = '☑️Already authorized Chat'
else:
# Trying to authorize someone in specific
user_id = reply_message.from_user.id
if user_id not in AUTHORIZED_CHATS:
file.write(f'{user_id}\n')
AUTHORIZED_CHATS.add(user_id)
msg = 'Person Authorized to use the bot!'
msg = '✅User Authorized to use the bot!'
else:
msg = 'Person already authorized'
msg = '✅Already authorized User'
sendMessage(msg, context.bot, update)


Expand All @@ -38,17 +38,17 @@ def unauthorize(update,context):
chat_id = update.effective_chat.id
if chat_id in AUTHORIZED_CHATS:
AUTHORIZED_CHATS.remove(chat_id)
msg = 'Chat unauthorized'
msg = '⚠️Chat unauthorized!'
else:
msg = 'Already unauthorized chat'
msg = '⚠️Already unauthorized Chat!'
else:
# Trying to authorize someone in specific
user_id = reply_message.from_user.id
if user_id in AUTHORIZED_CHATS:
AUTHORIZED_CHATS.remove(user_id)
msg = 'Person unauthorized to use the bot!'
msg = '⚠️User unauthorized to use the bot!'
else:
msg = 'Person already unauthorized!'
msg = '⚠️Already unauthorized User!'
with open('authorized_chats.txt', 'a') as file:
file.truncate(0)
for i in AUTHORIZED_CHATS:
Expand Down

0 comments on commit c3b21c6

Please sign in to comment.