mirror of
https://github.com/RPCS3/discord-bot.git
synced 2025-02-05 01:47:51 +00:00
10 lines
256 B
Python
10 lines
256 B
Python
def limit_int(amount: int, high: int, low: int = 0) -> int:
|
|
"""
|
|
Limits an integer.
|
|
:param amount: amount
|
|
:param high: high limit
|
|
:param low: low limit
|
|
:return: limited integer
|
|
"""
|
|
return low if amount < low else (high if amount > high else amount)
|