Cooldown
resetOneTime
$resetOneTime
$resetOneTime frees a claim taken by $onlyOneTime, so the script can run again. Nothing happens when the claim is already free. This function does not exist in BibiScript.
Syntax
$resetOneTime[(type);(userID);(command)]
Parameters
| Parameter | Description |
|---|---|
type |
Optional. user, server or global. Without it, the types claimed by $onlyOneTime earlier in the same run are re-armed (user when there was none). Any other value raises “One-time type must be user, server or global.”. |
userID |
Optional. Re-arms this user’s claim instead of the current user’s (for user). |
command |
Optional. Name of the command whose claim is re-armed, to reset it from another command, for example an admin command. Default: the running command. |
Return value
- An empty string.
Examples
Give another chance
$onlyOneTime[Welcome!;user;Already done.]
$if[$random[1;5]==1]
$resetOneTime
$endif
Admin command: re-arm a user’s gift
$onlyPerms[administrator;Admins only.]
$resetOneTime[user;$mentioned[1];claim-gift]
Done.
Re-arm for everybody
$resetOneTime[global]
Try it
Paste an example into the playground to preview its message (functions that act on Discord are not run), or build the same thing with blocks.