execCC calls are limited to 1 / CC for non-premium users and 10 / CC for premium users
Preface
ExecCC functions are useful when your commands need many dbTopEntries/dbBottomEntries/dbCount (the restriction for non-premium users of YAGPDB, more info about database here) functions or you want to make 2 commands together.
The execCC functions can also be used when you want to make a combination of main commands and sub commands, example here.
Function
Function
Description
execCC ccID channel delay data
scheduleUniqueCC ccID channel delay key data
Same as execCCexcept there can only be 1 scheduled cc execution per server per key, if key already exists then it is overwritten with the new data and delay.
An example would be a mute command that schedules the unmute action sometime in the future. However, let's say you use the unmute command again on the same user, you would want to override the last scheduled unmute to the new one. This can be used for that.
cancelScheduledUniqueCC ccID key
Cancels a previously scheduled custom command execution using scheduleUniqueCC
Example:
To demonstrates execCC and .ExecData using the same CC. Useful when both of the two commands can be triggered by the user, but one of which will execute the other one when the user triggers it.
{{if not .ExecData}}
{{execCC .CCID nil (randInt 1 600) ""}}
{{else}}
Your codes here.
{{end}}
Although the command is triggered every 10 minutes, it will still delay from 1 to 599 seconds (you can specify a time for it). After the delay, the main command will start to be executed.
Function that executes another custom command specified by ccID,max recursion depth is 2 (using .StackDepth shows the current depth) and it's rate-limited strictly at max 10 delayed custom commands executed per channel per minute, if you go over that it will be simply thrown away. Argument channel can be nil, channel's ID or name. Thedelay argument is execution delay of another CC is in seconds. The data argument is content that you pass to the other executed custom command. To retrieve that data you use .ExecData. This example is important > also next snippet which shows you same thing run using the same custom command > .