sleepWait := sleep_wait(Args{duration: "5s"})
send_text_message(Args{
channel_id: trigger.channel_id,
message_content: "Slept (Seconds): " + sleepWait.slept_seconds,
})
Sleep / Wait
BlockTime
Pause the flow for a specified duration.
Duration is a sequence of numbers with unit suffix (s, m, h). Examples: "5s", "30s", "1m30s". Plain numbers are treated as seconds.
Inputs
DurationRequired
How long to sleep (e.g. 5s, 1m, 30s). Plain numbers are treated as seconds.
Example: 5s
Outputs
Slept (Seconds)
Actual number of seconds the block slept.
Example: 5
Slept (Milliseconds)
Actual number of milliseconds the block slept.
Example: 5000
Build a bot using blocks like Sleep / Wait
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. View as Markdown
ID:
sleep_waitInputs
| Field | InventScript name | Value |
|---|---|---|
| Duration | duration | e.g. "5s" |
Outputs
| Field | InventScript name | Value |
|---|---|---|
| Slept (Seconds) | slept_seconds | e.g. "5" |
| Slept (Milliseconds) | slept_milliseconds | e.g. "5000" |
Example InventScript
More time blocks
Get Current Date and TimeGet the current UTC date and time in various formats.Parse Unix TimeParse a Unix timestamp into a human-readable date and time.Get Snowflake TimestampConvert a Discord snowflake ID into a creation date and time.Parse Relative TimeParse a user-provided relative time string into a Unix timestamp.Modify TimeAdd or subtract time from a Unix timestamp.Get Specific TimeGet a specific time in the future or past in a variety of formats.Truncate TimeTruncate a Unix timestamp to a given period.Parse Month NameParse a month name into a number.Parse Date and TimeParse a date and time into a Unix timestamp with a variety of parsing options.Standard Format Date and TimeFormat a Unix timestamp into a standardized date and time string.Generate TimecodeGenerate a Discord timestamp timecode from a Unix time.