This commit is contained in:
st committed 2026-06-28 21:49:58 -05:00
1 parent 494a55d74c
commit 2a9230c21d
1 file changed
+52 -53
+52 -53
View File
@@ -80,7 +80,7 @@ const roles = [
{ name: 'StreamElements', color: 0xF1C40F }, { name: 'StreamElements', color: 0xF1C40F },
{ name: 'Llamas', color: 0xFF69B4 }, { name: 'Llamas', color: 0xFF69B4 },
{ name: 'Repaz', color: 0xD4AC0D }, { name: 'Repaz', color: 0xD4AC0D },
{ name: 'lollek', color: 0xFFFFFF }, { name: 'lollek', color: 0xcccccc },
{ name: 'Celebration Heart', color: 0x9B59B6 }, { name: 'Celebration Heart', color: 0x9B59B6 },
{ name: 'Funflower', color: 0xD4C227 }, { name: 'Funflower', color: 0xD4C227 },
{ name: 'Level 100', color: 0xBB44EE }, { name: 'Level 100', color: 0xBB44EE },
@@ -1034,7 +1034,7 @@ async function sendLockerImageEmbed(message, { title, description, imageBuffer,
? `${String(title).slice(0, 247)}...` ? `${String(title).slice(0, 247)}...`
: String(title || 'Locker Check'); : String(title || 'Locker Check');
const embed = new EmbedBuilder() const embed = new EmbedBuilder()
.setColor(0xffffff) .setColor(0xcccccc)
.setDescription("**" + safeTitle + "**\n" + description) .setDescription("**" + safeTitle + "**\n" + description)
.setImage(`attachment://${fileName}`) .setImage(`attachment://${fileName}`)
.setTimestamp(); .setTimestamp();
@@ -1369,7 +1369,7 @@ function getRolesForLocker(ownedMap, ccItems) {
// ───────────────────────────────────────────────────────────────────────────── // ─────────────────────────────────────────────────────────────────────────────
// BOT READY // BOT READY
// ───────────────────────────────────────────────────────────────────────────── // ─────────────────────────────────────────────────────────────────────────────
client.once('ready', async () => { client.once('clientReady', async () => {
console.log(`logged in as ${client.user.tag}`); console.log(`logged in as ${client.user.tag}`);
client.user.setActivity( client.user.setActivity(
@@ -1789,7 +1789,7 @@ client.on('messageCreate', async (message) => {
const loginUrl = `https://www.epicgames.com/activate?userCode=${deviceData.user_code}`; const loginUrl = `https://www.epicgames.com/activate?userCode=${deviceData.user_code}`;
const embed = new EmbedBuilder() const embed = new EmbedBuilder()
.setColor(0xffffff) .setColor(0xcccccc)
.setAuthor({ .setAuthor({
name: message.author.username, name: message.author.username,
icon_url: message.author.displayAvatarURL(), icon_url: message.author.displayAvatarURL(),
@@ -1814,7 +1814,7 @@ client.on('messageCreate', async (message) => {
if (!tokenData) if (!tokenData)
return message.author.send({ return message.author.send({
content: null, embeds: [{ content: null, embeds: [{
color: 0xffffff, color: 0xcccccc,
author: { author: {
name: message.author.username, name: message.author.username,
icon_url: message.author.displayAvatarURL(), icon_url: message.author.displayAvatarURL(),
@@ -1833,7 +1833,7 @@ client.on('messageCreate', async (message) => {
//return message.author.send('Authentication failed. Please try again.'); //return message.author.send('Authentication failed. Please try again.');
return message.author.send({ return message.author.send({
content: null, embeds: [{ content: null, embeds: [{
color: 0xffffff, color: 0xcccccc,
author: { author: {
name: message.author.username, name: message.author.username,
icon_url: message.author.displayAvatarURL(), icon_url: message.author.displayAvatarURL(),
@@ -1851,7 +1851,7 @@ client.on('messageCreate', async (message) => {
//await message.author.send(`logged in as **${displayName}**! fetching locker...`); //await message.author.send(`logged in as **${displayName}**! fetching locker...`);
await message.author.send({ await message.author.send({
content: null, embeds: [{ content: null, embeds: [{
color: 0xffffff, color: 0xcccccc,
author: { author: {
name: message.author.username, name: message.author.username,
icon_url: message.author.displayAvatarURL(), icon_url: message.author.displayAvatarURL(),
@@ -1893,8 +1893,49 @@ client.on('messageCreate', async (message) => {
// Store verified state so they can't re-verify without !unverify // Store verified state so they can't re-verify without !unverify
verifiedUsers.set(userId, { guildId: guild.id, assignedRoles: assigned, epicName: displayName }); verifiedUsers.set(userId, { guildId: guild.id, assignedRoles: assigned, epicName: displayName });
const emojiGuild = await client.guilds.fetch(process.env.EMOJI_GUILD_ID).catch(() => null);
await emojiGuild?.emojis.fetch().catch(() => null);
const getServerEmoji = (roleName) => {
if (!emojiGuild) return '';
// Map role names to emoji names we uploaded
const emojiNameMap = {
'Galaxy': 'Galaxy',
'Ikonik': 'Ikonik',
'Glow': 'Glow',
'OG Renegade Raider': 'RenegadeRaider',
'OG Ghoul Trooper': 'GhoulTrooper',
'OG Skull Trooper': 'SkullTrooper',
'OG Aerial Assault Trooper': 'AerialAssaultTrooper',
'Black Knight': 'BlackKnight',
'Double Helix': 'DoubleHelix',
'Honor Guard': 'HonorGuard',
'Wonder': 'Wonder',
'Eon': 'Eon',
'Dark Vertex': 'DarkVertex',
'Neo Versa': 'NeoVersa',
'Royale Bomber': 'RoyaleBomber',
'Wildcat': 'Wildcat',
'Stealth Reflex': 'StealthReflex',
'Reflex': 'Reflex',
"Raider's Revenge": 'RaidersRevenge',
'Stellar Axe': 'StellarAxe',
'AC/DC': 'ACDC',
'Merry Mint Axe': 'MerryMintAxe',
'Axe of Champions': 'AxeOfChampions',
'Blade of Champions': 'BladeOfChampions',
'Fully Golden Peely': 'FullyGoldenPeely',
'STW Founders': 'StwFounders',
'Cobalt Snowfoot': 'CobaltSnowfoot'
};
const emojiName = emojiNameMap[roleName];
if (!emojiName) return '';
const emoji = emojiGuild.emojis.cache.find(e => e.name.toLowerCase() === emojiName.toLowerCase());
return emoji ? `${emoji} ` : '';
};
const verifyEmbed = new EmbedBuilder() const verifyEmbed = new EmbedBuilder()
.setColor(0x2B2D31) .setColor(0xcccccc)
.setAuthor({ .setAuthor({
name: displayName + " (" + message.author.username + ")", name: displayName + " (" + message.author.username + ")",
iconURL: message.author.displayAvatarURL(), iconURL: message.author.displayAvatarURL(),
@@ -1902,7 +1943,7 @@ client.on('messageCreate', async (message) => {
.setDescription( .setDescription(
assigned.length === 0 assigned.length === 0
? 'no exclusive roles found!' ? 'no exclusive roles found!'
: "roles added: " + assigned.map(r => `— ${r}`).join('\n') : "roles added: \n" + assigned.map(r => `${getServerEmoji(r)}${r}`).join('\n')
) )
.addFields( .addFields(
{ name: 'total outfits', value: String(outfits.length), inline: true }, { name: 'total outfits', value: String(outfits.length), inline: true },
@@ -1919,50 +1960,8 @@ client.on('messageCreate', async (message) => {
try { try {
const logChannel = await client.channels.fetch(LOG_CHANNEL_ID).catch(() => null); const logChannel = await client.channels.fetch(LOG_CHANNEL_ID).catch(() => null);
if (logChannel) { if (logChannel) {
// Fetch server emojis to use next to role names
const emojiGuild = await client.guilds.fetch(process.env.EMOJI_GUILD_ID).catch(() => null);
await emojiGuild?.emojis.fetch().catch(() => null);
const getServerEmoji = (roleName) => {
if (!emojiGuild) return '';
// Map role names to emoji names we uploaded
const emojiNameMap = {
'Galaxy': 'Galaxy',
'Ikonik': 'Ikonik',
'Glow': 'Glow',
'OG Renegade Raider': 'RenegadeRaider',
'OG Ghoul Trooper': 'GhoulTrooper',
'OG Skull Trooper': 'SkullTrooper',
'OG Aerial Assault Trooper': 'AerialAssaultTrooper',
'Black Knight': 'BlackKnight',
'Double Helix': 'DoubleHelix',
'Honor Guard': 'HonorGuard',
'Wonder': 'Wonder',
'Eon': 'Eon',
'Dark Vertex': 'DarkVertex',
'Neo Versa': 'NeoVersa',
'Royale Bomber': 'RoyaleBomber',
'Wildcat': 'Wildcat',
'Stealth Reflex': 'StealthReflex',
'Reflex': 'Reflex',
"Raider's Revenge": 'RaidersRevenge',
'Stellar Axe': 'StellarAxe',
'AC/DC': 'ACDC',
'Merry Mint Axe': 'MerryMintAxe',
'Axe of Champions': 'AxeOfChampions',
'Blade of Champions': 'BladeOfChampions',
'Fully Golden Peely': 'FullyGoldenPeely',
'STW Founders': 'StwFounders',
'Cobalt Snowfoot': 'CobaltSnowfoot'
};
const emojiName = emojiNameMap[roleName];
if (!emojiName) return '';
const emoji = emojiGuild.emojis.cache.find(e => e.name.toLowerCase() === emojiName.toLowerCase());
return emoji ? `${emoji} ` : '';
};
const logEmbed = new EmbedBuilder() const logEmbed = new EmbedBuilder()
.setColor(0xffffff) .setColor(0xcccccc)
.setAuthor({ .setAuthor({
name: displayName + " (" + message.author.username + ")", name: displayName + " (" + message.author.username + ")",
iconURL: message.author.displayAvatarURL(), iconURL: message.author.displayAvatarURL(),
@@ -2092,7 +2091,7 @@ client.on('messageCreate', async (message) => {
return; return;
} }
await message.author.send(`Building your full locker (${categories.length} categories)...`); //await message.author.send(`Building your full locker (${categories.length} categories)...`);
for (const cat of categories) { for (const cat of categories) {
const items = cat.ids.map(id => ({ const items = cat.ids.map(id => ({