Last active
May 10, 2026 11:40
-
-
Save Neodevils/450f97812260187fabba2448e7d0738f to your computer and use it in GitHub Desktop.
Update your Discord app/bot is profile for global/server specific.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import "dotenv/config"; | |
| const TOKEN = ""; // BOT TOKEN | |
| const GUILD_ID = ""; // GUILD ID | |
| /** Font IDs */ | |
| export const Font = { | |
| DEFAULT: 11, | |
| BANGERS: 1, | |
| BIO_RHYME: 2, | |
| CHERRY_BOMB: 3, | |
| CHICLE: 4, | |
| COMPAGNON: 5, | |
| MUSEO_MODERNO: 6, | |
| NEO_CASTEL: 7, | |
| PIXELIFY: 8, | |
| RIBES: 9, | |
| SINISTRE: 10, | |
| ZILLA_SLAB: 12 | |
| }; | |
| /** Effect IDs */ | |
| export const Effect = { | |
| NONE: 0, | |
| GLOW: 1, | |
| GRADIENT: 2, | |
| NEON: 3, | |
| CHROMATIC: 4, | |
| SHIMMER: 5 | |
| }; | |
| function hex(hexValue) { | |
| // accepts: 0xRRGGBB or "#RRGGBB" | |
| if (typeof hexValue === "string") { | |
| return parseInt(hexValue.replace("#", ""), 16); | |
| } | |
| return hexValue; | |
| } | |
| async function updateNameStyle({ | |
| font = Font.PIXELIFY, | |
| effect = Effect.GLOW, | |
| colors = ["#5865F2", "#EB459E"] | |
| } = {}) { | |
| const payload = { | |
| display_name_font_id: font, | |
| display_name_effect_id: effect, | |
| display_name_colors: colors.map(hex) | |
| }; | |
| console.log("Payload:", payload); | |
| const res = await fetch( | |
| `https://discord.com/api/v10/guilds/${GUILD_ID}/members/@me`, | |
| { | |
| method: "PATCH", | |
| headers: { | |
| Authorization: `Bot ${TOKEN}`, | |
| "Content-Type": "application/json" | |
| }, | |
| body: JSON.stringify(payload) | |
| } | |
| ); | |
| console.log("Status:", res.status); | |
| console.log(await res.text()); | |
| } | |
| /** Example usage */ | |
| updateNameStyle({ | |
| font: Font.CHERRY_BOMB, | |
| effect: Effect.SHIMMER, | |
| colors: ["#7d6153"] | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment