-
Notifications
You must be signed in to change notification settings - Fork 295
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
Banhammer: add /mute command, issue #343 #345
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides review comments, there should be some (a lot) of merge conflicts to solve, but I'd be glad to merge it once everything is sorted out since it's a very requested feature.
@@ -199,10 +199,14 @@ function api.kickUser(chat_id, user_id) | |||
end | |||
end | |||
|
|||
function api.muteUser(chat_id, user_id) | |||
function api.muteUser(chat_id, user_id, until_date) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function has been moved to utilities.lua
return markup | ||
end | ||
|
||
local function markup_mute(chat_id, user_id, time_value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would've been better if you could reuse the keyboard for tempban instead of copy-pasting it's code.
@@ -138,26 +179,45 @@ function plugin.onTextMessage(msg, blocks) | |||
end | |||
|
|||
function plugin.onCallbackQuery(msg, matches) | |||
if not u.can(msg.chat.id, msg.from.id, 'can_restrict_members') then | |||
if not u.is_allowed('hammer', msg.chat.id, msg.from) then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you replace the new permission check with the dummy one?
if not res then | ||
motivation = motivation or i18n("I can't kick this user.\n" | ||
motivation = i18n("I can't kick this user.\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could just use the new api_err.trans()
function.
No description provided.