1 |
import { ColorResolvable, CommandInteraction, GuildMember, Message, User, UserFlags } from 'discord.js'; |
import { CommandInteraction, GuildMember, Message, User, UserFlags } from 'discord.js'; |
2 |
import BaseCommand from '../../utils/structures/BaseCommand'; |
import BaseCommand from '../../utils/structures/BaseCommand'; |
3 |
import DiscordClient from '../../client/Client'; |
import DiscordClient from '../../client/Client'; |
4 |
import CommandOptions from '../../types/CommandOptions'; |
import CommandOptions from '../../types/CommandOptions'; |
8 |
import { timeSince } from '../../utils/util'; |
import { timeSince } from '../../utils/util'; |
9 |
import { roleMention } from '@discordjs/builders'; |
import { roleMention } from '@discordjs/builders'; |
10 |
|
|
11 |
|
export const getUserBadges = (user: User) => { |
12 |
|
const { FLAGS } = UserFlags; |
13 |
|
|
14 |
|
const badges = []; |
15 |
|
|
16 |
|
if (user.flags?.has(FLAGS.BUGHUNTER_LEVEL_1)) |
17 |
|
badges.push('Bughunter Level 1'); |
18 |
|
if (user.flags?.has(FLAGS.BUGHUNTER_LEVEL_2)) |
19 |
|
badges.push('Bughunter Level 2'); |
20 |
|
if (user.flags?.has(FLAGS.DISCORD_CERTIFIED_MODERATOR)) |
21 |
|
badges.push('Discord Certified Moderator'); |
22 |
|
if (user.flags?.has(FLAGS.DISCORD_EMPLOYEE)) |
23 |
|
badges.push('Discord Staff'); |
24 |
|
if (user.flags?.has(FLAGS.EARLY_SUPPORTER)) |
25 |
|
badges.push('Early Nitro Supporter'); |
26 |
|
if (user.flags?.has(FLAGS.EARLY_VERIFIED_BOT_DEVELOPER)) |
27 |
|
badges.push('Early Verified Bot Developer'); |
28 |
|
if (user.flags?.has(FLAGS.HOUSE_BALANCE)) |
29 |
|
badges.push('HypeSquad Balance'); |
30 |
|
if (user.flags?.has(FLAGS.HOUSE_BRILLIANCE)) |
31 |
|
badges.push('HypeSquad Brilliance'); |
32 |
|
if (user.flags?.has(FLAGS.HOUSE_BRAVERY)) |
33 |
|
badges.push('HypeSquad Bravery'); |
34 |
|
if (user.flags?.has(FLAGS.HYPESQUAD_EVENTS)) |
35 |
|
badges.push('HypeSquad Events'); |
36 |
|
if (user.flags?.has(FLAGS.PARTNERED_SERVER_OWNER)) |
37 |
|
badges.push('Partnered Server Owner'); |
38 |
|
if (user.flags?.has(FLAGS.BOT_HTTP_INTERACTIONS)) |
39 |
|
badges.push('Supports Interactions'); |
40 |
|
if (user.flags?.has(FLAGS.VERIFIED_BOT)) |
41 |
|
badges.push('Verified Bot'); |
42 |
|
|
43 |
|
return badges.map(b => `🔵 ${b}`); |
44 |
|
}; |
45 |
|
|
46 |
export default class ProfileCommand extends BaseCommand { |
export default class ProfileCommand extends BaseCommand { |
47 |
supportsInteractions: boolean = true; |
supportsInteractions: boolean = true; |
48 |
|
|
137 |
|
|
138 |
activities = activities.join('\n'); |
activities = activities.join('\n'); |
139 |
|
|
|
const { FLAGS } = UserFlags; |
|
|
|
|
|
const getUserBadges = (user: User) => { |
|
|
const badges = []; |
|
|
|
|
|
if (user.flags?.has(FLAGS.BUGHUNTER_LEVEL_1)) |
|
|
badges.push('Bughunter Level 1'); |
|
|
if (user.flags?.has(FLAGS.BUGHUNTER_LEVEL_2)) |
|
|
badges.push('Bughunter Level 2'); |
|
|
if (user.flags?.has(FLAGS.DISCORD_CERTIFIED_MODERATOR)) |
|
|
badges.push('Discord Certified Moderator'); |
|
|
if (user.flags?.has(FLAGS.DISCORD_EMPLOYEE)) |
|
|
badges.push('Discord Staff'); |
|
|
if (user.flags?.has(FLAGS.EARLY_SUPPORTER)) |
|
|
badges.push('Early Nitro Supporter'); |
|
|
if (user.flags?.has(FLAGS.EARLY_VERIFIED_BOT_DEVELOPER)) |
|
|
badges.push('Early Verified Bot Developer'); |
|
|
if (user.flags?.has(FLAGS.HOUSE_BALANCE)) |
|
|
badges.push('HypeSquad Balance'); |
|
|
if (user.flags?.has(FLAGS.HOUSE_BRILLIANCE)) |
|
|
badges.push('HypeSquad Brilliance'); |
|
|
if (user.flags?.has(FLAGS.HOUSE_BRAVERY)) |
|
|
badges.push('HypeSquad Bravery'); |
|
|
if (user.flags?.has(FLAGS.HYPESQUAD_EVENTS)) |
|
|
badges.push('HypeSquad Events'); |
|
|
if (user.flags?.has(FLAGS.PARTNERED_SERVER_OWNER)) |
|
|
badges.push('Partnered Server Owner'); |
|
|
if (user.flags?.has(FLAGS.BOT_HTTP_INTERACTIONS)) |
|
|
badges.push('Supports Interactions'); |
|
|
if (user.flags?.has(FLAGS.VERIFIED_BOT)) |
|
|
badges.push('Verified Bot'); |
|
|
|
|
|
return badges.map(b => `🔵 ${b}`); |
|
|
}; |
|
|
|
|
140 |
const fields = [ |
const fields = [ |
141 |
{ |
{ |
142 |
name: "Nickname", |
name: "Nickname", |