Skip to content

Instantly share code, notes, and snippets.

@Neodevils
Last active May 10, 2026 11:40
Show Gist options
  • Select an option

  • Save Neodevils/450f97812260187fabba2448e7d0738f to your computer and use it in GitHub Desktop.

Select an option

Save Neodevils/450f97812260187fabba2448e7d0738f to your computer and use it in GitHub Desktop.
Update your Discord app/bot is profile for global/server specific.
import { Client, Events, GatewayIntentBits } from "discord.js";
const BOT_TOKEN = ""; // Your Discord bot token
const GUILD_ID = ""; // Optional: target guild to clear overrides
const APP_AVATAR = ""; // Application avatar
const BOT_AVATAR = ""; // Bot avatar
const BANNER_URL = ""; // Application banner
const APP_BIO = ``; // App description
const APP_TAGS = []; // App tags
if (!BOT_TOKEN) {
throw new Error("BOT_TOKEN is required in env.");
}
const client = new Client({ intents: [GatewayIntentBits.Guilds] });
client.once(Events.ClientReady, async () => {
console.log(`Logged in as ${client.user?.tag}`);
try {
// Ensure application is fetched to access edit()
await client.application?.fetch();
if (!client.application) {
throw new Error("client.application is not available.");
}
// Update global application profile
// You can pass URL strings or a Buffer for avatar/banner.
await client.application.edit({
icon: APP_AVATAR,
// description: APP_BIO,
// tags: APP_TAGS,
});
client.user.setAvatar(BOT_AVATAR);
client.user.setBanner(BANNER_URL);
console.log("✅ Application profile updated.");
// Optionally clear guild-specific member profile overrides so global avatar shows
if (GUILD_ID) {
const guild = await client.guilds.fetch(GUILD_ID);
const me = await guild.members.fetchMe();
if (!me)
throw new Error("Bot is not in the guild or fetchMe failed.");
// Clear guild profile overrides (nick/avatar/banner/bio)
await me.edit({
nick: null,
avatar: null,
banner: null,
bio: null,
});
console.log("✅ Cleared guild-specific profile overrides.");
}
} catch (err) {
console.error("❌ Failed to update profile:", err);
} finally {
// Give Discord a moment to accept changes, then destroy the client
setTimeout(() => client.destroy(), 1000);
}
});
client.login(BOT_TOKEN);
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