Update events.py (#4431)

This commit is contained in:
jack1142 2020-09-28 03:27:29 +02:00 committed by GitHub
parent a2ae485286
commit 284080ec83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -297,12 +297,17 @@ def init_events(bot, cli_flags):
msg = _("This command is on cooldown. Try again in 1 second.") msg = _("This command is on cooldown. Try again in 1 second.")
await ctx.send(msg, delete_after=error.retry_after) await ctx.send(msg, delete_after=error.retry_after)
elif isinstance(error, commands.MaxConcurrencyReached): elif isinstance(error, commands.MaxConcurrencyReached):
await ctx.send( if error.per is commands.BucketType.default:
_( msg = _(
"Too many people using this command."
" It can only be used {number} time(s) concurrently."
).format(number=error.number)
else:
msg = _(
"Too many people using this command." "Too many people using this command."
" It can only be used {number} time(s) per {type} concurrently." " It can only be used {number} time(s) per {type} concurrently."
).format(number=error.number, type=error.per.name) ).format(number=error.number, type=error.per.name)
) await ctx.send(msg)
else: else:
log.exception(type(error).__name__, exc_info=error) log.exception(type(error).__name__, exc_info=error)