Alchemy.Client.create_invite

You're seeing just the function create_invite, go back to Alchemy.Client module for more information.
Link to this function

create_invite(channel_id, options \\ [])

Specs

create_invite(snowflake(),
  max_age: Integer,
  max_uses: Integer,
  temporary: Boolean,
  unique: True
) :: {:ok, Alchemy.Channel.invite()} | {:error, term()}

Creates a new invite for a channel.

Requires the CREATE_INSTANT_INVITE permission.

Options

  • max_age

    The duration (seconds) of the invite. 0 for never.

  • max_uses

    The max number of uses. 0 for unlimited.

  • temporary

    Whether this invite grants temporary membership.

  • unique

    When set, a similar invite won't try to be used. Useful for creating unique one time use invites.

Examples

Cogs.def invite do
  {:ok, invite} = Client.create_invite(message.channel_id, max_age: 0)
  Cogs.say("Here you go:\nhttps://discord.gg/#{invite.code}")
end