Skip to content

Commit

Permalink
reduce ratelimit for some message handlers
Browse files Browse the repository at this point in the history
Signed-off-by: Sayan Biswas <[email protected]>
  • Loading branch information
Dank-del committed Nov 28, 2023
1 parent 80e1cdf commit 4aeab47
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tg_bot/modules/afk.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def afk(update: Update, context: CallbackContext):
pass

@kigmsg((Filters.all & Filters.chat_type.groups), friendly='afk', group=1)
@rate_limit(5, 60)
@rate_limit(40, 60)
def no_longer_afk(update: Update, context: CallbackContext):
user = update.effective_user
message = update.effective_message
Expand Down
2 changes: 1 addition & 1 deletion tg_bot/modules/sibylsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def get_sibyl_setting(chat_id):


@loggable
@rate_limit(5, 60)
@rate_limit(40, 60)
def sibyl_ban(update: Update, context: CallbackContext) -> Optional[str]:
message = update.effective_message
chat = update.effective_chat
Expand Down
2 changes: 1 addition & 1 deletion tg_bot/modules/warns.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ def list_warn_filters(update: Update, context: CallbackContext):


@loggable
@rate_limit(5, 60)
@rate_limit(40, 60)
def reply_filter(update: Update, context: CallbackContext) -> Optional[str]:
chat: Optional[Chat] = update.effective_chat
message: Optional[Message] = update.effective_message
Expand Down
4 changes: 2 additions & 2 deletions tg_bot/modules/welcome.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,12 +551,12 @@ def new_member(update: Update, context: CallbackContext): # sourcery no-metrics

return ""

@rate_limit(5, 60)
@rate_limit(40, 60)
def cleanServiceFilter(u: Update, _):
if u.effective_message.left_chat_member or u.effective_message.new_chat_members:
return handleCleanService(u)

@rate_limit(5, 60)
@rate_limit(40, 60)
def handleCleanService(update: Update):
if sql.clean_service(update.effective_chat.id):
try:
Expand Down

0 comments on commit 4aeab47

Please sign in to comment.