List unread Discord messages
Automatically list unread Discord messages on discord.com. Lists everything the signed-in Discord account has not read yet, as the Inbox's Unreads tab shows it: direct messages, group DMs, server channels, threads and forum posts, in the Inbox's order. Each conversation comes with its server and category, its url, isDm, the mention count, and its unread messages (id, author, time, text), plus the post title for forum posts. Nothing is marked as read. max_channels caps how many conversations are read (default 25); complete is false when more were left. Within one conversation the Inbox loads about the first 15 unread messages; moreMessages says when there are more, which discord.com/read_messages can read. Requires being signed in.
Input
max_channels optionalRead at most this many conversations.
Default: 25Output
count requiredcomplete requiredfalse when max_channels stopped the read before the end of the Unreads tab.
conversations requiredFAQ
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.
