for scheduledEvent := range get_scheduled_events(Args{server_id: trigger.server_id}) {
send_text_message(Args{
channel_id: trigger.channel_id,
message_content: "Event ID: " + scheduledEvent.event_id,
})
}
Get Scheduled Events
LoopScheduled Event
List scheduled events for a server.
- Loop block: the blocks placed inside it run once for each item, and can use the current item's outputs.
Inputs
Server IDRequired
Server to list events for.
Loop Body
Blocks to run for each event.
Holds blocks
Outputs
Iteration Number
Current iteration (1-based).
Example: 1
Total Iterations
Total number of iterations.
Example: 3
Event ID
ID of the scheduled event.
Server ID
ID of the server for the event.
Channel ID
Channel ID for Stage/Voice events.
Creator User ID
User ID of the event creator.
Name
Name of the scheduled event.
Description
Description of the scheduled event.
Start Time (Unix)
Start time as Unix timestamp.
End Time (Unix)
End time as Unix timestamp.
Status
Status of the scheduled event.
Type
Event type.
Subscribed User Count
Number of users subscribed to the event.
Build a bot using blocks like Get Scheduled Events
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:
get_scheduled_events- Loop block: write
for item := range get_scheduled_events(Args{...}) { ... }and read the current item's outputs fromitem. See loops.
Inputs
| Field | InventScript name | Value |
|---|---|---|
| Server ID | server_id | |
| Loop Body | body | blocks: func() { ... } |
Outputs
| Field | InventScript name | Value |
|---|---|---|
| Iteration Number | iteration_number | e.g. "1" |
| Total Iterations | total_iterations | e.g. "3" |
| Event ID | event_id | |
| Server ID | server_id | |
| Channel ID | channel_id | |
| Creator User ID | creator_user_id | |
| Name | name | |
| Description | description | |
| Start Time (Unix) | start_time_unix | |
| End Time (Unix) | end_time_unix | |
| Status | status | |
| Type | type_ | |
| Subscribed User Count | subscribed_user_count |