Create Invite

BlockInvites

Create an invite for a channel.

Inputs

Channel IDRequired

ID of the channel to create the invite for.

Max Uses

Maximum number of times the invite can be used. Set to 0 or leave blank for unlimited.

Temporary

Whether the invite is temporary. Set to true for the invite to be temporary.

Example: false

Expires After (Seconds)

Number of seconds until the invite expires. Set to 0 for never, or leave blank for default (7 days).

Example: 604800

Unique

Whether the invite should be unique. Set to true for the invite to be unique.

Optionstruefalse

Outputs

Invite Code

Code for the created 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 Create Invite

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: create_invite

Inputs

FieldInventScript nameValue
Channel IDchannel_id
Max Usesmax_uses
Temporarytemporarye.g. "false"
Expires After (Seconds)expires_after_secondse.g. "604800"
Uniqueunique"true", "false"

Outputs

FieldInventScript nameValue
Invite Codeinvite_code
Server IDserver_id
Channel IDchannel_id
Channel Namechannel_name
Invite Creator User IDinvite_creator_user_id
Invite Creator Usernameinvite_creator_username
Invite Usesinvite_uses
Invite Max Usesinvite_max_uses
Invite Temporaryinvite_temporary
Expires At (Unix)expires_at_unix
Invite Created At (Unix)invite_created_at_unix

Example InventScript

invite := create_invite(Args{channel_id: trigger.channel_id})
send_text_message(Args{
	channel_id:      trigger.channel_id,
	message_content: "Invite Code: " + invite.invite_code,
})

More invites blocks