List Discord mentions
Automatically list Discord mentions on discord.com. Lists the recent messages that mention the signed-in Discord account, newest first, as the Inbox's Mentions tab shows them, read or not. Discord keeps mentions there for about 7 days. Filter to one server with guild_id (from discord.com/list_servers), and choose whether @everyone/@here and role mentions count. Returns up to 25 per page; pass the last message's id as before to read the next page (next_before is null on the last page). Each mention gives the message id, its channel and server (ids and names), author, time, text and link. Nothing is marked as read. Requires being signed in.
Input
before optionalA message id: read the mentions older than it (next_before of the previous page).
guild_id optionalOnly mentions in this server. Get ids from discord.com/list_servers.
include_roles optionalCount mentions of a role the account has.
Default: trueinclude_everyone optionalCount @everyone and @here.
Default: trueOutput
count requiredmentions requirednext_before requiredPass as before for the next page; null when this page is the last.
FAQ
Read Discord messages
Reads the most recent messages of one Discord channel or direct message, newest first, loading older ones until the requested count; complete says whether the whole history came back. Each message comes with its author, timestamp, text and edit time, its attachments (file name, link, type, size and image dimensions), its embeds and link previews (title, description, provider, image, thumbnail and video), its stickers, and the message it replies to. Attachment links expire after about a day, so download them soon. Requires being signed in. A DM or group DM is read the same way: pass its url from discord.com/list_dms. It also reads a thread or a forum post, since both are channels in their own right: pass the post's url (from discord.com/list_forum_posts). To list the posts of a forum channel rather than its messages, use discord.com/list_forum_posts. To read several channels, run the script once per channel.
Search Discord server messages
Search one Discord server's message history with Discord's own search, as the signed-in account, newest first. Search by words (content), and narrow by authors, channels, mentioned users and content type, each given as ids: get user ids from discord.com/get_member_list and channel ids from discord.com/list_channels. Returns one page of up to 25 matching messages with their author, text, time and link, Discord's total count of matches, and next_offset to read the next page (null on the last one). Fails with a clear error when the browser is not signed in to Discord, when the account is not a member of the server or can see no text channel in it, or when Discord is still indexing the server. Direct messages are not searched.
List Discord direct messages
Lists the direct messages (DMs) of the signed-in Discord account, one-to-one and group DMs, most recent first, as the Direct Messages sidebar shows them: the conversation's name, its channelId, its url, whether it has unread messages (unread) and the number on its sidebar badge (mentionCount, 0 when none; in a DM Discord counts each unread message). Reading the list marks nothing as read. Pass a conversation's url to discord.com/read_messages to read it, or use discord.com/list_unreads for the unread messages themselves. Requires being logged in.
