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 from item. See loops.

Inputs

FieldInventScript nameValue
Channel IDchannel_id
Loop Bodybodyblocks: func() { ... }

Outputs

FieldInventScript nameValue
Iteration Numberiteration_numbere.g. "1"
Total Iterationstotal_iterationse.g. "3"
Webhook IDwebhook_id
Webhook Namewebhook_name
Channel IDwebhook_channel_id
Server IDwebhook_guild_id
Webhook Tokenwebhook_token

Example InventScript

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,
	})
}

More webhooks blocks