Skip to content

Commit c855f1d

Browse files
committed
Add minimum timeout to ratelimit message
1 parent 125ee12 commit c855f1d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bot/src/ghutils/utils/discord/components.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ async def _check_ratelimit(interaction: Interaction, state: LoginState) -> bool:
164164
color=Color.red(),
165165
),
166166
ephemeral=True,
167-
delete_after=(retry_time - now).total_seconds(),
167+
# delete the message after the timeout, but wait at least 10 seconds to allow reading it fully
168+
delete_after=max((retry_time - now).total_seconds(), 10),
168169
)
169170
return False
170171
return True

0 commit comments

Comments
 (0)