API: Channels & Messages
All on the Lingo module. Return {:ok, data} or {:error, reason} unless noted.
Channels
get_channel
Lingo.get_channel(channel_id)edit_channel
Lingo.edit_channel(channel_id, params, opts \\ [])Supports reason.
delete_channel
Lingo.delete_channel(channel_id, opts \\ [])Supports reason.
edit_channel_permissions
Lingo.edit_channel_permissions(channel_id, overwrite_id, params, opts \\ [])params: %{allow: bitfield, deny: bitfield, type: 0|1}. Supports reason.
delete_channel_permissions
Lingo.delete_channel_permissions(channel_id, overwrite_id, opts \\ [])Supports reason.
follow_channel
Lingo.follow_channel(channel_id, webhook_channel_id, opts \\ [])Follow an announcement channel. Supports reason.
trigger_typing
Lingo.trigger_typing(channel_id)list_channel_invites / create_invite
Lingo.list_channel_invites(channel_id)
Lingo.create_invite(channel_id, params \\ %{}, opts \\ [])create_invite params: %{max_age: 86400, max_uses: 1, temporary: false}. Supports reason.
Messages
get_message
Lingo.get_message(channel_id, message_id)list_messages
Lingo.list_messages(channel_id, opts \\ [])Options: limit (1-100), before, after, around (snowflake IDs).
send_message
Lingo.send_message(channel_id, params)params can be a string, keyword list, or map:
Lingo.send_message(ch, "Hello!")
Lingo.send_message(ch, content: "Hello!", embeds: [embed])
Lingo.send_message(ch, %{content: "File:", files: [{"log.txt", data}]})edit_message
Lingo.edit_message(channel_id, message_id, params)Same param format as send_message. Supports file attachments.
delete_message
Lingo.delete_message(channel_id, message_id, opts \\ [])Supports reason.
bulk_delete_messages
Lingo.bulk_delete_messages(channel_id, message_ids, opts \\ [])Delete 2-100 messages (must be less than 14 days old). Handles chunking for you. Supports reason.
crosspost_message
Lingo.crosspost_message(channel_id, message_id)search_messages
Lingo.search_messages(guild_id, opts \\ [])Options: content, author_id, mentions, has, min_id, max_id, channel_id, pinned, limit, offset, sort_by, sort_order.
Pins
list_pins
Lingo.list_pins(channel_id)pin_message / unpin_message
Lingo.pin_message(channel_id, message_id, opts \\ [])
Lingo.unpin_message(channel_id, message_id, opts \\ [])Both support reason.
Reactions
add_reaction
Lingo.add_reaction(channel_id, message_id, emoji)emoji is a string: "thumbsup" for unicode, "name:id" for custom.
remove_own_reaction
Lingo.remove_own_reaction(channel_id, message_id, emoji)remove_user_reaction
Lingo.remove_user_reaction(channel_id, message_id, emoji, user_id)list_reactions
Lingo.list_reactions(channel_id, message_id, emoji, opts \\ [])Options: after, limit (1-100), type.
remove_all_reactions
Lingo.remove_all_reactions(channel_id, message_id)remove_emoji_reactions
Lingo.remove_emoji_reactions(channel_id, message_id, emoji)Threads
start_thread_from_message
Lingo.start_thread_from_message(channel_id, message_id, params, opts \\ [])params: %{name: "Thread", auto_archive_duration: 1440}. Supports reason.
start_thread
Lingo.start_thread(channel_id, params, opts \\ [])Start a thread without a parent message. params: %{name: "Thread", type: 11}. Supports reason.
join_thread / leave_thread
Lingo.join_thread(channel_id)
Lingo.leave_thread(channel_id)add_thread_member / remove_thread_member
Lingo.add_thread_member(channel_id, user_id)
Lingo.remove_thread_member(channel_id, user_id)get_thread_member
Lingo.get_thread_member(channel_id, user_id, opts \\ [])Options: with_member.
list_thread_members
Lingo.list_thread_members(channel_id, opts \\ [])Options: with_member, after, limit.
list_public_archived_threads / list_private_archived_threads
Lingo.list_public_archived_threads(channel_id, opts \\ [])
Lingo.list_private_archived_threads(channel_id, opts \\ [])Options: before, limit.
list_joined_private_archived_threads
Lingo.list_joined_private_archived_threads(channel_id, opts \\ [])Options: before, limit.