Skip to content

Commit

Permalink
Update bot to python-telegram-bot 13.9
Browse files Browse the repository at this point in the history
Signed-off-by: Sayan Biswas <[email protected]>
  • Loading branch information
Dank-del authored and itsLuuke committed Dec 12, 2021
1 parent c101d6b commit e21def0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ psutil
psycopg2-binary
pyYAML>=5.1.2
pyrate-limiter
python-telegram-bot==13.8.1
python-telegram-bot==13.9
requests
spamwatch
speedtest-cli
Expand Down
11 changes: 2 additions & 9 deletions tg_bot/modules/bans.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,7 @@ def ban(update: Update, context: CallbackContext): # sourcery no-metrics
message.reply_text("You dont't have permission to delete messages here!")
return ""

r = bot._request.post(bot.base_url + '/banChatSenderChat', {
'sender_chat_id': message.reply_to_message.sender_chat.id,
'chat_id': chat.id
},
r = bot.ban_chat_sender_chat(chat_id=chat.id, sender_chat_id=message.reply_to_message.sender_chat.id)
)
logmsg = (
f"<b>{html.escape(chat.title)}:</b>\n"
Expand Down Expand Up @@ -462,11 +459,7 @@ def unban(update: Update, context: CallbackContext) -> str:
user = res_user(u, message.message_id, chat)

if message.reply_to_message and message.reply_to_message.sender_chat:
r = bot._request.post(bot.base_url + '/unbanChatSenderChat', {
'sender_chat_id': message.reply_to_message.sender_chat.id,
'chat_id': chat.id
},
)
r = bot.unban_chat_sender_chat(chat_id=chat.id, sender_chat_id=message.reply_to_message.sender_chat.id)
if r:
message.reply_text("Channel {} was unbanned successfully from {}".format(
html.escape(message.reply_to_message.sender_chat.title),
Expand Down

0 comments on commit e21def0

Please sign in to comment.