When you share a link in Discord, you'll often see a small preview card show up with a title, image, or description. This is built using a bot called Discordbot. This article explains how that works, and how website owners can recognize and confirm its traffic.
What this article covers:
How Discord Generates Link Previews
When someone shares a link in a Discord message, it automatically visits that link to grab information about the page, like its title, description, and image. This information is used to build the preview card you see in chat.
This only happens when a link is actually shared in a message. There's no continuous scanning or crawling of websites on its own.
If the link points to an image or video, a copy may also be saved for a while so it loads faster next time. When someone views that image or video, it's delivered through Discord's own servers rather than pulled directly from the original website. This keeps the viewer's information, like their IP address, private from the site hosting the file.
The Discordbot
Discordbot is the tool that visits links and builds these previews. If you own a website, you might want to know when it's visiting your site, maybe to show slightly different information, or to make sure your firewall doesn't accidentally block it.
There are two ways to recognize its requests:
- Look at the User-Agent (a short bit of text that identifies what's making the request)
- Check the IP address the request is coming from
Identifying Discordbot
Every request it makes includes a User-Agent that looks like this:
Mozilla/5.0 (compatible; Discordbot/2.0; +https://discordapp.com)
You can check for the word "Discordbot" anywhere in that text. Other parts of it might change over time, so don't rely on matching the whole string exactly.
Verifying Discord Traffic
To be sure a request truly came from Discord, check that its IP address is on the official list of public IP ranges. This is published in two formats (json and txt) so you can check it programmatically. It's a good idea to recheck this list every so often, since the ranges can change.