for guild := range get_discord_guilds() {
send_text_message(Args{
channel_id: trigger.channel_id,
message_content: "Server ID: " + guild.server_id,
})
}
Get Servers
LoopServers
Retrieve a list of Discord servers the bot is a member of.
This data is retrieved from Discord and may not include all server information.
- Loop block: the blocks placed inside it run once for each item, and can use the current item's outputs.
Inputs
Loop Body
Blocks to run for each server.
Holds blocks
Outputs
Iteration Number
Current iteration (1-based).
Example: 1
Total Iterations
Total number of iterations.
Example: 5
Server ID
ID of the server.
Server Name
Name of the server.
Server Icon URL
Icon URL for the server.
Build a bot using blocks like Get Servers
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_discord_guilds- Loop block: write
for item := range get_discord_guilds(Args{...}) { ... }and read the current item's outputs fromitem. See loops.
Inputs
| Field | InventScript name | Value |
|---|---|---|
| Loop Body | body | blocks: func() { ... } |
Outputs
| Field | InventScript name | Value |
|---|---|---|
| Iteration Number | iteration_number | e.g. "1" |
| Total Iterations | total_iterations | e.g. "5" |
| Server ID | server_id | |
| Server Name | server_name | |
| Server Icon URL | server_icon_url |