discord-bot/utils.py
2017-10-17 01:08:15 +02:00

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)