Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

roll support for users with "admin" role #256

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions bot/skills/roll.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,13 @@ def roll(update: Update, context: CallbackContext):
# todo: https://github.com/vldc-hq/vldc-bot/issues/93
# if bot can't restrict user, user should be passed into towel-mode like state

# TODO: if user is admin, first revoke admin role: telegram.bot.Bot.promote_chat_member
# * get user info (admin title, we should to store it to put it back when restriction is over)
# * revoke admin role
# * mute user as usual

# TODO: we need a way how to give admin role back to user when restriction time is over

mute_min = get_mute_minutes(shots_remained)
result = context.bot.send_message(
update.effective_chat.id,
Expand Down