Guild members: fetching, editing, roles and kicks.
Every function returns {:ok, result}, :ok when Discord sends no body, or
{:error, %Lingo.Error{}}. Calls go to the current bot (see Lingo.with_bot/2).
Summary
Functions
Gives a member a role.
Adds a user to a guild with their OAuth2 token (guilds.join scope, see
Lingo.OAuth2); the bot must be in the guild. Params: :nick, :roles,
:mute, :deaf. Returns the member, or :ok when they were already in.
Fetches a guild member.
Removes a member from a guild.
Lists guild members, limit: at a time (needs the guild members intent).
Takes a role away from a member.
Finds guild members whose username or nickname starts with query.
Edits a guild member: nickname, roles, mute, deafen, timeout or voice channel.
Edits the bot's own profile in a guild: :nick, and :avatar, :banner
(images as data URIs) and :bio, shown in that guild only.
Functions
@spec add_role(Lingo.Api.id(), Lingo.Api.id(), Lingo.Api.id(), keyword()) :: Lingo.Api.result()
Gives a member a role.
@spec create(Lingo.Api.id(), Lingo.Api.id(), String.t(), Lingo.Api.params()) :: Lingo.Api.result(Lingo.Type.Member.t()) | :ok
Adds a user to a guild with their OAuth2 token (guilds.join scope, see
Lingo.OAuth2); the bot must be in the guild. Params: :nick, :roles,
:mute, :deaf. Returns the member, or :ok when they were already in.
@spec get(Lingo.Api.id(), Lingo.Api.id()) :: Lingo.Api.result(Lingo.Type.Member.t())
Fetches a guild member.
@spec kick(Lingo.Api.id(), Lingo.Api.id(), keyword()) :: Lingo.Api.result()
Removes a member from a guild.
@spec list( Lingo.Api.id(), keyword() ) :: Lingo.Api.result([Lingo.Type.Member.t()])
Lists guild members, limit: at a time (needs the guild members intent).
@spec remove_role(Lingo.Api.id(), Lingo.Api.id(), Lingo.Api.id(), keyword()) :: Lingo.Api.result()
Takes a role away from a member.
@spec search(Lingo.Api.id(), String.t(), keyword()) :: Lingo.Api.result([Lingo.Type.Member.t()])
Finds guild members whose username or nickname starts with query.
@spec update(Lingo.Api.id(), Lingo.Api.id(), Lingo.Api.params(), keyword()) :: Lingo.Api.result(Lingo.Type.Member.t())
Edits a guild member: nickname, roles, mute, deafen, timeout or voice channel.
@spec update_current(Lingo.Api.id(), Lingo.Api.params(), keyword()) :: Lingo.Api.result(Lingo.Type.Member.t())
Edits the bot's own profile in a guild: :nick, and :avatar, :banner
(images as data URIs) and :bio, shown in that guild only.