mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-09 22:53:06 -04:00
update badge display, sync commands with slash commands
This commit is contained in:
parent
9eeb7f2721
commit
de8b946eed
4 changed files with 26 additions and 34 deletions
|
@ -40,8 +40,14 @@ const { Constants } = require('detritus-client');
|
|||
const { UserFlags } = Constants
|
||||
|
||||
const { BADGE_ICONS } = require('../constants');
|
||||
const { link } = require('./markdown');
|
||||
|
||||
const BADGE_TYPES = Object.freeze({
|
||||
"nitro": {
|
||||
description: "Discord Nitro",
|
||||
link: "https://discord.com/nitro",
|
||||
icon: BADGE_ICONS.nitro
|
||||
},
|
||||
"staff": {
|
||||
description: "Discord Staff",
|
||||
link: "https://discord.com/company",
|
||||
|
@ -121,7 +127,9 @@ const BADGES = Object.freeze({
|
|||
|
||||
function renderBadges(user){
|
||||
let badges = [];
|
||||
for(const flag of Object.keys(BADGES)) if(user.hasFlag(BADGES[flag])) badges.push(BADGE_TYPES[flag].icon)
|
||||
for(const flag of Object.keys(BADGES)) if(user.hasFlag(BADGES[flag])) badges.push(link(BADGE_TYPES[flag].link), BADGE_TYPES[flag].icon, BADGE_TYPES[flag].description)
|
||||
if(!user.bot && (user.avatarUrl.endsWith('.gif') || user.banner)) { badges.push(link(BADGE_TYPES["nitro"].link, BADGE_TYPES["nitro"].icon, BADGE_TYPES["nitro"].description)) }
|
||||
|
||||
return badges;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue