time_restricted
Function
Restricts the command to some hours (UTC).
from discord_interactions.slash import time_restrictedSignature
def time_restricted(hours: List[int]) -> CallableParameters
| Name | Type | Default | Description |
|---|---|---|---|
hours | List[int] | required |
Returns
Callable
Details
Example:
@slash.command()@time_restricted([9, 10, 11, 12, 13, 14, 15, 16, 17]) # 9 AM - 5 PM UTCasync def work_hours_only(ctx): ...