### Discord Guild Tag Icons (HTML & JavaScript)
Source: https://context7.com/mezotv/discord-badges/llms.txt
Illustrates how to display Discord guild tag icons using HTML `
` tags and provides a JavaScript snippet to dynamically load all 41 available tag icons. This is useful for customizing server profiles.
```html
```
--------------------------------
### Discord Server Badge Assets (HTML)
Source: https://context7.com/mezotv/discord-badges/llms.txt
Displays various server status, boost level, and special designation badges using HTML `
` tags. These assets include both dark and light theme variants for discoverability and community badges.
```html
```
--------------------------------
### Discord User Badge Flag Management (JavaScript)
Source: https://context7.com/mezotv/discord-badges/llms.txt
Defines bitfield constants for Discord user badges and provides functions to check for specific badges or retrieve all badges a user possesses. This utility is useful for integrating with the Discord API to display user badges.
```javascript
// Discord Badge Flags (powers of 2)
const BadgeFlags = {
DISCORD_STAFF: 1,
PARTNERED_SERVER_OWNER: 2,
HYPESQUAD_EVENTS: 4,
BUG_HUNTER_LEVEL_1: 8,
HYPESQUAD_BRAVERY: 64,
HYPESQUAD_BRILLIANCE: 128,
HYPESQUAD_BALANCE: 256,
EARLY_SUPPORTER: 512,
BUG_HUNTER_LEVEL_2: 16384,
VERIFIED_BOT_DEVELOPER: 131072,
MODERATOR_ALUMNI: 262144,
SUPPORTS_COMMANDS: 524288,
ACTIVE_DEVELOPER: 4194304,
USES_AUTOMOD: 16777216
};
// Check if user has a specific badge
function hasBadge(userFlags, badge) {
return (userFlags & badge) === badge;
}
// Example: Check user badges from API response
const userFlags = 4194560; // Example user flags value
console.log('Has Active Developer:', hasBadge(userFlags, BadgeFlags.ACTIVE_DEVELOPER)); // true
console.log('Has HypeSquad Balance:', hasBadge(userFlags, BadgeFlags.HYPESQUAD_BALANCE)); // true
console.log('Has Discord Staff:', hasBadge(userFlags, BadgeFlags.DISCORD_STAFF)); // false
// Get all badges for a user
function getUserBadges(userFlags) {
const badges = [];
for (const [name, flag] of Object.entries(BadgeFlags)) {
if (hasBadge(userFlags, flag)) {
badges.push(name);
}
}
return badges;
}
console.log(getUserBadges(4194560));
```
--------------------------------
### Display Current Nitro Subscription Badges (HTML)
Source: https://context7.com/mezotv/discord-badges/llms.txt
These HTML image tags display the current set of Nitro subscription badges. Each badge corresponds to a specific cumulative subscription duration, from Bronze for 1 month up to Opal for 72+ months. The `src` attribute points to the PNG asset, and the `alt` attribute provides a descriptive label.
```html
```
--------------------------------
### Embed Discord Badges in HTML
Source: https://context7.com/mezotv/discord-badges/llms.txt
Demonstrates how to embed various Discord badges directly into web pages using HTML image tags. This allows for visual representation of user, server, and bot-related achievements or statuses.
```html
```
--------------------------------
### Display SVG Nitro Subscription Badges (HTML)
Source: https://context7.com/mezotv/discord-badges/llms.txt
These HTML image tags display the current set of Nitro subscription badges in SVG format. SVGs are often used for their scalability and potential for hover or animated effects. Each badge represents a different subscription tier, indicated by the filename and alt text.
```html
```
--------------------------------
### Display Legacy Nitro Subscription Badges (HTML)
Source: https://context7.com/mezotv/discord-badges/llms.txt
These HTML image tags showcase the legacy designs for Discord Nitro subscription badges, primarily in SVG format. These are useful for maintaining historical accuracy or supporting older UI elements. The collection includes badges for various tiers and a specific 'Fire' badge.
```html
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.