move to app emotes, add badge emotes, change some feature icons around, remove poll/vote command

This commit is contained in:
Cynthia Foxwell 2024-08-13 21:36:16 -06:00
parent e917c985e2
commit a22d9aad1e
7 changed files with 158 additions and 137 deletions

View file

@ -1,50 +0,0 @@
const Command = require("@lib/command.js");
const {formatUsername} = require("@util/misc.js");
const poll = new Command("poll");
poll.category = "misc";
poll.helpText = "Start a poll";
poll.usage = "[topic] [option 1] [option 2] [...option 3-10]";
poll.callback = async function (msg, line, [topic, ...options]) {
if (!line || !topic) return 'Usage: hf!poll "topic" "option 1" "option 2" "...options 3-10"';
const arrOptions = [...options].slice(0, 10);
if (arrOptions.length < 2) return "A minimum of two options are required.";
const reactions = [];
let displayString = `**${formatUsername(msg.author)}** has started a poll:\n## __${topic}__\n`;
for (let i = 0; i < arrOptions.length; i++) {
displayString += (i === 9 ? "\ud83d\udd1f" : `${i + 1}\u20e3`) + ": " + arrOptions[i] + "\n";
reactions[i] = i === 9 ? "\ud83d\udd1f" : `${i + 1}\u20e3`;
}
return {
content: displayString,
addReactions: reactions,
};
};
hf.registerCommand(poll);
const vote = new Command("vote");
vote.category = "misc";
vote.helpText = "Start a yes/no vote";
vote.usage = "[topic]";
vote.callback = async function (msg, line, topic, {maybe}) {
if (!topic) return "No topic given.";
topic = topic.join(" ");
return {
content: `**${formatUsername(
msg.author
)}** has started a vote:\n## __${topic}__\n<:ms_tick:503341995348066313>: Yes\n<:ms_cross:503341994974773250>: No${
maybe ? "\n<:ms_tilda:581268710925271095>: Maybe/Uncertain" : ""
}`,
addReactions: [
":ms_tick:503341995348066313",
":ms_cross:503341994974773250",
maybe && ":ms_tilda:581268710925271095",
].filter((x) => x != null),
};
};
hf.registerCommand(vote);

View file

@ -2,10 +2,11 @@ const Command = require("@lib/command.js");
const InteractionCommand = require("@lib/interactionCommand.js"); const InteractionCommand = require("@lib/interactionCommand.js");
const {ApplicationCommandOptionTypes} = require("@util/dconstants.js"); const {ApplicationCommandOptionTypes} = require("@util/dconstants.js");
const {Icons} = require("@util/constants.js");
const {safeString} = require("@util/misc.js"); const {safeString} = require("@util/misc.js");
const WA_NO_ANSWER = "<:ms_cross:503341994974773250> No answer."; const WA_NO_ANSWER = `${Icons.silk.cross} No answer.`;
const wolfram = new Command("wolfram"); const wolfram = new Command("wolfram");
wolfram.category = "misc"; wolfram.category = "misc";

View file

@ -21,7 +21,12 @@ flagdump.usage = "[flags or user mention]";
flagdump.callback = async function (msg, line, [numOrMention], {id, list}) { flagdump.callback = async function (msg, line, [numOrMention], {id, list}) {
if (!line || line == "") numOrMention = `<@${msg.author.id}>`; if (!line || line == "") numOrMention = `<@${msg.author.id}>`;
const num = BigInt(numOrMention); let num;
try {
num = BigInt(numOrMention);
} catch {
// noop
}
let out = ""; let out = "";
if (list) { if (list) {
let allFlags = 0n; let allFlags = 0n;

View file

@ -329,7 +329,7 @@ guildinfo.callback = async function (msg, line, args, {nolocal, debug}) {
const verfifiedBots = members.filter((member) => member.bot && (member.user.publicFlags & 65536) != 0).length; const verfifiedBots = members.filter((member) => member.bot && (member.user.publicFlags & 65536) != 0).length;
embed.fields.push({ embed.fields.push({
name: "Member Count", name: "Member Count",
value: `${Icons.online}${online} online${Icons.blank}${Icons.blank}${Icons.offline}${guild.memberCount} members\n${Icons.silk.cog} ${bots}${Icons.blank}${Icons.silk.tick} ${verfifiedBots}`, value: `${Icons.online}${online} online\u3000\u3000${Icons.offline}${guild.memberCount} members\n${Icons.silk.cog} ${bots}\u3000\u3000${Icons.silk.tick} ${verfifiedBots}`,
inline: false, inline: false,
}); });
@ -421,7 +421,7 @@ guildinfo.callback = async function (msg, line, args, {nolocal, debug}) {
embed.fields.push({ embed.fields.push({
name: "Member Count", name: "Member Count",
value: `${Icons.online}${guild.approximate_presence_count} online${Icons.blank}${Icons.blank}${Icons.offline}${guild.approximate_member_count} members`, value: `${Icons.online}${guild.approximate_presence_count} online\u3000\u3000${Icons.offline}${guild.approximate_member_count} members`,
inline: false, inline: false,
}); });
@ -516,7 +516,7 @@ guildinfo.callback = async function (msg, line, args, {nolocal, debug}) {
embed.fields.push({ embed.fields.push({
name: "Member Count", name: "Member Count",
value: `${Icons.online}${guildObj.approximate_presence_count} online\t\t<:offline:1152111682886316042>${guildObj.approximate_member_count} members`, value: `${Icons.online}${guildObj.approximate_presence_count} online\t\t${Icons.offline}${guildObj.approximate_member_count} members`,
inline: false, inline: false,
}); });
@ -597,7 +597,7 @@ guildinfo.callback = async function (msg, line, args, {nolocal, debug}) {
embed.fields.push({ embed.fields.push({
name: "Member Count", name: "Member Count",
value: `<:online:1152111668856361010>${invite.approximate_presence_count} online\t\t<:offline:1152111682886316042>${invite.approximate_member_count} members`, value: `${Icons.online}${invite.approximate_presence_count} online\t\t${Icons.offline}${invite.approximate_member_count} members`,
inline: false, inline: false,
}); });

View file

@ -179,7 +179,7 @@ lookupinvite.callback = async function (msg, line) {
}, },
{ {
name: "Member Count", name: "Member Count",
value: `<:offline:1152111682886316042>${invite.approximate_member_count} members`, value: `${Icons.offline}${invite.approximate_member_count} members`,
inline: true, inline: true,
}, },
expires, expires,

View file

@ -2,64 +2,71 @@ module.exports = {};
const SILK_ICONS = Object.fromEntries( const SILK_ICONS = Object.fromEntries(
Object.entries({ Object.entries({
joystick: "1250544500246577172", application_view_tile: "1273119065329631294",
film: "1250544523730223277", basket: "1273119074947174430",
shield: "1250543253472673875", bell: "1273119087664304169",
vcard: "1250544496765308948", bell_delete: "1273119098775146628",
photo: "1250543277267222639", book_tabs: "1273119114017378314",
world_add: "1250544495435452547", book_tabs_delete: "1273119122669961339",
ruby: "1250544494739325001", bookmark: "1273119132719644733",
emoticon_smile: "1250543500471046288", bookmark_delete: "1273119141078896722",
bug: "1250544574104080507", bug: "1273119149425561632",
comments_star: "1250544493841616988", calendar: "1273119158803894363",
comments_delete: "1250544492709412946", chart_organisation: "1273119178550935552",
flag_blue: "1250544491471831131", check_checked_green: "1273119189141422140",
flag_red: "1250544490507141312", cog: "1273119202395291760",
controller: "1250544489156710541", cog_delete: "1273119211220238407",
cog_delete: "1250544595666997288", comment: "1273119233487929405",
cog: "1250543252747321468", comments: "1273119243805921323",
basket: "1250544573088923722", compass: "1273119254954250302",
group: "1250543273726967900", compress: "1273119265876217907",
check_checked_green: "1250544572203929815", controller: "1273119275724570654",
world: "1250543499489706195", controller_delete: "1273119284125630585",
world_delete: "1250544571180515408", creditcards: "1273119294225649694",
transmit_blue: "1250544569448136857", cross: "1273119303972946001",
comments: "1250543256052301924", delete: "1273119315159289896",
status_away: "1250544568772853801", emoticon_smile: "1273119327901454336",
page_link: "1250544567665561631", emoticon_smile_add: "1273119339570139157",
book_open_mark: "1250544632064901240", error: "1273119353000165460",
house: "1250543270342426644", eye: "1273119369261486121",
lock: "1250543498470359121", film: "1273119412693631010",
sitemap: "1250544630907535361", flag_blue: "1273119425675132999",
eye: "1250544630043381872", flag_red: "1273119438635536385",
link: "1250543266806628412", group: "1273119451780354139",
time: "1250544629053522030", house: "1273119469987696754",
delete: "1250543248909406248", image_add: "1273119484474818570",
money: "1250544627665211404", joystick: "1273119500627349534",
money_delete: "1250544627178803313", key: "1273119517353967616",
emoticon_smile_add: "1250544626054594560", link: "1273119531916853269",
image_add: "1250544625068806215", lock: "1273119546068176956",
newspaper: "1250543497010872485", magnifier: "1273119565349392444",
bell: "1250544670178803722", microphone: "1273119582785372160",
application_view_tile: "1250544666080837703", money: "1273119599033843836",
star: "1250543254869381170", money_delete: "1273119611122094170",
compress: "1250544665091113080", newspaper: "1273119623633436785",
bell_delete: "1250544686121095289", outline: "1273119642084315308",
stop: "1250544664000467056", page_link: "1273119659205595207",
creditcards: "1250544663014936798", palette: "1273119683075244052",
tag_blue: "1250543263656574996", photo: "1273119700103991328",
calendar: "1250543496255897660", ruby: "1273119720756740106",
book_go: "1250544662037528717", shield: "1273119737043222589",
palette: "1250544661035225189", snowflake: "1268434236839559219",
sound: "1250543260196147323", sound: "1273119755376529418",
key: "1250543495286882375", star: "1273119776415289377",
book_tabs: "1250544659940380672", status_away: "1273119793733701715",
book_tabs_delete: "1250555962364919808", stop: "1273119816181350461",
wand: "1250544659038601266", tag_blue: "1273119832711237663",
tick: "1250543251375653007", tick: "1273119852168740884",
microphone: "1250543257398542436", time: "1273119868031467662",
user_add: "1250544566503739412", transmit_blue: "1273119883202269225",
controller_delete: "1262137043417563256", user_add: "1273119924675416064",
vcard: "1273119947341561856",
wand: "1273119971442036746",
world: "1273119983907639338",
world_add: "1273119996305997844",
world_delete: "1273120009593425940",
world_link: "1273122514675044457",
world_night_magnify: "1273120024189734943",
}).map(([key, val]) => [key, `<:i:${val}>`]) }).map(([key, val]) => [key, `<:i:${val}>`])
); );
@ -120,8 +127,8 @@ module.exports.GuildFeaturesFormatted = {
icon: SILK_ICONS.emoticon_smile, icon: SILK_ICONS.emoticon_smile,
name: "Channel Icon Emojis", name: "Channel Icon Emojis",
}, },
CHANNEL_HIGHLIGHTS: {icon: SILK_ICONS.comments_star}, CHANNEL_HIGHLIGHTS: {icon: SILK_ICONS.bookmark},
CHANNEL_HIGHLIGHTS_DISABLED: {icon: SILK_ICONS.comments_delete}, CHANNEL_HIGHLIGHTS_DISABLED: {icon: SILK_ICONS.bookmark_delete},
CLAN: {icon: SILK_ICONS.flag_blue}, CLAN: {icon: SILK_ICONS.flag_blue},
CLAN_DISCOVERY_DISABLED: {icon: SILK_ICONS.flag_red}, CLAN_DISCOVERY_DISABLED: {icon: SILK_ICONS.flag_red},
CLAN_PILOT_GENSHIN: { CLAN_PILOT_GENSHIN: {
@ -185,7 +192,7 @@ module.exports.GuildFeaturesFormatted = {
DEVELOPER_SUPPORT_SERVER: {icon: SILK_ICONS.cog}, DEVELOPER_SUPPORT_SERVER: {icon: SILK_ICONS.cog},
DISCOVERABLE: {icon: SILK_ICONS.world}, DISCOVERABLE: {icon: SILK_ICONS.world},
DISCOVERABLE_DISABLED: {icon: SILK_ICONS.world_delete}, DISCOVERABLE_DISABLED: {icon: SILK_ICONS.world_delete},
ENABLED_DISCOVERABLE_BEFORE: {icon: SILK_ICONS.world}, ENABLED_DISCOVERABLE_BEFORE: {icon: SILK_ICONS.world_night_magnify},
EXPOSED_TO_ACTIVITIES_WTP_EXPERIMENT: { EXPOSED_TO_ACTIVITIES_WTP_EXPERIMENT: {
icon: SILK_ICONS.bug, icon: SILK_ICONS.bug,
name: "Activities: WTP Experiment", name: "Activities: WTP Experiment",
@ -258,7 +265,7 @@ module.exports.GuildFeaturesFormatted = {
name: "Role Subscriptions: Trials", name: "Role Subscriptions: Trials",
deprecated: true, deprecated: true,
}, },
GUILD_SERVER_GUIDE: {icon: SILK_ICONS.book_go, name: "Server Guide"}, GUILD_SERVER_GUIDE: {icon: SILK_ICONS.compass, name: "Server Guide"},
GUILD_WEB_PAGE_VANITY_URL: { GUILD_WEB_PAGE_VANITY_URL: {
icon: SILK_ICONS.page_link, icon: SILK_ICONS.page_link,
name: "Guild Web Page Vanity URL", name: "Guild Web Page Vanity URL",
@ -267,12 +274,12 @@ module.exports.GuildFeaturesFormatted = {
icon: SILK_ICONS.joystick, icon: SILK_ICONS.joystick,
name: "Activities: Had Early Access", name: "Activities: Had Early Access",
}, },
HAS_DIRECTORY_ENTRY: {icon: SILK_ICONS.book_open_mark}, HAS_DIRECTORY_ENTRY: {icon: SILK_ICONS.magnifier},
HIDE_FROM_EXPERIMENT_UI: { HIDE_FROM_EXPERIMENT_UI: {
icon: SILK_ICONS.bug, icon: SILK_ICONS.bug,
name: "Hidden from Experiment UI", name: "Hidden from Experiment UI",
}, },
HUB: {icon: SILK_ICONS.sitemap, name: "Student Hub"}, HUB: {icon: SILK_ICONS.chart_organisation, name: "Student Hub"},
INCREASED_THREAD_LIMIT: { INCREASED_THREAD_LIMIT: {
icon: SILK_ICONS.comments, icon: SILK_ICONS.comments,
name: "Threads: Increased Limit", name: "Threads: Increased Limit",
@ -405,7 +412,7 @@ module.exports.GuildFeaturesFormatted = {
deprecated: true, deprecated: true,
}, },
VALORANT_L30: {icon: SILK_ICONS.controller, name: "Clans: Valorant L30"}, VALORANT_L30: {icon: SILK_ICONS.controller, name: "Clans: Valorant L30"},
VANITY_URL: {icon: SILK_ICONS.link, name: "Vanity URL"}, VANITY_URL: {icon: SILK_ICONS.world_link, name: "Vanity URL"},
VERIFIED: {icon: SILK_ICONS.tick}, VERIFIED: {icon: SILK_ICONS.tick},
VIP_REGIONS: {icon: SILK_ICONS.microphone, name: "VIP Voice Regions"}, VIP_REGIONS: {icon: SILK_ICONS.microphone, name: "VIP Voice Regions"},
VOICE_CHANNEL_EFFECTS: {icon: SILK_ICONS.wand, deprecated: true}, VOICE_CHANNEL_EFFECTS: {icon: SILK_ICONS.wand, deprecated: true},
@ -418,24 +425,24 @@ module.exports.GuildFeaturesFormatted = {
const PRESENCE_ICONS = { const PRESENCE_ICONS = {
desktop: { desktop: {
online: "<:i:1028887024670871552>", online: "<:i:1263597847744352397>",
idle: "<:i:1028887022938624033>", idle: "<:i:1263597864089555037>",
dnd: "<:i:1028887021848121364>", dnd: "<:i:1263597872268705802>",
}, },
mobile: { mobile: {
online: "<:i:1028887017637036043>", online: "<:i:1263597896549400647>",
idle: "<:i:1028887019226669116>", idle: "<:i:1263597887518937160>",
dnd: "<:i:1028887020560449637>", dnd: "<:i:1263597880556654672>",
}, },
web: { web: {
online: "<:i:1104972136730345552>", online: "<:i:1263597918841999361>",
idle: "<:i:1104972138735218729>", idle: "<:i:1263597912571645983>",
dnd: "<:i:1104972140685570150>", dnd: "<:i:1263597905776742470>",
}, },
embedded: { embedded: {
online: "<:i:1104972131265167411>", online: "<:i:1263597941051101186>",
idle: "<:i:1104972132687024189>", idle: "<:i:1263597934252134462>",
dnd: "<:i:1104972134964543518>", dnd: "<:i:1263597927310299208>",
}, },
}; };
const OS_ICONS = { const OS_ICONS = {
@ -444,13 +451,45 @@ const OS_ICONS = {
linux: "\u{1f427}", linux: "\u{1f427}",
}; };
const BADGE_ICONS = {
staff: "<:Staff:1273105535708696656>",
partner: "<:Partner:1273105523973165078>",
certified_moderator_old: "<:CertifiedModerator:1273105504259932281>",
certified_moderator: "<:ModeratorAlumni:1273105513818624031>",
hypesquad: "<:HypesquadEvents:1273105667254910976>",
hypesquad_house_1: "<:HypesquadBravery:1273105648384479253>",
hypesquad_house_2: "<:HypesquadBrilliance:1273105657771462727>",
hypesquad_house_3: "<:HypesquadBalance:1273105639358599222>",
bug_hunter_level_1: "<:BugHunterLevel1:1273105482898472980>",
bug_hunter_level_2: "<:BugHunterLevel2:1273105492381667328>",
active_developer: "<:ActiveBotDeveloper:1273105474174058558>",
verified_developer: "<:EarlyVerifiedBotDeveloper:1273105594542194762>",
early_supporter: "<:EarlySupporter:1273105584765407289>",
premium: "<:Nitro:1273105677107335178>",
guild_booster_lvl1: "<:BoostLevel1:1273107923693731850>",
guild_booster_lvl2: "<:BoostLevel2:1273107931575095377>",
guild_booster_lvl3: "<:BoostLevel3:1273107940177346610>",
guild_booster_lvl4: "<:BoostLevel4:1273107949358813288>",
guild_booster_lvl5: "<:BoostLevel5:1273107958909243483>",
guild_booster_lvl6: "<:BoostLevel6:1273107966865965056>",
guild_booster_lvl7: "<:BoostLevel7:1273107976722452510>",
guild_booster_lvl8: "<:BoostLevel8:1273107984611934322>",
guild_booster_lvl9: "<:BoostLevel9:1273107994543919105>",
bot_commands: "<:HasSlashCommands:1273108807798755400>",
automod: "<:UsesAutoMod:1273105734862770221>",
application_guild_subscription: "<:HasPremium:1273105604067721258>",
legacy_username: "<:PreviouslyKnownAs:1273105685760049297>",
quest_completed: "<:CompletedAQuest:1273105700645502987>",
};
module.exports.Icons = { module.exports.Icons = {
silk: SILK_ICONS, silk: SILK_ICONS,
presence: PRESENCE_ICONS, presence: PRESENCE_ICONS,
os: OS_ICONS, os: OS_ICONS,
online: "<:i:1152111668856361010>", badges: BADGE_ICONS,
offline: "<:i:1152111682886316042>", online: "<:i:1273105436807139438>",
blank: "<:i:1250561747476152460>", offline: "<:i:1273105449318875228>",
boat: "<:i:1273105457661087755>",
}; };
module.exports.ChannelTypeNames = { module.exports.ChannelTypeNames = {

View file

@ -66,6 +66,32 @@ module.exports.ApplicationFlags.SOCIAL_LAYER_INTEGRATION = 1 << 27; //
module.exports.ApplicationTypes = ["Normal", "Game", "Music", "Ticketed Event", "Creator Monetization"]; module.exports.ApplicationTypes = ["Normal", "Game", "Music", "Ticketed Event", "Creator Monetization"];
module.exports.BadgeURLs = {
staff: "https://discord.com/company",
partner: "https://discord.com/partners",
certified_moderator: "https://discord.com/safety",
hypesquad: "https://discord.com/hypesquad", // dead link but idc, saves characters; new link: https://support.discord.com/hc/en-us/articles/360035962891-Profile-Badges-101#h_01GM67K5EJ16ZHYZQ5MPRW3JT3
hypesquad_house_1: "https://discord.com/settings/hypesquad-online",
hypesquad_house_2: "https://discord.com/settings/hypesquad-online",
hypesquad_house_3: "https://discord.com/settings/hypesquad-online",
bug_hunter_level_1: "https://support.discord.com/hc/en-us/articles/360046057772-Discord-Bugs",
bug_hunter_level_2: "https://support.discord.com/hc/en-us/articles/360046057772-Discord-Bugs",
active_developer: "https://support-dev.discord.com/hc/en-us/articles/10113997751447?ref=badge",
early_supporter: "https://discord.com/settings/premium",
premium: "https://discord.com/settings/premium",
guild_booster_lvl1: "https://discord.com/settings/premium",
guild_booster_lvl2: "https://discord.com/settings/premium",
guild_booster_lvl3: "https://discord.com/settings/premium",
guild_booster_lvl4: "https://discord.com/settings/premium",
guild_booster_lvl5: "https://discord.com/settings/premium",
guild_booster_lvl6: "https://discord.com/settings/premium",
guild_booster_lvl7: "https://discord.com/settings/premium",
guild_booster_lvl8: "https://discord.com/settings/premium",
guild_booster_lvl9: "https://discord.com/settings/premium",
bot_commands: "https://discord.com/blog/welcome-to-the-new-era-of-discord-apps?ref=badge",
quest_completed: "https://discord.com/settings/inventory",
};
module.exports.BASE_URL = Endpoints.BASE_URL; module.exports.BASE_URL = Endpoints.BASE_URL;
const CDNEndpoints = {}; const CDNEndpoints = {};