for webhook := range get_webhooks(Args{channel_id: trigger.channel_id}) {
send_text_message(Args{
channel_id: trigger.channel_id,
message_content: "Webhook ID: " + webhook.webhook_id,
})
}
Get Webhooks
LoopWebhooks
Get all webhooks in a channel.
- Loop block: the blocks placed inside it run once for each item, and can use the current item's outputs.
Inputs
Channel IDRequired
ID of the channel 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).
Build a bot using blocks like Get 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_webhooks- Loop block: write
for item := range get_webhooks(Args{...}) { ... }and read the current item's outputs fromitem. See loops.
Inputs
| Field | InventScript name | Value |
|---|---|---|
| Channel ID | channel_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 |