Lingo.Api.User (Lingo v0.4.2)

Copy Markdown View Source

Users, the bot's own user, its guilds and DMs.

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

Opens a DM channel with a user. Send to it with Lingo.Api.Message.create/2.

Fetches a user.

Fetches the bot's user.

Makes the bot leave a guild.

Lists the guilds the bot is in, 200 at a time. Options: :before, :after, :limit, :with_counts, and :shard, which bots on large bot sharding must give (one call per shard from 0 to max_concurrency - 1). The guilds are partial: id, name, icon, features, the bot's permissions, and with with_counts: true the approximate counts.

Edits the bot's username, avatar or banner.

Functions

create_dm(recipient_id)

Opens a DM channel with a user. Send to it with Lingo.Api.Message.create/2.

get(user_id)

Fetches a user.

get_current()

@spec get_current() :: Lingo.Api.result(Lingo.Type.User.t())

Fetches the bot's user.

leave_guild(guild_id)

@spec leave_guild(Lingo.Api.id()) :: Lingo.Api.result()

Makes the bot leave a guild.

list_guilds(opts \\ [])

@spec list_guilds(keyword()) :: Lingo.Api.result([Lingo.Type.Guild.t()])

Lists the guilds the bot is in, 200 at a time. Options: :before, :after, :limit, :with_counts, and :shard, which bots on large bot sharding must give (one call per shard from 0 to max_concurrency - 1). The guilds are partial: id, name, icon, features, the bot's permissions, and with with_counts: true the approximate counts.

update_current(params)

@spec update_current(Lingo.Api.params()) :: Lingo.Api.result(Lingo.Type.User.t())

Edits the bot's username, avatar or banner.