Skip to content

Commit 691620d

Browse files
committed
fix(discord-bot): expand license list status mapping
1 parent 6797de0 commit 691620d

1 file changed

Lines changed: 19 additions & 3 deletions

File tree

src/commands/license.js

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,12 +283,28 @@ module.exports = {
283283
.setTimestamp();
284284

285285
pageLicenses.forEach((license, index) => {
286-
const status = license.status === 'active' ? '✅' : license.status === 'expired' ? '❌' : '⚠️';
286+
const rawStatus = String(license.status || 'unknown');
287+
const normalizedStatus = rawStatus.toLowerCase();
288+
let statusLabel = rawStatus.toUpperCase();
289+
let statusIcon = '⚠️';
290+
if (normalizedStatus === 'active') {
291+
statusLabel = 'ACTIVE';
292+
statusIcon = '✅';
293+
} else if (normalizedStatus === 'expired') {
294+
statusLabel = 'EXPIRED';
295+
statusIcon = '❌';
296+
} else if (normalizedStatus === 'revoked') {
297+
statusLabel = 'REVOKED';
298+
statusIcon = '🚫';
299+
} else if (normalizedStatus === 'suspended') {
300+
statusLabel = 'SUSPENDED';
301+
statusIcon = '⛔';
302+
}
287303
const expires = license.expiresAt ? new Date(license.expiresAt).toLocaleDateString() : 'Never';
288304

289305
embed.addFields({
290-
name: `${status} ${license.applicationName || 'Unknown App'}`,
291-
value: `**Key:** \`${license.key}\`\n**Plan:** ${license.plan}\n**Expires:** ${expires}`,
306+
name: `${statusIcon} ${license.applicationName || 'Unknown App'}`,
307+
value: `**Status:** ${statusLabel}\n**Key:** \`${license.key}\`\n**Plan:** ${license.plan}\n**Expires:** ${expires}`,
292308
inline: true
293309
});
294310
});

0 commit comments

Comments
 (0)