mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-21 02:16:09 -05:00
[Modlog] Reduce potential for bad API calls (#2945)
- brings a fix over from #2934
This commit is contained in:
committed by
Toby Harradine
parent
3c1b6ae4cf
commit
2c8152606c
@@ -74,7 +74,8 @@ async def _init(bot: Red):
|
||||
await asyncio.sleep(10) # prevent small delays from causing a 5 minute delay on entry
|
||||
|
||||
attempts = 0
|
||||
while attempts < 12: # wait up to an hour to find a matching case
|
||||
# wait up to an hour to find a matching case
|
||||
while attempts < 12 and guild.me.guild_permissions.view_audit_log:
|
||||
attempts += 1
|
||||
try:
|
||||
entry = await guild.audit_logs(
|
||||
@@ -109,7 +110,8 @@ async def _init(bot: Red):
|
||||
await asyncio.sleep(10) # prevent small delays from causing a 5 minute delay on entry
|
||||
|
||||
attempts = 0
|
||||
while attempts < 12: # wait up to an hour to find a matching case
|
||||
# wait up to an hour to find a matching case
|
||||
while attempts < 12 and guild.me.guild_permissions.view_audit_log:
|
||||
attempts += 1
|
||||
try:
|
||||
entry = await guild.audit_logs(
|
||||
|
||||
Reference in New Issue
Block a user