for serverWebhook := range get_server_webhooks(Args{server_id: trigger.server_id}) {
send_text_message(Args{
channel_id: trigger.channel_id,
message_content: "Webhook ID: " + serverWebhook.webhook_id,
})
}
Get Server Webhooks
LoopWebhooks
Get all webhooks in 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
ID of the server to get webhooks from.
Loop Body
Blocks to run for each webhook.
Holds blocks
Outputs
Iteration Number
Current iteration (1-based).
Example: 1
Total Iterations
Total number of iterations.
Example: 3
Webhook ID
ID of the webhook.
Webhook Name
Name of the webhook.
Channel ID
Channel ID the webhook belongs to.
Server ID
Server ID the webhook belongs to.
Webhook Token
Token of the webhook (may be empty).
Webhook Type
Type of the webhook (1 = Incoming, 2 = Channel Follower, 3 = Application).
Application ID
Application ID that created the webhook (if applicable).
Build a bot using blocks like Get Server Webhooks
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_server_webhooks- Loop block: write
for item := range get_server_webhooks(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" |
| Webhook ID | webhook_id | |
| Webhook Name | webhook_name | |
| Channel ID | webhook_channel_id | |
| Server ID | webhook_guild_id | |
| Webhook Token | webhook_token | |
| Webhook Type | webhook_type | |
| Application ID | webhook_application_id |