scheduledRun := get_scheduled_run(Args{key: "giveaway-123"})
send_text_message(Args{
channel_id: trigger.channel_id,
message_content: "Scheduled: " + scheduledRun.scheduled,
})
BlockLogic
Check whether a run is scheduled with a key, and when it runs.
Inputs
KeyRequired
The key of the run.
Example: giveaway-123
Outputs
Scheduled
Whether a run is scheduled with this key.
Example: true
Run At (Unix)
When it runs, empty when nothing is scheduled.
Example: 1700003600
Seconds Left
Seconds until it runs, empty when nothing is scheduled.
Example: 3600
Build a bot using blocks like Get Scheduled Run
Use this block in our visual flow editor. Bots are hosted 24/7 for free on inventor.bot.
Advanced Documentation
This documentation can be useful when using code mode.
ID:
get_scheduled_runInputs
| Field | InventScript name | Value |
|---|---|---|
| Key | key | e.g. "giveaway-123" |
Outputs
| Field | InventScript name | Value |
|---|---|---|
| Scheduled | scheduled | e.g. "true" |
| Run At (Unix) | run_at | e.g. "1700003600" |
| Seconds Left | seconds_left | e.g. "3600" |
Example InventScript
More logic blocks
Run LaterRun a custom block at a later time, like in 10 minutes or 3 days. Its inputs are saved when it's scheduled.Cancel Scheduled RunCancel a run scheduled with Run Later, by its key.CooldownLet the rest of the flow run once per key for a set time. While the key is on cooldown, the blocks inside run instead and the flow stops.LoopRun the nested blocks a fixed number of times.While LoopRepeat blocks while a condition is true.If StatementCompare two values and run different blocks based on the result.Advanced ConditionalRun different blocks based on grouped comparisons.Conditional ValueCompare two values and output one of two values based on the result.FolderOrganize blocks into a folder. Creates a variable scope.BreakStop the current loop and continue with the blocks after it.ContinueSkip the rest of this loop iteration and move to the next one.Exit FlowStop the entire flow immediately. No further blocks will run.Call Custom BlockCall a custom block and use its returned outputs.ReturnReturn outputs from the current custom block and stop executing it.