for invite := range get_invites(Args{channel_id: trigger.channel_id}) {
send_text_message(Args{
channel_id: trigger.channel_id,
message_content: "Invite Code: " + invite.invite_code,
})
}
Get Channel Invites
LoopInvites
Retrieve a list of invites for 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 retrieve invites for.
Loop Body
Blocks to run for each invite.
Holds blocks
Outputs
Iteration Number
Current iteration (1-based).
Example: 1
Total Iterations
Total number of iterations.
Example: 3
Invite Code
Code for the invite.
Server ID
ID of the server for the invite.
Channel ID
ID of the channel for the invite.
Channel Name
Name of the channel.
Invite Creator User ID
User ID of the invite creator.
Invite Creator Username
Username of the invite creator.
Invite Uses
Number of times the invite has been used.
Invite Max Uses
Maximum number of times the invite can be used.
Invite Temporary
Whether the invite is temporary.
Expires At (Unix)
Unix timestamp when the invite expires.
Invite Created At (Unix)
Unix timestamp when the invite was created.
Build a bot using blocks like Get Channel Invites
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_invites- Loop block: write
for item := range get_invites(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" |
| Invite Code | invite_code | |
| Server ID | server_id | |
| Channel ID | channel_id | |
| Channel Name | channel_name | |
| Invite Creator User ID | invite_creator_user_id | |
| Invite Creator Username | invite_creator_username | |
| Invite Uses | invite_uses | |
| Invite Max Uses | invite_max_uses | |
| Invite Temporary | invite_temporary | |
| Expires At (Unix) | expires_at_unix | |
| Invite Created At (Unix) | invite_created_at_unix |