added a bunch of stuff idk bro
This commit is contained in:
1 parent
adf3cd2014
commit
072de326e4
129 files changed
+505
-18513
No files matched your search
+265
-159
@@ -12,8 +12,24 @@
|
||||
// =============================================
|
||||
|
||||
require('dotenv').config();
|
||||
const { Client, GatewayIntentBits, PermissionsBitField, EmbedBuilder, REST, Routes, SlashCommandBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, AttachmentBuilder } = require('discord.js');
|
||||
|
||||
const {
|
||||
Client,
|
||||
GatewayIntentBits,
|
||||
PermissionsBitField,
|
||||
EmbedBuilder,
|
||||
REST,
|
||||
Routes,
|
||||
SlashCommandBuilder,
|
||||
ActionRowBuilder,
|
||||
ButtonBuilder,
|
||||
ButtonStyle,
|
||||
AttachmentBuilder,
|
||||
ActivityType
|
||||
} = require('discord.js');
|
||||
|
||||
const sharp = require('sharp');
|
||||
// const { createCanvas, registerFont } = require('canvas');
|
||||
|
||||
const client = new Client({
|
||||
intents: [
|
||||
@@ -679,7 +695,7 @@ async function getProfile(accountId, accessToken, profileId) {
|
||||
// ─────────────────────────────────────────────────────────────────────────────
|
||||
// SKIN CHECKER IMAGE RENDERER (RiftCheckerBot style)
|
||||
// ─────────────────────────────────────────────────────────────────────────────
|
||||
const { createCanvas, loadImage, GlobalFonts } = require('@napi-rs/canvas');
|
||||
const { createCanvas, loadImage, GlobalFonts, registerFont } = require('@napi-rs/canvas');
|
||||
const path = require('path');
|
||||
|
||||
// Register Fortnite font (Burbank Big Condensed Black) + Tahoma
|
||||
@@ -688,6 +704,7 @@ GlobalFonts.registerFromPath(
|
||||
);
|
||||
GlobalFonts.registerFromPath('C:/Windows/Fonts/tahoma.ttf', 'Tahoma');
|
||||
GlobalFonts.registerFromPath('C:/Windows/Fonts/tahomabd.ttf', 'TahomaB');
|
||||
GlobalFonts.registerFromPath('./fonts/SF-Pro-Display-Semibold.otf', 'SF Pro Display');
|
||||
|
||||
// Custom background URL — set with !setbg <url>, cleared with !clearbg
|
||||
let customBgUrl = null;
|
||||
@@ -726,7 +743,7 @@ async function getLogoBuffer() {
|
||||
if (_logoBuffer) return _logoBuffer;
|
||||
try {
|
||||
const res = await fetchWithTimeout(
|
||||
'https://fortnite-api.com/images/cosmetics/br/cid_028_athena_commando_f/variants/material/mat3.png',
|
||||
'https://fortnite-api.com/images/banners/ot11banner/icon.png',
|
||||
8000
|
||||
);
|
||||
if (res.ok) _logoBuffer = Buffer.from(await res.arrayBuffer());
|
||||
@@ -850,85 +867,45 @@ async function fetchSkinImageBuffer(cosmeticId, useOgStyle = false) {
|
||||
async function renderLockerImage(items, countLabel, subtitle, submittedBy = null, ogStyleOwned = null) {
|
||||
if (!items || items.length === 0) return null;
|
||||
|
||||
const LOGO_SIZE = HDR_H - 8;
|
||||
const LOGO_SIZE = FTR_H;
|
||||
const rows = Math.ceil(items.length / COLS);
|
||||
const cols = Math.min(items.length, COLS);
|
||||
const W = Math.max(cols * ICON + PAD * 2, 400);
|
||||
const H = HDR_H + rows * CELL_H + PAD + FTR_H;
|
||||
const BOTTOM_PAD = 12;
|
||||
const H = rows * CELL_H + PAD + BOTTOM_PAD + FTR_H;
|
||||
|
||||
const canvas = createCanvas(W, H);
|
||||
const ctx = canvas.getContext('2d');
|
||||
|
||||
// ── Background ───────────────────────────────────────────────────────────
|
||||
if (customBgUrl) {
|
||||
try {
|
||||
const res = await fetchWithTimeout(customBgUrl, 10000);
|
||||
if (res.ok) {
|
||||
let rawBuf = Buffer.from(await res.arrayBuffer());
|
||||
const contentType = res.headers.get('content-type') || '';
|
||||
const isGif = customBgUrl.toLowerCase().endsWith('.gif') || contentType.includes('gif');
|
||||
// GIF backgrounds are flattened to their first frame for the generated PNG.
|
||||
const processed = await sharp(rawBuf, isGif ? { pages: 1 } : {})
|
||||
.resize(W, H, { fit: 'cover', position: 'centre' })
|
||||
.png()
|
||||
.toBuffer();
|
||||
ctx.drawImage(await loadImage(processed), 0, 0, W, H);
|
||||
ctx.fillStyle = 'rgba(0,0,0,0.55)';
|
||||
ctx.fillRect(0, 0, W, H);
|
||||
} else { throw new Error('bg fetch failed'); }
|
||||
} catch {
|
||||
const bg = ctx.createLinearGradient(0, 0, 0, H);
|
||||
bg.addColorStop(0, '#1c1c28'); bg.addColorStop(1, '#0e0e18');
|
||||
ctx.fillStyle = bg; ctx.fillRect(0, 0, W, H);
|
||||
}
|
||||
} else {
|
||||
//const bg = ctx.createLinearGradient(0, 0, 0, H);
|
||||
//bg.addColorStop(0, '#000000'); bg.addColorStop(1, '#000000');
|
||||
//ctx.fillStyle = bg; ctx.fillRect(0, 0, W, H);
|
||||
try {
|
||||
const res = await fetchWithTimeout("https://files.catbox.moe/lhs5tk.png", 10000);
|
||||
if (res.ok) {
|
||||
let rawBuf = Buffer.from(await res.arrayBuffer());
|
||||
const contentType = res.headers.get('content-type') || '';
|
||||
const processed = await sharp(rawBuf, {})
|
||||
.resize(W, H, { fit: 'cover', position: 'centre' })
|
||||
.png()
|
||||
.toBuffer();
|
||||
ctx.drawImage(await loadImage(processed), 0, 0, W, H);
|
||||
ctx.fillStyle = 'rgba(0,0,0,0.55)';
|
||||
ctx.fillRect(0, 0, W, H);
|
||||
} else { throw new Error('bg fetch failed'); }
|
||||
} catch {
|
||||
const bg = ctx.createLinearGradient(0, 0, 0, H);
|
||||
bg.addColorStop(0, '#1c1c28'); bg.addColorStop(1, '#0e0e18');
|
||||
bg.addColorStop(0, '#000000'); bg.addColorStop(1, '#000000');
|
||||
ctx.fillStyle = bg; ctx.fillRect(0, 0, W, H);
|
||||
}
|
||||
|
||||
// Grid lines
|
||||
ctx.strokeStyle = 'rgba(255,255,255,0.05)'; ctx.lineWidth = 1;
|
||||
for (let c = 0; c <= cols; c++) {
|
||||
ctx.beginPath(); ctx.moveTo(PAD + c * ICON, HDR_H); ctx.lineTo(PAD + c * ICON, HDR_H + rows * CELL_H); ctx.stroke();
|
||||
}
|
||||
for (let r = 0; r <= rows; r++) {
|
||||
ctx.beginPath(); ctx.moveTo(PAD, HDR_H + r * CELL_H); ctx.lineTo(PAD + cols * ICON, HDR_H + r * CELL_H); ctx.stroke();
|
||||
}
|
||||
|
||||
// ── Logo ─────────────────────────────────────────────────────────────────
|
||||
const logoBuf = await getLogoBuffer();
|
||||
let logoEndX = PAD;
|
||||
if (logoBuf) {
|
||||
try {
|
||||
const logoResized = await sharp(logoBuf).resize(LOGO_SIZE, LOGO_SIZE, { fit: 'cover' }).png().toBuffer();
|
||||
const logoImg = await loadImage(logoResized);
|
||||
const cx = PAD + LOGO_SIZE / 2, cy = 4 + LOGO_SIZE / 2, lr = LOGO_SIZE / 2;
|
||||
ctx.save();
|
||||
ctx.beginPath(); ctx.arc(cx, cy, lr, 0, Math.PI * 2); ctx.clip();
|
||||
ctx.drawImage(logoImg, PAD, 4, LOGO_SIZE, LOGO_SIZE);
|
||||
ctx.restore();
|
||||
ctx.strokeStyle = '#ffd700'; ctx.lineWidth = 2;
|
||||
ctx.beginPath(); ctx.arc(cx, cy, lr, 0, Math.PI * 2); ctx.stroke();
|
||||
logoEndX = PAD + LOGO_SIZE + 10;
|
||||
} catch { logoEndX = PAD; }
|
||||
}
|
||||
|
||||
// ── Header text ───────────────────────────────────────────────────────────
|
||||
ctx.fillStyle = '#ffffff';
|
||||
ctx.font = 'bold 26px TahomaB';
|
||||
ctx.fillText(countLabel, logoEndX, 40);
|
||||
ctx.fillStyle = '#aaaaaa';
|
||||
ctx.font = '13px Tahoma';
|
||||
ctx.fillText(subtitle.toUpperCase(), logoEndX, 60);
|
||||
|
||||
// ── Cosmetic grid ─────────────────────────────────────────────────────────
|
||||
let idx = 0;
|
||||
for (const item of items) {
|
||||
const col = idx % COLS;
|
||||
const row = Math.floor(idx / COLS);
|
||||
const x = PAD + col * ICON;
|
||||
const y = HDR_H + row * CELL_H;
|
||||
const y = row * CELL_H + 12; // added 12 to add padding to top
|
||||
const id = item.id.toLowerCase();
|
||||
|
||||
// Determine if we should show OG style for this item
|
||||
@@ -956,37 +933,37 @@ async function renderLockerImage(items, countLabel, subtitle, submittedBy = null
|
||||
const borderColor = RC[effectiveRarity] || RC.common;
|
||||
// Top edge gradient (left to right)
|
||||
const topGrad = ctx.createLinearGradient(x, y, x + ICON, y);
|
||||
topGrad.addColorStop(0, borderColor + '00');
|
||||
topGrad.addColorStop(0, borderColor + 'ff');
|
||||
topGrad.addColorStop(0.3, borderColor + 'ff');
|
||||
topGrad.addColorStop(0.7, borderColor + 'ff');
|
||||
topGrad.addColorStop(1, borderColor + '00');
|
||||
topGrad.addColorStop(1, borderColor + 'ff');
|
||||
ctx.strokeStyle = topGrad; ctx.lineWidth = 2;
|
||||
ctx.beginPath(); ctx.moveTo(x, y); ctx.lineTo(x + ICON, y); ctx.stroke();
|
||||
|
||||
// Bottom edge gradient
|
||||
const botGrad = ctx.createLinearGradient(x, y + ICON, x + ICON, y + ICON);
|
||||
botGrad.addColorStop(0, borderColor + '00');
|
||||
botGrad.addColorStop(0, borderColor + 'ff');
|
||||
botGrad.addColorStop(0.3, borderColor + 'ff');
|
||||
botGrad.addColorStop(0.7, borderColor + 'ff');
|
||||
botGrad.addColorStop(1, borderColor + '00');
|
||||
botGrad.addColorStop(1, borderColor + 'ff');
|
||||
ctx.strokeStyle = botGrad;
|
||||
ctx.beginPath(); ctx.moveTo(x, y + ICON); ctx.lineTo(x + ICON, y + ICON); ctx.stroke();
|
||||
|
||||
// Left edge gradient (top to bottom)
|
||||
const leftGrad = ctx.createLinearGradient(x, y, x, y + ICON);
|
||||
leftGrad.addColorStop(0, borderColor + '00');
|
||||
leftGrad.addColorStop(0, borderColor + 'ff');
|
||||
leftGrad.addColorStop(0.3, borderColor + 'ff');
|
||||
leftGrad.addColorStop(0.7, borderColor + 'ff');
|
||||
leftGrad.addColorStop(1, borderColor + '00');
|
||||
leftGrad.addColorStop(1, borderColor + 'ff');
|
||||
ctx.strokeStyle = leftGrad;
|
||||
ctx.beginPath(); ctx.moveTo(x, y); ctx.lineTo(x, y + ICON); ctx.stroke();
|
||||
|
||||
// Right edge gradient
|
||||
const rightGrad = ctx.createLinearGradient(x + ICON, y, x + ICON, y + ICON);
|
||||
rightGrad.addColorStop(0, borderColor + '00');
|
||||
rightGrad.addColorStop(0, borderColor + 'ff');
|
||||
rightGrad.addColorStop(0.3, borderColor + 'ff');
|
||||
rightGrad.addColorStop(0.7, borderColor + 'ff');
|
||||
rightGrad.addColorStop(1, borderColor + '00');
|
||||
rightGrad.addColorStop(1, borderColor + 'ff');
|
||||
ctx.strokeStyle = rightGrad;
|
||||
ctx.beginPath(); ctx.moveTo(x + ICON, y); ctx.lineTo(x + ICON, y + ICON); ctx.stroke();
|
||||
|
||||
@@ -1001,7 +978,7 @@ async function renderLockerImage(items, countLabel, subtitle, submittedBy = null
|
||||
|
||||
// ── Name label ────────────────────────────────────────────────────────
|
||||
ctx.fillStyle = '#ffffff';
|
||||
ctx.font = '10px Tahoma';
|
||||
ctx.font = '600 10px "SF Pro Display"';
|
||||
ctx.textAlign = 'center';
|
||||
const maxW = ICON - 4;
|
||||
let name = item.name || '';
|
||||
@@ -1013,23 +990,39 @@ async function renderLockerImage(items, countLabel, subtitle, submittedBy = null
|
||||
}
|
||||
|
||||
// ── Footer ────────────────────────────────────────────────────────────────
|
||||
const footerY = H - FTR_H;
|
||||
ctx.fillStyle = 'rgba(0,0,0,0.6)';
|
||||
ctx.fillRect(0, footerY, W, FTR_H);
|
||||
ctx.strokeStyle = '#ffd700'; ctx.lineWidth = 1;
|
||||
ctx.beginPath(); ctx.moveTo(0, footerY); ctx.lineTo(W, footerY); ctx.stroke();
|
||||
const footerY = H - FTR_H - 12;
|
||||
ctx.fillStyle = 'rgba(0, 0, 0, 0)';
|
||||
ctx.fillRect(0, footerY, W, FTR_H + 12);
|
||||
|
||||
const logoBuf = await getLogoBuffer();
|
||||
let logoEndX = PAD;
|
||||
if (logoBuf) {
|
||||
try {
|
||||
const logoResized = await sharp(logoBuf).resize(LOGO_SIZE, LOGO_SIZE, { fit: 'cover' }).png().toBuffer();
|
||||
const logoImg = await loadImage(logoResized);
|
||||
const cx = PAD + LOGO_SIZE / 4, cy = 4 + LOGO_SIZE / 2, lr = LOGO_SIZE / 2;
|
||||
ctx.save();
|
||||
ctx.drawImage(logoImg, PAD - 2, footerY + 4, LOGO_SIZE, LOGO_SIZE);
|
||||
ctx.restore();
|
||||
logoEndX = PAD + LOGO_SIZE + 10;
|
||||
} catch { logoEndX = PAD; }
|
||||
}
|
||||
|
||||
ctx.fillStyle = '#ffffff';
|
||||
ctx.font = 'bold 11px TahomaB';
|
||||
ctx.fillText(submittedBy ? `Submitted by: ${submittedBy}` : 'Made by jitterbuxg', PAD, footerY + 14);
|
||||
ctx.fillStyle = '#ffd700';
|
||||
ctx.font = '10px Tahoma';
|
||||
ctx.fillText('.gg/collecting', PAD, footerY + 28);
|
||||
ctx.font = '600 12px "SF Pro Display"';
|
||||
ctx.fillText(`submitted by: ${submittedBy}`, PAD + LOGO_SIZE, footerY + 17);
|
||||
ctx.fillStyle = '#ffffff';
|
||||
ctx.font = '600 12px "SF Pro Display"';
|
||||
ctx.fillText('discord.gg/atn', PAD + LOGO_SIZE, footerY + 33);
|
||||
|
||||
ctx.fillStyle = '#888888';
|
||||
ctx.font = '10px Tahoma';
|
||||
ctx.fillStyle = '#ffffff';
|
||||
ctx.font = '600 12px "SF Pro Display"';
|
||||
ctx.textAlign = 'right';
|
||||
ctx.fillText(new Date().toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' }), W - PAD, footerY + 21);
|
||||
ctx.fillText(new Date().toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' }), W - PAD, footerY + 20);
|
||||
ctx.fillStyle = '#ffffff';
|
||||
ctx.font = '600 12px "SF Pro Display"';
|
||||
ctx.textAlign = 'right';
|
||||
ctx.fillText("total items: " + countLabel, W - PAD, footerY + 36);
|
||||
ctx.textAlign = 'left';
|
||||
|
||||
return canvas.toBuffer('image/png');
|
||||
@@ -1041,9 +1034,8 @@ async function sendLockerImageEmbed(message, { title, description, imageBuffer,
|
||||
? `${String(title).slice(0, 247)}...`
|
||||
: String(title || 'Locker Check');
|
||||
const embed = new EmbedBuilder()
|
||||
.setColor(0xFFD700)
|
||||
.setTitle(safeTitle)
|
||||
.setDescription(description)
|
||||
.setColor(0xffffff)
|
||||
.setDescription("**" + safeTitle + "**\n" + description)
|
||||
.setImage(`attachment://${fileName}`)
|
||||
.setTimestamp();
|
||||
|
||||
@@ -1378,20 +1370,13 @@ function getRolesForLocker(ownedMap, ccItems) {
|
||||
// BOT READY
|
||||
// ─────────────────────────────────────────────────────────────────────────────
|
||||
client.once('ready', async () => {
|
||||
console.log(`✅ Logged in as ${client.user.tag}`);
|
||||
console.log('Commands: !setuproles | !addicons | !skipemoji | !stopemojis | !setroleicons | !removeoldemojis | !verify');
|
||||
console.log(`logged in as ${client.user.tag}`);
|
||||
|
||||
// Set bot avatar to Renegade Raider Black & Gold style
|
||||
try {
|
||||
const imgRes = await fetch('https://fortnite-api.com/images/cosmetics/br/cid_028_athena_commando_f/variants/material/mat3.png');
|
||||
const imgBuf = Buffer.from(await imgRes.arrayBuffer());
|
||||
await client.user.setAvatar(imgBuf);
|
||||
console.log('✅ Bot avatar set to Renegade Raider Black & Gold.');
|
||||
} catch (err) {
|
||||
console.warn('Could not set avatar (may already be set or rate limited):', err.message);
|
||||
}
|
||||
client.user.setActivity(
|
||||
'checking skins',
|
||||
{ type: ActivityType.Playing }
|
||||
);
|
||||
|
||||
// Register /commands slash command to guild for instant availability
|
||||
const rest = new REST({ version: '10' }).setToken(process.env.TOKEN);
|
||||
const slashCommands = [
|
||||
new SlashCommandBuilder()
|
||||
@@ -1401,9 +1386,9 @@ client.once('ready', async () => {
|
||||
];
|
||||
try {
|
||||
await rest.put(Routes.applicationGuildCommands(client.user.id, process.env.EMOJI_GUILD_ID), { body: slashCommands });
|
||||
console.log('✅ Slash commands registered to guild.');
|
||||
console.log('slash commands registered to guild');
|
||||
} catch (err) {
|
||||
console.error('Failed to register slash commands:', err.message);
|
||||
console.error('failed to register slash commands! ', err.message);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1707,12 +1692,45 @@ client.on('messageCreate', async (message) => {
|
||||
message.reply(`Your verification as **${prev.epicName}** has been removed and your roles have been stripped. You can now use \`!verify\` to link a different account.`);
|
||||
});
|
||||
|
||||
client.on('messageCreate', async (message) => {
|
||||
if (message.author.bot || message.content !== ',test') return;
|
||||
|
||||
const userId = message.author.id;
|
||||
|
||||
if (!verifiedUsers.has(userId))
|
||||
return message.reply('You are not currently verified. Use `!verify` to link your account.');
|
||||
|
||||
const prev = verifiedUsers.get(userId);
|
||||
const guild = client.guilds.cache.get(prev.guildId) || message.guild;
|
||||
|
||||
if (guild) {
|
||||
try {
|
||||
const member = await guild.members.fetch(userId).catch(() => null);
|
||||
if (member) {
|
||||
for (const roleName of prev.assignedRoles) {
|
||||
const role = guild.roles.cache.find(r => r.name.toLowerCase() === roleName.toLowerCase());
|
||||
if (role && member.roles.cache.has(role.id)) {
|
||||
await member.roles.remove(role, 'User unverified').catch(() => null);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('Unverify role removal error:', err.message);
|
||||
}
|
||||
}
|
||||
|
||||
verifiedUsers.delete(userId);
|
||||
message.reply(`Your verification as **${prev.epicName}** has been removed and your roles have been stripped. You can now use \`!verify\` to link a different account.`);
|
||||
});
|
||||
|
||||
// ─────────────────────────────────────────────────────────────────────────────
|
||||
// !verify
|
||||
// ─────────────────────────────────────────────────────────────────────────────
|
||||
client.on('messageCreate', async (message) => {
|
||||
if (message.author.bot || message.content !== '!verify') return;
|
||||
|
||||
console.log("verify");
|
||||
|
||||
const userId = message.author.id;
|
||||
|
||||
// Support DMs — if in DM, we need to find the guild separately
|
||||
@@ -1730,20 +1748,32 @@ client.on('messageCreate', async (message) => {
|
||||
}
|
||||
|
||||
if (pending.has(userId))
|
||||
return message.reply('you already have a verification in progress! please check your dms.');
|
||||
|
||||
await message.reply('<:check:1481811973447356496> a login link has been sent to your dms!');
|
||||
return message.reply({
|
||||
content: null, embeds: [{
|
||||
color: 0xefecef,
|
||||
author: {
|
||||
name: message.author.username,
|
||||
icon_url: message.author.displayAvatarURL(),
|
||||
},
|
||||
description: `<:warning:1481811992858722335> you already have a pending verification, please check your dms!`,
|
||||
footer: {
|
||||
text: `1-800 @ ${message.guild.name}`,
|
||||
icon_url: client.user.displayAvatarURL(),
|
||||
},
|
||||
timestamp: new Date(),
|
||||
}],
|
||||
});
|
||||
|
||||
await message.reply({
|
||||
content: null, embeds: [{
|
||||
color: 0x8aa2b3,
|
||||
color: 0xefecef,
|
||||
author: {
|
||||
name: message.author.username,
|
||||
icon_url: message.author.displayAvatarURL(),
|
||||
},
|
||||
description: `<:no:1481811955592466492> successfully deleted ${deletedMessages.size - 1} messages!`,
|
||||
description: `<:check:1481811973447356496> a login link has been sent to your dms!`,
|
||||
footer: {
|
||||
text: `twitter @ ${message.guild.name}`,
|
||||
text: `1-800 @ ${message.guild.name ? message.guild.name : "local"}`,
|
||||
icon_url: client.user.displayAvatarURL(),
|
||||
},
|
||||
timestamp: new Date(),
|
||||
@@ -1759,13 +1789,21 @@ client.on('messageCreate', async (message) => {
|
||||
const loginUrl = `https://www.epicgames.com/activate?userCode=${deviceData.user_code}`;
|
||||
|
||||
const embed = new EmbedBuilder()
|
||||
.setColor(0x5865F2)
|
||||
.setColor(0xffffff)
|
||||
.setAuthor({
|
||||
name: message.author.username,
|
||||
icon_url: message.author.displayAvatarURL(),
|
||||
})
|
||||
.setDescription(
|
||||
`**[click here to verify!](${loginUrl})**\n\n` +
|
||||
`code: \`${deviceData.user_code}\`\n\n` +
|
||||
`**[click here to verify!](${loginUrl})**\n` +
|
||||
`code: \`${deviceData.user_code}\`\n` +
|
||||
`expires in **5 minutes**. the bot will check your locker and assign your roles automatically!`
|
||||
)
|
||||
.setFooter({ text: `1-800 @ ${message.guild.name}`, icon_url: client.user.displayAvatarURL() });
|
||||
.setFooter({
|
||||
text: `1-800 @ ${message.guild.name}`,
|
||||
icon_url: client.user.displayAvatarURL(),
|
||||
})
|
||||
.setTimestamp();
|
||||
|
||||
await message.author.send({ embeds: [embed] });
|
||||
pending.set(userId, { guildId: guild.id, channelId: message.channel.id });
|
||||
@@ -1774,14 +1812,58 @@ client.on('messageCreate', async (message) => {
|
||||
pending.delete(userId);
|
||||
|
||||
if (!tokenData)
|
||||
return message.author.send('Login expired. Use !verify to try again.');
|
||||
return message.author.send({
|
||||
content: null, embeds: [{
|
||||
color: 0xffffff,
|
||||
author: {
|
||||
name: message.author.username,
|
||||
icon_url: message.author.displayAvatarURL(),
|
||||
},
|
||||
description: `<:no:1481811955592466492> login expired! please try !verify again.`,
|
||||
footer: {
|
||||
text: `1-800 @ ${message.guild.name}`,
|
||||
icon_url: client.user.displayAvatarURL(),
|
||||
},
|
||||
timestamp: new Date(),
|
||||
}],
|
||||
});
|
||||
|
||||
const iosData = await exchangeForIosToken(tokenData.access_token);
|
||||
if (!iosData.access_token)
|
||||
return message.author.send('Authentication failed. Please try again.');
|
||||
//return message.author.send('Authentication failed. Please try again.');
|
||||
return message.author.send({
|
||||
content: null, embeds: [{
|
||||
color: 0xffffff,
|
||||
author: {
|
||||
name: message.author.username,
|
||||
icon_url: message.author.displayAvatarURL(),
|
||||
},
|
||||
description: `<:no:1481811955592466492> authentication failed! please try again.`,
|
||||
footer: {
|
||||
text: `1-800 @ ${message.guild.name}`,
|
||||
icon_url: client.user.displayAvatarURL(),
|
||||
},
|
||||
timestamp: new Date(),
|
||||
}],
|
||||
});
|
||||
|
||||
const { account_id: accountId, displayName = 'Unknown', access_token: accessToken } = iosData;
|
||||
await message.author.send(`Logged in as **${displayName}**. Fetching locker...`);
|
||||
//await message.author.send(`logged in as **${displayName}**! fetching locker...`);
|
||||
await message.author.send({
|
||||
content: null, embeds: [{
|
||||
color: 0xffffff,
|
||||
author: {
|
||||
name: message.author.username,
|
||||
icon_url: message.author.displayAvatarURL(),
|
||||
},
|
||||
description: `<:check:1481811973447356496> logged in as **${displayName}**! fetching locker...`,
|
||||
footer: {
|
||||
text: `1-800 @ ${message.guild.name}`,
|
||||
icon_url: client.user.displayAvatarURL(),
|
||||
},
|
||||
timestamp: new Date(),
|
||||
}],
|
||||
});
|
||||
|
||||
const [athenaData, commonCoreData] = await Promise.all([
|
||||
getProfile(accountId, accessToken, 'athena'),
|
||||
@@ -1813,17 +1895,23 @@ client.on('messageCreate', async (message) => {
|
||||
|
||||
const verifyEmbed = new EmbedBuilder()
|
||||
.setColor(0x2B2D31)
|
||||
.setTitle(`${displayName}'s Verification`)
|
||||
.setAuthor({
|
||||
name: displayName + " (" + message.author.username + ")",
|
||||
iconURL: message.author.displayAvatarURL(),
|
||||
})
|
||||
.setDescription(
|
||||
assigned.length === 0
|
||||
? 'No exclusive roles found.'
|
||||
: assigned.map(r => `— ${r}`).join('\n')
|
||||
? 'no exclusive roles found!'
|
||||
: "roles added: " + assigned.map(r => `— ${r}`).join('\n')
|
||||
)
|
||||
.addFields(
|
||||
{ name: 'Total Outfits', value: String(outfits.length), inline: true },
|
||||
{ name: 'Total Pickaxes', value: String(pickaxes.length), inline: true },
|
||||
{ name: 'total outfits', value: String(outfits.length), inline: true },
|
||||
{ name: 'total pickaxes', value: String(pickaxes.length), inline: true },
|
||||
)
|
||||
.setFooter({ text: 'Made by jitterbuxg' });
|
||||
.setFooter({
|
||||
text: `1-800 @ ${message.guild.name}`,
|
||||
icon_url: client.user.displayAvatarURL(),
|
||||
});
|
||||
|
||||
await message.author.send({ embeds: [verifyEmbed] });
|
||||
|
||||
@@ -1839,18 +1927,33 @@ client.on('messageCreate', async (message) => {
|
||||
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',
|
||||
'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 '';
|
||||
@@ -1859,23 +1962,26 @@ client.on('messageCreate', async (message) => {
|
||||
};
|
||||
|
||||
const logEmbed = new EmbedBuilder()
|
||||
.setColor(assigned.length > 0 ? 0xFFD700 : 0x444444)
|
||||
.setColor(0xffffff)
|
||||
.setAuthor({
|
||||
name: displayName,
|
||||
iconURL: 'https://fortnite-api.com/images/cosmetics/br/cid_028_athena_commando_f/variants/material/mat3.png',
|
||||
name: displayName + " (" + message.author.username + ")",
|
||||
iconURL: message.author.displayAvatarURL(),
|
||||
})
|
||||
.setTitle('Account Verified')
|
||||
.setDescription(
|
||||
assigned.length === 0
|
||||
? 'No exclusive cosmetics found on this account.'
|
||||
"**<:check:1481811973447356496> account verified!**" +
|
||||
assigned.length === 0
|
||||
? 'no exclusive cosmetics found on this account!'
|
||||
: assigned.map(r => `${getServerEmoji(r)}${r}`).join('\n')
|
||||
)
|
||||
.addFields(
|
||||
{ name: 'Discord', value: message.author.username, inline: true },
|
||||
{ name: 'Epic Account', value: displayName, inline: true },
|
||||
{ name: 'Roles Given', value: String(assigned.length), inline: true },
|
||||
{ name: 'discord', value: message.author.username, inline: true },
|
||||
{ name: 'epic account', value: displayName, inline: true },
|
||||
{ name: 'roles given', value: String(assigned.length), inline: true },
|
||||
)
|
||||
.setFooter({ text: '.gg/collecting • Made by jitterbuxg' })
|
||||
.setFooter({
|
||||
text: `1-800 @ ${message.guild.name}`,
|
||||
icon_url: client.user.displayAvatarURL(),
|
||||
})
|
||||
.setTimestamp();
|
||||
await logChannel.send({ embeds: [logEmbed] });
|
||||
}
|
||||
@@ -1925,7 +2031,7 @@ client.on('messageCreate', async (message) => {
|
||||
}
|
||||
|
||||
if (exclusiveItems.length > 0) {
|
||||
await message.author.send('Building your exclusive cosmetics image...');
|
||||
//await message.author.send('Building your exclusive cosmetics image...');
|
||||
const exclusiveImg = await renderLockerImage(
|
||||
exclusiveItems,
|
||||
`${exclusiveItems.length} (0)`,
|
||||
@@ -1938,14 +2044,14 @@ client.on('messageCreate', async (message) => {
|
||||
const suffix = exclusiveItems.length > 5 ? ` + ${exclusiveItems.length - 5} more` : '';
|
||||
await sendLockerImageEmbed(message, {
|
||||
title: `${top5}${suffix}`,
|
||||
description: `${outfits.length} skin count`,
|
||||
description: `${exclusiveItems.length} exclusives`,
|
||||
imageBuffer: exclusiveImg,
|
||||
fileName: 'exclusives.png',
|
||||
});
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('Exclusive image error:', err.message);
|
||||
console.error('exclusive image error:', err.message);
|
||||
}
|
||||
|
||||
// ── 3. Full locker — all items, sorted by rarity, one image per category ──
|
||||
@@ -1969,20 +2075,20 @@ client.on('messageCreate', async (message) => {
|
||||
for (const [k, v] of Object.entries(allMeta)) metaMap[k] = metaMap[k] || v;
|
||||
|
||||
const categories = [
|
||||
{ ids: sortByRarity(outfits), label: 'OUTFITS', subtitle: `${outfits.length} outfits` },
|
||||
{ ids: sortByRarity(pickaxes), label: 'PICKAXES', subtitle: `${pickaxes.length} pickaxes` },
|
||||
{ ids: sortByRarity(emotes), label: 'EMOTES', subtitle: `${emotes.length} emotes` },
|
||||
{ ids: sortByRarity(emoticons), label: 'EMOTICONS', subtitle: `${emoticons.length} emoticons` },
|
||||
{ ids: sortByRarity(backblings), label: 'BACK BLINGS', subtitle: `${backblings.length} back blings` },
|
||||
{ ids: sortByRarity(gliders), label: 'GLIDERS', subtitle: `${gliders.length} gliders` },
|
||||
{ ids: sortByRarity(sprays), label: 'SPRAYS', subtitle: `${sprays.length} sprays` },
|
||||
{ ids: sortByRarity(outfits), label: 'outfits', subtitle: `${outfits.length} outfits` },
|
||||
{ ids: sortByRarity(pickaxes), label: 'pickaxes', subtitle: `${pickaxes.length} pickaxes` },
|
||||
{ ids: sortByRarity(emotes), label: 'emotes', subtitle: `${emotes.length} emotes` },
|
||||
{ ids: sortByRarity(emoticons), label: 'emoticons', subtitle: `${emoticons.length} emoticons` },
|
||||
{ ids: sortByRarity(backblings), label: 'back blings', subtitle: `${backblings.length} back blings` },
|
||||
{ ids: sortByRarity(gliders), label: 'gliders', subtitle: `${gliders.length} gliders` },
|
||||
{ ids: sortByRarity(sprays), label: 'sprays', subtitle: `${sprays.length} sprays` },
|
||||
...(ownedExclusiveBannerIds.length > 0
|
||||
? [{ ids: ownedExclusiveBannerIds, label: 'BANNERS', subtitle: `${ownedExclusiveBannerIds.length} banners` }]
|
||||
? [{ ids: ownedExclusiveBannerIds, label: 'banners', subtitle: `${ownedExclusiveBannerIds.length} banners` }]
|
||||
: []),
|
||||
].filter(c => c.ids.length > 0);
|
||||
|
||||
if (categories.length === 0) {
|
||||
await message.author.send('No cosmetics found in locker.');
|
||||
await message.author.send('no cosmetics found in locker!');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2016,13 +2122,13 @@ client.on('messageCreate', async (message) => {
|
||||
}
|
||||
|
||||
} catch (err) {
|
||||
console.error('Locker image error:', err.message);
|
||||
console.error('locker image error:', err.message);
|
||||
}
|
||||
|
||||
} catch (err) {
|
||||
pending.delete(userId);
|
||||
console.error('Verify error:', err);
|
||||
message.author.send('Unexpected error. Try again.').catch(() => null);
|
||||
console.error('verify error:', err);
|
||||
message.author.send('unexpected error. Try again.').catch(() => null);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Whitespace-only changes.
Reference in new issue
Block a user