Nostrum.Api.add_guild_member

You're seeing just the function add_guild_member, go back to Nostrum.Api module for more information.
Link to this function

add_guild_member(guild_id, user_id, options)

View Source

Specs

Puts a user in a guild.

This endpoint fires the Nostrum.Consumer.guild_member_add/0 event. It requires the CREATE_INSTANT_INVITE permission. Additionally, it situationally requires the MANAGE_NICKNAMES, MANAGE_ROLES, MUTE_MEMBERS, and DEAFEN_MEMBERS permissions.

If successful, returns {:ok, member} or {:ok} if the user was already a member of the guild. Otherwise, returns a Nostrum.Api.error/0.

Options

  • :access_token (string) - the user's oauth2 access token
  • :nick (string) - value to set users nickname to
  • :roles (list of Nostrum.Struct.Guild.Role.id/0) - array of role ids the member is assigned
  • :mute (boolean) - if the user is muted
  • :deaf (boolean) - if the user is deafened

:access_token is always required.

Examples

Nostrum.Api.add_guild_member(
  41771983423143937,
  18374719829378473,
  access_token: "6qrZcUqja7812RVdnEKjpzOL4CvHBFG",
  nick: "nostrum",
  roles: [431849301, 913809431]
)