Created
May 7, 2021 18:04
-
-
Save Stanley-GF/97ad64af9d7b5744e3ffbce1cff68372 to your computer and use it in GitHub Desktop.
Javascript Get Discord Badges using Flags
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function GetBadges(flags) | |
{ | |
const Discord_Employee = 1; | |
const Partnered_Server_Owner = 2; | |
const HypeSquad_Events = 4; | |
const Bug_Hunter_Level_1 = 8; | |
const House_Bravery = 64; | |
const House_Brilliance = 128; | |
const House_Balance = 256; | |
const Early_Supporter = 512; | |
const Bug_Hunter_Level_2 = 16384; | |
const Early_Verified_Bot_Developer = 131072; | |
var badges = []; | |
if((flags & Discord_Employee) == Discord_Employee){ | |
badges.push(":staff: STAFF DISCORD"); | |
} | |
if((flags & Partnered_Server_Owner) == Partnered_Server_Owner){ | |
badges.push(":partner: PARTNER DISCORD"); | |
} | |
if((flags & HypeSquad_Events) == HypeSquad_Events){ | |
badges.push(":hype: HypeSquad Events"); | |
} | |
if((flags & Bug_Hunter_Level_1) == Bug_Hunter_Level_1){ | |
badges.push(":bughuntervert: BugHunter (vert)"); | |
} | |
if((flags & House_Bravery) == House_Bravery) { | |
badges.push(":bravery: HypeSquad Bravery"); | |
} | |
if((flags & House_Brilliance) == House_Brilliance){ | |
badges.push(":brillance: HypeSquad Brillance"); | |
} | |
if((flags & House_Balance) == House_Balance){ | |
badges.push(":balance: HypeSquad Balance"); | |
} | |
if((flags & Early_Supporter) == Early_Supporter){ | |
badges.push(":early: Early"); | |
} | |
if((flags & Bug_Hunter_Level_2) == Bug_Hunter_Level_2){ | |
badges.push(":bughunteror: BuhHunter (or)"); | |
} | |
if((flags &Early_Verified_Bot_Developer ) == Early_Verified_Bot_Developer ){ | |
badges.push(":dev: Developper"); | |
} | |
return badges; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is it possible to make one that is for a Guild Badge?