public class Throttling extends Object
Constructor and Description |
---|
Throttling(int usages,
int duration,
boolean globalThrottling)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addUsage(net.dv8tion.jda.api.events.Event event)
Register a usage of a Command.
|
boolean |
check(net.dv8tion.jda.api.events.Event event)
Checks whether the ICommand can be used or if it has reached its limit.
|
public Throttling(int usages, int duration, boolean globalThrottling)
usages
- Limit of usages.duration
- how long until the command can be used again.globalThrottling
- true if limit is handled globally, false is limit is guild-based.public boolean check(net.dv8tion.jda.api.events.Event event)
event
- Event that triggered this call.public void addUsage(net.dv8tion.jda.api.events.Event event)
event
- Discord event that triggered this function call.