2021-06-02 00:31:39 +00:00
|
|
|
const Command = require("../lib/command.js");
|
2021-06-02 00:32:30 +00:00
|
|
|
const CATEGORY = "utility";
|
2021-06-02 00:31:39 +00:00
|
|
|
|
2023-09-15 02:57:22 +00:00
|
|
|
// {{{ imports
|
2023-04-09 17:46:48 +00:00
|
|
|
|
|
|
|
const sharp = require("sharp");
|
|
|
|
|
|
|
|
const {
|
2023-09-15 03:09:20 +00:00
|
|
|
formatTime,
|
2023-04-09 17:46:48 +00:00
|
|
|
hastebin,
|
|
|
|
lookupUser,
|
2023-09-15 03:09:20 +00:00
|
|
|
pomello,
|
2023-04-09 17:46:48 +00:00
|
|
|
safeString,
|
|
|
|
} = require("../lib/utils.js");
|
2023-05-30 01:51:50 +00:00
|
|
|
const {getNamesFromString} = require("../lib/unicode.js");
|
2023-04-09 17:46:48 +00:00
|
|
|
|
|
|
|
const GameData = require("../../data/games.json");
|
|
|
|
|
|
|
|
const EmojiData = require("../../data/emoji.json");
|
|
|
|
const EMOJI_NAMES = [];
|
|
|
|
for (const emoji of EmojiData) {
|
|
|
|
EMOJI_NAMES[emoji.char] = emoji.name.replace(/ /g, "_");
|
|
|
|
}
|
|
|
|
|
2023-09-15 02:57:22 +00:00
|
|
|
// }}}
|
|
|
|
|
|
|
|
// {{{ constants
|
2023-04-09 17:46:48 +00:00
|
|
|
|
2023-05-30 02:07:21 +00:00
|
|
|
const CDN = "https://cdn.discordapp.com/";
|
|
|
|
const ICON_BASE = CDN + "icons/";
|
|
|
|
const AVATAR_BASE = CDN + "avatars/";
|
|
|
|
const SPLASH_BASE = CDN + "splashes/";
|
|
|
|
const BANNER_BASE = CDN + "banners/";
|
|
|
|
const EMOTE_BASE = CDN + "emojis/";
|
|
|
|
const CHANNEL_ICON_BASE = CDN + "channel-icons/";
|
|
|
|
|
|
|
|
const DEFAULT_GROUP_DM_AVATARS = [
|
|
|
|
"/assets/ee9275c5a437f7dc7f9430ba95f12ebd.png",
|
|
|
|
"/assets/9baf45aac2a0ec2e2dab288333acb9d9.png",
|
|
|
|
"/assets/7ba11ffb1900fa2b088cb31324242047.png",
|
|
|
|
"/assets/f90fca70610c4898bc57b58bce92f587.png",
|
|
|
|
"/assets/e2779af34b8d9126b77420e5f09213ce.png",
|
|
|
|
"/assets/c6851bd0b03f1cca5a8c1e720ea6ea17.png",
|
|
|
|
"/assets/f7e38ac976a2a696161c923502a8345b.png",
|
|
|
|
"/assets/3cb840d03313467838d658bbec801fcd.png",
|
|
|
|
];
|
2021-06-02 00:58:39 +00:00
|
|
|
|
2023-04-09 17:46:48 +00:00
|
|
|
const CUSTOM_EMOTE_REGEX = /<(?:\u200b|&)?(a)?:(\w+):(\d+)>/;
|
|
|
|
|
|
|
|
const NOWPLAYING_BAR_LENGTH = 30;
|
|
|
|
|
|
|
|
const PRESENCE_ICONS = {
|
|
|
|
desktop: {
|
|
|
|
online: "<:desktop_online:1028887024670871552>",
|
|
|
|
idle: "<:desktop_idle:1028887022938624033>",
|
|
|
|
dnd: "<:desktop_dnd:1028887021848121364>",
|
|
|
|
},
|
|
|
|
mobile: {
|
|
|
|
online: "<:mobile_online:1028887017637036043>",
|
|
|
|
idle: "<:mobile_idle:1028887019226669116>",
|
|
|
|
dnd: "<:mobile_dnd:1028887020560449637>",
|
|
|
|
},
|
|
|
|
web: {
|
2023-05-08 03:27:06 +00:00
|
|
|
online: "<:web_online:1104972136730345552>",
|
|
|
|
idle: "<:web_idle:1104972138735218729>",
|
|
|
|
dnd: "<:web_dnd:1104972140685570150>",
|
2023-04-09 17:46:48 +00:00
|
|
|
},
|
|
|
|
embedded: {
|
2023-05-08 03:27:06 +00:00
|
|
|
online: "<:embedded_online:1104972131265167411>",
|
|
|
|
idle: "<:embedded_idle:1104972132687024189>",
|
|
|
|
dnd: "<:embedded_dnd:1104972134964543518>",
|
2023-04-09 17:46:48 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
const PRESENCE_TYPES = [
|
|
|
|
"Playing",
|
|
|
|
"Streaming",
|
|
|
|
"Listening to",
|
|
|
|
"Watching",
|
2023-09-15 05:16:49 +00:00
|
|
|
"Custom Status",
|
2023-04-09 17:46:48 +00:00
|
|
|
"Competing in",
|
|
|
|
];
|
|
|
|
|
|
|
|
const USER_FLAGS = [
|
|
|
|
"STAFF",
|
|
|
|
"PARTNER",
|
|
|
|
"HYPESQUAD",
|
|
|
|
"BUG_HUNTER_LEVEL_1",
|
|
|
|
"MFA_SMS",
|
|
|
|
"PREMIUM_PROMO_DISMISSED",
|
|
|
|
"HYPESQUAD_ONLINE_HOUSE_1",
|
|
|
|
"HYPESQUAD_ONLINE_HOUSE_2",
|
|
|
|
"HYPESQUAD_ONLINE_HOUSE_3",
|
|
|
|
"PREMIUM_EARLY_SUPPORTER",
|
|
|
|
"TEAM_PSEUDO_USER",
|
|
|
|
"<Internal Application (Partner, etc) Flag>", // leaked
|
|
|
|
"SYSTEM",
|
|
|
|
"HAS_UNREAD_URGENT_MESSAGES",
|
|
|
|
"BUG_HUNTER_LEVEL_2",
|
|
|
|
"UNDERAGE_DELETED",
|
|
|
|
"VERIFIED_BOT",
|
|
|
|
"VERIFIED_DEVELOPER",
|
|
|
|
"CERTIFIED_MODERATOR",
|
|
|
|
"BOT_HTTP_INTERACTIONS",
|
|
|
|
"SPAMMER",
|
|
|
|
"DISABLE_PREMIUM",
|
|
|
|
"ACTIVE_DEVELOPER",
|
|
|
|
undefined,
|
|
|
|
undefined,
|
|
|
|
undefined,
|
|
|
|
undefined,
|
|
|
|
undefined,
|
|
|
|
undefined,
|
|
|
|
undefined,
|
|
|
|
undefined,
|
|
|
|
undefined,
|
|
|
|
undefined,
|
|
|
|
"HIGH_GLOBAL_RATE_LIMIT", // start admin panel leak aug 2022
|
|
|
|
"DELETED",
|
|
|
|
"DISABLED_SUSPICIOUS_ACTIVITY",
|
|
|
|
"SELF_DELETED",
|
|
|
|
"PREMIUM_DISCRIMINATOR",
|
|
|
|
"USED_DESKTOP_CLIENT",
|
|
|
|
"USED_WEB_CLIENT",
|
|
|
|
"USED_MOBILE_CLIENT",
|
|
|
|
"DISABLED",
|
|
|
|
undefined,
|
|
|
|
"VERIFIED_EMAIL", // end admin panel leak aug 2022
|
|
|
|
"QUARANTINED",
|
|
|
|
undefined,
|
|
|
|
undefined,
|
|
|
|
undefined,
|
|
|
|
undefined,
|
|
|
|
undefined,
|
|
|
|
"COLLABORATOR",
|
|
|
|
"RESTRICTED_COLLABORATOR",
|
|
|
|
];
|
|
|
|
|
2023-09-15 05:16:49 +00:00
|
|
|
// https://discord-userdoccers.vercel.app/resources/guild#guild-features
|
|
|
|
const GUILD_FEATURES = {
|
|
|
|
ACTIVITIES_ALPHA: {icon: "\u{1f680}"},
|
|
|
|
ACTIVITIES_EMPLOYEE: {icon: "\u{1f680}"},
|
|
|
|
ACTIVITIES_INTERNAL_DEV: {icon: "\u{1f680}"},
|
|
|
|
ANIMATED_BANNER: {icon: "\u{1f39e}"},
|
|
|
|
ANIMATED_ICON: {icon: "\u{1f39e}"},
|
|
|
|
APPLICATION_COMMAND_PERMISSIONS_V2: {icon: "\u2699\ufe0f"},
|
|
|
|
AUTO_MODERATION: {icon: "\u{1f6e1}"},
|
|
|
|
AUTOMOD_TRIGGER_USER_PROFILE: {icon: "\u{1faaa}"},
|
|
|
|
BANNER: {icon: "\u{1f5bc}"},
|
|
|
|
BFG: {icon: "\u{1f388}", name: "BFG"},
|
|
|
|
BOT_DEVELOPER_EARLY_ACCESS: {icon: "\u{1f9ea}"},
|
|
|
|
BURST_REACTIONS: {icon: "\u2728", name: "Super Reactions"},
|
|
|
|
CHANNEL_ICON_EMOJIS_GENERATED: {icon: "\u{1f603}"},
|
|
|
|
CHANNEL_HIGHLIGHTS: {icon: "\u{1f5c3}"},
|
|
|
|
CHANNEL_HIGHLIGHTS_DISABLED: {icon: "\u{1f6ab}"},
|
|
|
|
CLYDE_DISABLED: {icon: "\u{1f6ab}"},
|
|
|
|
CLYDE_ENABLED: {icon: "\u{1f916}"},
|
|
|
|
CLYDE_EXPERIMENT_ENABLED: {icon: "\u{1f9ea}"},
|
|
|
|
COMMUNITY: {icon: "\u{1f3d8}"},
|
|
|
|
COMMUNITY_CANARY: {icon: "\u{1f9ea}"},
|
|
|
|
COMMUNITY_EXP_LARGE_GATED: {icon: "\u{1f3d8}"},
|
|
|
|
COMMUNITY_EXP_LARGE_UNGATED: {icon: "\u{1f3d8}"},
|
|
|
|
COMMUNITY_EXP_MEDIUM: {icon: "\u{1f3d8}"},
|
|
|
|
CREATOR_ACCEPTED_NEW_TERMS: {icon: "\u2611\ufe0f"},
|
|
|
|
CREATOR_MONETIZABLE: {icon: "\u{1f4b0}"},
|
|
|
|
CREATOR_MONETIZABLE_DISABLED: {icon: "\u{1f6ab}"},
|
|
|
|
CREATOR_MONETIZABLE_PENDING_NEW_OWNER_ONBOARDING: {icon: "\u{1f4b1}"},
|
|
|
|
CREATOR_MONETIZABLE_PROVISIONAL: {icon: "\u{1f4b0}"},
|
|
|
|
CREATOR_MONETIZABLE_RESTRICTED: {icon: "\u26d4"},
|
|
|
|
CREATOR_MONETIZABLE_WHITEGLOVE: {icon: "\u{1f9ea}"},
|
|
|
|
CREATOR_MONETIZATION_APPLICATION_ALLOWLIST: {icon: "\u{1f4dc}"},
|
|
|
|
CREATOR_STORE_PAGE: {icon: "\u{1f6d2}"},
|
|
|
|
DEVELOPER_SUPPORT_SERVER: {icon: "\u2754"},
|
|
|
|
DISCOVERABLE: {icon: "\u{1f9ed}"},
|
|
|
|
DISCOVERABLE_DISABLED: {icon: "\u{1f6ab}"},
|
|
|
|
ENABLED_DISCOVERABLE_BEFORE: {icon: "\u{1f9ed}"},
|
|
|
|
EXPOSED_TO_ACTIVITIES_WTP_EXPERIMENT: {icon: "\u{1f9ea}"},
|
|
|
|
GUESTS_ENABLED: {icon: "\u{1f465}"},
|
|
|
|
GUILD_HOME_DEPRECATION_OVERRIDE: {icon: "\u{1f3da}"},
|
|
|
|
GUILD_HOME_OVERRIDE: {icon: "\u{1f3e0}"},
|
|
|
|
GUILD_HOME_TEST: {icon: "\u{1f9ea}"},
|
|
|
|
GUILD_MEMBER_VERIFICATION_EXPERIMENT: {icon: "\u{1f9ea}"},
|
|
|
|
GUILD_ONBOARDING: {icon: "\u{1f5f3}"},
|
|
|
|
GUILD_ONBOARDING_EVER_ENABLED: {icon: "\u{1f5f3}"},
|
|
|
|
GUILD_ONBOARDING_HAS_PROMPTS: {icon: "\u{1f5f3}"},
|
|
|
|
GUILD_PRODUCTS: {icon: "\u{1f6cd}"},
|
|
|
|
GUILD_SERVER_GUIDE: {icon: "\u{1f9ae}"},
|
|
|
|
GUILD_WEB_PAGE_VANITY_URL: {icon: "\u{1f4c4}"},
|
|
|
|
HAD_EARLY_ACTIVITIES_ACCESS: {icon: "\u{1f680}"},
|
|
|
|
HAS_DIRECTORY_ENTRY: {icon: "\u{1faa7}"},
|
|
|
|
HIDE_FROM_EXPERIMENT_UI: {icon: "\u{1f9ea}"},
|
|
|
|
HUB: {icon: "\u{1f3eb}"},
|
|
|
|
INCREASED_THREAD_LIMIT: {icon: "\u{1f9f5}"},
|
|
|
|
INTERNAL_EMPLOYEE_ONLY: {icon: "\u{1f6e0}"},
|
|
|
|
INVITE_SPLASH: {icon: "\u{1f5bc}"},
|
|
|
|
INVITES_DISABLED: {icon: "\u26d4"},
|
|
|
|
LINKED_TO_HUB: {icon: "\u{1f3eb}"},
|
|
|
|
MEMBER_SAFETY_PAGE_ROLLOUT: {icon: "\u{1f6e1}"},
|
|
|
|
MEMBER_VERIFICATION_GATE_ENABLED: {icon: "\u{1f6e1}"},
|
|
|
|
MEMBER_VERIFICATION_MANUAL_APPROVAL: {icon: "\u2705"},
|
|
|
|
MORE_EMOJI: {icon: "\u{1f603}"},
|
|
|
|
MORE_STICKERS: {icon: "\u{1f5bc}"},
|
|
|
|
NEWS: {icon: "\u{1f4f0}"},
|
|
|
|
NON_COMMUNITY_RAID_ALERTS: {icon: "\u{1f6a8}"},
|
|
|
|
PARTNERED: {icon: "\u267e\ufe0f"},
|
|
|
|
PREMIUM_TIER_3_OVERRIDE: {icon: "\u{1f48e}"},
|
|
|
|
PREVIEW_ENABLED: {icon: "\u{1f441}"},
|
|
|
|
PRODUCTS_AVAILABLE_FOR_PURCHASE: {icon: "\u{1f6cd}"},
|
|
|
|
RAID_ALERTS_DISABLED: {icon: "\u{1f6ab}"},
|
|
|
|
RELAY_ENABLED: {icon: "\u{1f4fb}"},
|
|
|
|
ROLE_ICONS: {icon: "\u{1f3f7}"},
|
|
|
|
ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE: {icon: "\u{1f4b3}"},
|
|
|
|
ROLE_SUBSCRIPTIONS_ENABLED: {icon: "\u{1f4b3}"},
|
|
|
|
SHARD: {icon: "\u{1f4a0}"},
|
|
|
|
SHARED_CANVAS_FRIENDS_AND_FAMILY_TEST: {icon: "\u{1f58c}"},
|
|
|
|
SOUNDBOARD: {icon: "\u{1f50a}"},
|
|
|
|
SUMMARIES_ENABLED: {icon: "\u{1f4da}"},
|
|
|
|
SUMMARIES_ENABLED_GA: {
|
|
|
|
icon: "\u{1f4da}",
|
|
|
|
name: "Summaries Enabled (General Access)",
|
|
|
|
},
|
|
|
|
SUMMARIES_DISABLED_BY_USER: {icon: "\u26d4"},
|
|
|
|
SUMMARIES_ENABLED_BY_USER: {icon: "\u{1f4da}"},
|
|
|
|
SUMMARIES_LONG_LOOKBACK: {icon: "\u{1f5c2}"},
|
|
|
|
STAFF_LEVEL_COLLABORATOR_REQUIRED: {icon: "\u{1f6e0}"},
|
|
|
|
STAFF_LEVEL_RESTRICTED_COLLABORATOR_REQUIRED: {icon: "\u{1f6e0}"},
|
|
|
|
THREAD_DEFAULT_AUTO_ARCHIVE_DURATION: {icon: "\u{1f9f5}"},
|
|
|
|
VANITY_URL: {icon: "\u{1f517}"},
|
|
|
|
VERIFIED: {icon: "\u2b50"},
|
|
|
|
VIP_REGIONS: {icon: "\u{1f399}"},
|
|
|
|
VOICE_IN_THREADS: {icon: "\u{1f399}"},
|
|
|
|
WELCOME_SCREEN_ENABLED: {icon: "\u{1f44b}"},
|
|
|
|
};
|
|
|
|
|
2021-08-12 03:31:56 +00:00
|
|
|
const EMOJI_SETS = {
|
|
|
|
blobs: {
|
|
|
|
prefix:
|
|
|
|
"https://cdn.jsdelivr.net/gh/googlefonts/noto-emoji@e456654119cc3a5f9bebb7bbd00512456f983d2d/svg/emoji_u",
|
|
|
|
sep: "_",
|
|
|
|
suffix: ".svg",
|
|
|
|
},
|
|
|
|
noto: {
|
2022-10-23 01:22:03 +00:00
|
|
|
prefix: "https://gitcdn.xyz/repo/googlefonts/noto-emoji/master/svg/emoji_u",
|
2021-08-12 03:31:56 +00:00
|
|
|
sep: "_",
|
|
|
|
suffix: ".svg",
|
|
|
|
},
|
|
|
|
twemoji: {
|
|
|
|
prefix: "https://twemoji.maxcdn.com/v/latest/svg/",
|
|
|
|
sep: "-",
|
|
|
|
suffix: ".svg",
|
|
|
|
},
|
|
|
|
mustd: {
|
|
|
|
prefix:
|
|
|
|
"https://cdn.jsdelivr.net/gh/Mstrodl/mutant-standard-mirror@0435227d9d8c0d6a346c8ae4c12b08a5cdc37041/emoji/",
|
|
|
|
sep: "-",
|
|
|
|
suffix: ".svg",
|
|
|
|
},
|
|
|
|
apple: {
|
|
|
|
prefix: "https://intrnl.github.io/assetsEmoji/AppleColor/emoji_u",
|
|
|
|
sep: "_",
|
|
|
|
suffix: ".png",
|
|
|
|
},
|
|
|
|
facebook: {
|
|
|
|
prefix: "https://intrnl.github.io/assetsEmoji/facebook/emoji_u",
|
|
|
|
sep: "_",
|
|
|
|
suffix: ".png",
|
|
|
|
},
|
|
|
|
};
|
|
|
|
EMOJI_SETS["noto-old"] = EMOJI_SETS.blobs;
|
|
|
|
EMOJI_SETS.mutant = EMOJI_SETS.mustd;
|
|
|
|
EMOJI_SETS.mutstd = EMOJI_SETS.mustd;
|
|
|
|
EMOJI_SETS.ms = EMOJI_SETS.mustd;
|
|
|
|
EMOJI_SETS.twitter = EMOJI_SETS.twemoji;
|
|
|
|
EMOJI_SETS.fb = EMOJI_SETS.facebook;
|
|
|
|
|
2023-09-15 02:57:22 +00:00
|
|
|
// }}}
|
|
|
|
|
|
|
|
// {{{ commands
|
2023-03-25 19:40:53 +00:00
|
|
|
|
2021-06-02 00:31:39 +00:00
|
|
|
const avatar = new Command("avatar");
|
|
|
|
avatar.category = CATEGORY;
|
|
|
|
avatar.helpText = "Get avatar of a user";
|
|
|
|
avatar.usage = "<user>";
|
2023-05-30 01:51:50 +00:00
|
|
|
avatar.callback = async function (msg, line, [user], {server, guild}) {
|
2022-11-30 01:15:41 +00:00
|
|
|
if (server || guild) {
|
2021-08-30 18:01:33 +00:00
|
|
|
if (!msg.guildID) {
|
2021-06-02 00:31:39 +00:00
|
|
|
return "`--server/--guild` can only be used within guilds.";
|
|
|
|
} else {
|
2021-08-30 18:01:33 +00:00
|
|
|
const guild = msg.channel.guild || hf.bot.guilds.get(msg.guildID);
|
2023-05-30 01:51:50 +00:00
|
|
|
const url = `${ICON_BASE}${guild.id}/${guild.icon}.${
|
|
|
|
guild.icon.startsWith("a_") ? "gif?size=1024&_=.gif" : "png?size=1024"
|
|
|
|
}`;
|
2021-06-02 00:31:39 +00:00
|
|
|
return {
|
2021-08-30 02:04:26 +00:00
|
|
|
embeds: [
|
|
|
|
{
|
|
|
|
title: "Server Icon",
|
2021-06-02 00:31:39 +00:00
|
|
|
url,
|
2021-08-30 02:04:26 +00:00
|
|
|
image: {
|
|
|
|
url,
|
|
|
|
},
|
2021-06-02 00:31:39 +00:00
|
|
|
},
|
2021-08-30 02:04:26 +00:00
|
|
|
],
|
2021-06-02 00:31:39 +00:00
|
|
|
};
|
|
|
|
}
|
2022-11-30 01:15:41 +00:00
|
|
|
} else if (user) {
|
|
|
|
const lookup = await lookupUser(msg, user);
|
2021-06-02 00:31:39 +00:00
|
|
|
if (
|
2022-11-30 01:15:41 +00:00
|
|
|
lookup == "No results" ||
|
|
|
|
lookup == "Canceled" ||
|
|
|
|
lookup == "Request timed out"
|
2021-06-02 00:31:39 +00:00
|
|
|
) {
|
2022-11-30 01:15:41 +00:00
|
|
|
return lookup;
|
2021-06-02 00:31:39 +00:00
|
|
|
} else {
|
2022-11-30 01:15:41 +00:00
|
|
|
let member = lookup;
|
2021-08-30 18:01:33 +00:00
|
|
|
const guild = msg.channel.guild || hf.bot.guilds.get(msg.guildID);
|
|
|
|
if (guild) {
|
2022-11-30 01:15:41 +00:00
|
|
|
if (guild.members.has(lookup.id)) {
|
|
|
|
member = guild.members.get(lookup.id);
|
2021-08-30 02:12:56 +00:00
|
|
|
} else {
|
2021-08-30 18:01:33 +00:00
|
|
|
const fetched = await guild.fetchMembers({
|
2022-11-30 01:15:41 +00:00
|
|
|
userIDs: [lookup.id],
|
2021-08-30 02:12:56 +00:00
|
|
|
});
|
|
|
|
member = fetched[0];
|
|
|
|
}
|
|
|
|
}
|
2022-04-03 16:37:26 +00:00
|
|
|
|
|
|
|
const baseEmbed = {
|
2023-09-15 03:09:20 +00:00
|
|
|
title: `Avatar for \`${pomello(member)}\``,
|
2022-04-03 16:37:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const normalAvatar = member.user.avatar;
|
|
|
|
const guildAvatar = member.avatar;
|
|
|
|
|
|
|
|
const normalUrl =
|
|
|
|
AVATAR_BASE +
|
|
|
|
member.id +
|
|
|
|
"/" +
|
|
|
|
normalAvatar +
|
|
|
|
"." +
|
2022-04-03 16:40:19 +00:00
|
|
|
(normalAvatar.startsWith("a_")
|
2022-04-03 16:37:26 +00:00
|
|
|
? "gif?size=1024&_=.gif"
|
2022-04-03 16:40:19 +00:00
|
|
|
: "png?size=1024");
|
2022-04-03 16:37:26 +00:00
|
|
|
const guildUrl =
|
2022-04-03 16:42:05 +00:00
|
|
|
guildAvatar &&
|
2022-04-03 16:37:26 +00:00
|
|
|
"https://cdn.discordapp.com/guilds/" +
|
2023-05-30 01:51:50 +00:00
|
|
|
guild.id +
|
|
|
|
"/users/" +
|
|
|
|
member.id +
|
|
|
|
"/avatars/" +
|
|
|
|
guildAvatar +
|
|
|
|
"." +
|
|
|
|
(guildAvatar.startsWith("a_")
|
|
|
|
? "gif?size=1024&_=.gif"
|
|
|
|
: "png?size=1024");
|
2022-04-03 16:37:26 +00:00
|
|
|
|
|
|
|
baseEmbed.description =
|
|
|
|
`[Normal avatar](${normalUrl})` +
|
|
|
|
(guild && guildAvatar ? `\n[Guild avatar](${guildUrl})` : "");
|
2022-04-03 16:53:40 +00:00
|
|
|
baseEmbed.url = normalUrl;
|
2022-04-03 16:37:26 +00:00
|
|
|
|
2023-05-30 01:51:50 +00:00
|
|
|
const guildEmbed = {...baseEmbed};
|
|
|
|
baseEmbed.image = {url: normalUrl};
|
|
|
|
guildEmbed.image = {url: guildUrl};
|
2022-04-03 16:37:26 +00:00
|
|
|
|
2021-06-02 00:31:39 +00:00
|
|
|
return {
|
2022-04-03 16:44:11 +00:00
|
|
|
embeds: [baseEmbed, guildAvatar && guildEmbed].filter((x) => x != null),
|
2021-06-02 00:31:39 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
} else {
|
2021-08-30 18:01:33 +00:00
|
|
|
const guild = msg.channel.guild || hf.bot.guilds.get(msg.guildID);
|
2022-04-03 16:40:19 +00:00
|
|
|
|
|
|
|
const baseEmbed = {
|
2023-09-15 03:09:20 +00:00
|
|
|
title: `Avatar for \`${pomello(msg.author)}\``,
|
2022-04-03 16:40:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const normalAvatar = msg.author.avatar;
|
|
|
|
const guildAvatar = msg.member?.avatar;
|
|
|
|
|
|
|
|
const normalUrl =
|
|
|
|
AVATAR_BASE +
|
|
|
|
msg.author.id +
|
|
|
|
"/" +
|
|
|
|
normalAvatar +
|
|
|
|
"." +
|
|
|
|
(normalAvatar.startsWith("a_")
|
|
|
|
? "gif?size=1024&_=.gif"
|
|
|
|
: "png?size=1024");
|
|
|
|
const guildUrl =
|
2022-04-03 16:42:05 +00:00
|
|
|
guildAvatar &&
|
2022-04-03 16:40:19 +00:00
|
|
|
"https://cdn.discordapp.com/guilds/" +
|
2023-05-30 01:51:50 +00:00
|
|
|
guild.id +
|
|
|
|
"/users/" +
|
|
|
|
msg.author.id +
|
|
|
|
"/avatars/" +
|
|
|
|
guildAvatar +
|
|
|
|
"." +
|
|
|
|
(guildAvatar.startsWith("a_")
|
|
|
|
? "gif?size=1024&_=.gif"
|
|
|
|
: "png?size=1024");
|
2022-04-03 16:40:19 +00:00
|
|
|
|
|
|
|
baseEmbed.description =
|
|
|
|
`[Normal avatar](${normalUrl})` +
|
|
|
|
(guild && guildAvatar ? `\n[Guild avatar](${guildUrl})` : "");
|
2022-04-05 16:55:05 +00:00
|
|
|
baseEmbed.url = normalUrl;
|
2022-04-03 16:40:19 +00:00
|
|
|
|
2023-05-30 01:51:50 +00:00
|
|
|
const guildEmbed = {...baseEmbed};
|
|
|
|
baseEmbed.image = {url: normalUrl};
|
|
|
|
guildEmbed.image = {url: guildUrl};
|
2022-04-03 16:40:19 +00:00
|
|
|
|
2021-06-02 00:31:39 +00:00
|
|
|
return {
|
2022-04-03 16:44:11 +00:00
|
|
|
embeds: [baseEmbed, guildAvatar && guildEmbed].filter((x) => x != null),
|
2021-06-02 00:31:39 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
};
|
|
|
|
hf.registerCommand(avatar);
|
2021-06-02 00:58:39 +00:00
|
|
|
|
2021-07-28 17:56:27 +00:00
|
|
|
const banner = new Command("banner");
|
|
|
|
banner.category = CATEGORY;
|
|
|
|
banner.helpText = "Get banner of a user";
|
|
|
|
banner.usage = "<user>";
|
2023-05-30 01:51:50 +00:00
|
|
|
banner.callback = async function (msg, line, [user], {server, guild}) {
|
2021-07-28 17:56:27 +00:00
|
|
|
let id = msg.author.id;
|
|
|
|
|
2022-11-30 01:15:41 +00:00
|
|
|
if (server || guild) {
|
2021-08-30 18:01:33 +00:00
|
|
|
if (!msg.guildID) {
|
2021-08-26 17:18:50 +00:00
|
|
|
return "`--server/--guild` can only be used within guilds.";
|
|
|
|
} else {
|
2021-08-30 18:01:33 +00:00
|
|
|
const guild = msg.channel.guild || hf.bot.guilds.get(msg.guildID);
|
2021-08-31 15:49:21 +00:00
|
|
|
|
|
|
|
if (!guild.banner) return "This guild does not have a banner.";
|
|
|
|
|
2023-05-30 01:51:50 +00:00
|
|
|
const url = `${BANNER_BASE}${guild.id}/${guild.banner}.${
|
|
|
|
guild.banner.startsWith("a_") ? "gif?size=1024&_=.gif" : "png?size=1024"
|
|
|
|
}`;
|
2021-08-26 17:18:50 +00:00
|
|
|
return {
|
2021-08-30 02:04:26 +00:00
|
|
|
embeds: [
|
|
|
|
{
|
|
|
|
title: "Server Banner",
|
2021-08-26 17:18:50 +00:00
|
|
|
url,
|
2021-08-30 02:04:26 +00:00
|
|
|
image: {
|
|
|
|
url,
|
|
|
|
},
|
2021-08-26 17:18:50 +00:00
|
|
|
},
|
2021-08-30 02:04:26 +00:00
|
|
|
],
|
2021-08-26 17:18:50 +00:00
|
|
|
};
|
|
|
|
}
|
2022-11-30 01:15:41 +00:00
|
|
|
} else if (user) {
|
|
|
|
const lookup = await lookupUser(msg, user);
|
2021-07-28 17:56:27 +00:00
|
|
|
if (
|
|
|
|
lookup == "No results" ||
|
|
|
|
lookup == "Canceled" ||
|
|
|
|
lookup == "Request timed out"
|
|
|
|
) {
|
|
|
|
return lookup;
|
|
|
|
} else {
|
|
|
|
id = lookup.id;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-02-17 19:36:27 +00:00
|
|
|
const userObj = await hf.bot.requestHandler.request(
|
|
|
|
"GET",
|
|
|
|
"/users/" + id,
|
|
|
|
true
|
|
|
|
);
|
2021-07-28 17:56:27 +00:00
|
|
|
|
2022-11-30 02:36:17 +00:00
|
|
|
if (!userObj.banner) return "This user does not have a banner.";
|
2021-07-28 17:56:27 +00:00
|
|
|
|
2023-05-30 01:51:50 +00:00
|
|
|
const url = `${BANNER_BASE}${userObj.id}/${userObj.banner}.${
|
|
|
|
userObj.banner.startsWith("a_") ? "gif?size=1024&_=.gif" : "png?size=1024"
|
|
|
|
}`;
|
2021-07-28 17:56:27 +00:00
|
|
|
return {
|
2021-08-30 02:04:26 +00:00
|
|
|
embeds: [
|
|
|
|
{
|
2023-09-15 03:09:20 +00:00
|
|
|
title: `Banner for \`${pomello(userObj)}\``,
|
2021-07-28 17:56:27 +00:00
|
|
|
url,
|
2021-08-30 02:04:26 +00:00
|
|
|
image: {
|
|
|
|
url,
|
|
|
|
},
|
2021-07-28 17:56:27 +00:00
|
|
|
},
|
2021-08-30 02:04:26 +00:00
|
|
|
],
|
2021-07-28 17:56:27 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
hf.registerCommand(banner);
|
|
|
|
|
2021-06-02 00:58:39 +00:00
|
|
|
const lookupinvite = new Command("lookupinvite");
|
|
|
|
lookupinvite.category = CATEGORY;
|
|
|
|
lookupinvite.helpText = "Lookup an invite";
|
|
|
|
lookupinvite.usage = "<invite code>";
|
|
|
|
lookupinvite.addAlias("linvite");
|
2023-05-30 01:51:50 +00:00
|
|
|
lookupinvite.callback = async function (msg, line) {
|
2023-01-27 05:52:40 +00:00
|
|
|
if (!line || line == "") {
|
2021-06-02 00:58:39 +00:00
|
|
|
return "No arguments passed.";
|
|
|
|
}
|
|
|
|
|
2023-01-27 05:54:33 +00:00
|
|
|
line = line.replace(/(https?:\/\/)?discord\.gg\//, "");
|
|
|
|
|
2023-01-27 06:02:24 +00:00
|
|
|
let bail = false;
|
|
|
|
let error;
|
|
|
|
let invite;
|
|
|
|
try {
|
|
|
|
invite = await hf.bot.requestHandler.request(
|
|
|
|
"GET",
|
2023-04-09 17:22:27 +00:00
|
|
|
`/invites/${line}?with_counts=true&with_expiration=true`
|
2023-01-27 06:02:24 +00:00
|
|
|
);
|
|
|
|
} catch (err) {
|
|
|
|
bail = true;
|
|
|
|
error = err;
|
|
|
|
}
|
|
|
|
if (bail && error) {
|
|
|
|
if (error.message.includes("Unknown Invite")) {
|
|
|
|
return "Invite provided is not valid.";
|
|
|
|
} else {
|
|
|
|
return `:warning: Got error \`${safeString(error)}\``;
|
|
|
|
}
|
|
|
|
}
|
2021-06-02 00:58:39 +00:00
|
|
|
if (!invite) return ":warning: No data returned.";
|
|
|
|
|
|
|
|
if (invite.message) {
|
|
|
|
if (invite.message == "Unknown Invite") {
|
|
|
|
return "Invite provided is not valid.";
|
|
|
|
} else {
|
|
|
|
return `:warning: Got error \`${invite.code}: "${invite.message}"\``;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
const embed = {
|
|
|
|
title: `Invite Info: \`${invite.code}\``,
|
|
|
|
description: invite.description,
|
2023-05-30 01:51:50 +00:00
|
|
|
fields: [],
|
|
|
|
};
|
|
|
|
|
|
|
|
const expires = {
|
|
|
|
name: "Expires",
|
|
|
|
value:
|
|
|
|
invite.expires_at == null
|
|
|
|
? "Never"
|
|
|
|
: `<t:${Math.floor(new Date(invite.expires_at).getTime() / 1000)}>`,
|
|
|
|
inline: true,
|
|
|
|
};
|
2023-06-07 16:25:55 +00:00
|
|
|
const inviter = invite.inviter
|
|
|
|
? {
|
|
|
|
name: "Inviter",
|
2023-09-15 03:09:20 +00:00
|
|
|
value: `**${pomello(invite.inviter)}** (${invite.inviter.id})`,
|
2023-06-07 16:25:55 +00:00
|
|
|
inline: false,
|
|
|
|
}
|
|
|
|
: null;
|
2023-05-30 01:51:50 +00:00
|
|
|
|
2023-09-15 05:22:27 +00:00
|
|
|
const features = invite.guild.features.sort().map(
|
2023-09-15 05:18:01 +00:00
|
|
|
(feature) =>
|
|
|
|
(GUILD_FEATURES[feature]?.icon ?? "\u2753") +
|
|
|
|
" " +
|
|
|
|
(GUILD_FEATURES[feature]?.name ??
|
|
|
|
feature
|
|
|
|
.split("_")
|
|
|
|
.map((x) => x[0] + x.substring(1).toLowerCase())
|
|
|
|
.join(" "))
|
|
|
|
);
|
2023-09-15 05:16:49 +00:00
|
|
|
|
2023-05-30 01:51:50 +00:00
|
|
|
if (invite.type == 0) {
|
|
|
|
embed.fields.push(
|
|
|
|
...[
|
|
|
|
{
|
|
|
|
name: "Guild",
|
|
|
|
value: `**${invite.guild.name}** (${invite.guild.id})`,
|
|
|
|
inline: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "Channel",
|
|
|
|
value: `**${invite.channel.name}** (${invite.channel.id})`,
|
|
|
|
inline: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "Boosts",
|
|
|
|
value: invite.guild.premium_subscription_count ?? 0,
|
|
|
|
inline: true,
|
|
|
|
},
|
|
|
|
expires,
|
2023-09-15 05:16:49 +00:00
|
|
|
{
|
|
|
|
name: "Member Count",
|
2023-09-15 05:22:27 +00:00
|
|
|
value: `<:online:1152111668856361010>${invite.approximate_presence_count} online\t\t<:offline:1152111682886316042>${invite.approximate_member_count} members`,
|
2023-09-15 05:16:49 +00:00
|
|
|
inline: false,
|
|
|
|
},
|
2023-05-30 02:27:43 +00:00
|
|
|
inviter,
|
2023-05-30 01:51:50 +00:00
|
|
|
invite.guild.welcome_screen && {
|
|
|
|
name: "Welcome Screen",
|
|
|
|
value: `"${
|
|
|
|
invite.guild.welcome_screen.description
|
2023-05-27 17:35:59 +00:00
|
|
|
}"\n${invite.guild.welcome_screen.welcome_channels
|
|
|
|
.map(
|
|
|
|
(c) =>
|
2023-05-30 01:51:50 +00:00
|
|
|
`${
|
|
|
|
c.emoji_id
|
|
|
|
? `[:${c.emoji_name}:](${EMOTE_BASE}${c.emoji_id}.webp)`
|
|
|
|
: c.emoji_name
|
2023-05-27 17:35:59 +00:00
|
|
|
} ${c.description} \`(${c.channel_id})\``
|
|
|
|
)
|
|
|
|
.join("\n")}`,
|
2023-05-30 01:51:50 +00:00
|
|
|
inline: false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "Features",
|
|
|
|
value:
|
2023-09-15 05:16:49 +00:00
|
|
|
features.length > 0
|
2023-09-15 05:22:27 +00:00
|
|
|
? features.slice(0, Math.ceil(features.length / 2)).join("\n")
|
2023-05-30 01:51:50 +00:00
|
|
|
: "None",
|
2023-09-15 05:16:49 +00:00
|
|
|
inline: true,
|
2023-05-30 01:51:50 +00:00
|
|
|
},
|
2023-09-15 05:16:49 +00:00
|
|
|
features.length > 1
|
|
|
|
? {
|
|
|
|
name: "\u200b",
|
2023-09-15 05:18:01 +00:00
|
|
|
value: features
|
2023-09-15 05:22:27 +00:00
|
|
|
.slice(Math.ceil(features.length / 2), features.length)
|
2023-09-15 05:18:01 +00:00
|
|
|
.join("\n"),
|
2023-09-15 05:16:49 +00:00
|
|
|
inline: true,
|
|
|
|
}
|
|
|
|
: null,
|
2023-05-30 01:51:50 +00:00
|
|
|
].filter((x) => !!x)
|
|
|
|
);
|
2023-05-30 02:07:21 +00:00
|
|
|
embed.thumbnail = {
|
|
|
|
url:
|
|
|
|
invite.guild.icon &&
|
|
|
|
`${ICON_BASE}${invite.guild.id}/${invite.guild.icon}.${
|
|
|
|
invite.guild.icon.startsWith("a_")
|
|
|
|
? "gif?size=1024&_=.gif"
|
|
|
|
: "png?size=1024"
|
|
|
|
}`,
|
|
|
|
};
|
2023-05-30 02:27:43 +00:00
|
|
|
|
|
|
|
if (
|
|
|
|
invite.guild &&
|
|
|
|
(invite.guild.icon || invite.guild.splash || invite.guild.banner)
|
|
|
|
) {
|
|
|
|
embed.fields.push({
|
|
|
|
name: "\u200b",
|
|
|
|
value: `${
|
|
|
|
invite.guild.icon
|
|
|
|
? `[Icon](${ICON_BASE}${invite.guild.id}/${invite.guild.icon}.${
|
|
|
|
invite.guild.icon.startsWith("a_")
|
|
|
|
? "gif?size=1024"
|
|
|
|
: "png?size=1024"
|
|
|
|
})`
|
|
|
|
: ""
|
|
|
|
}${
|
|
|
|
invite.guild.splash
|
|
|
|
? `${invite.guild.icon ? " | " : ""}[Splash](${SPLASH_BASE}${
|
|
|
|
invite.guild.id
|
|
|
|
}/${invite.guild.splash}.png?size=2048)`
|
|
|
|
: ""
|
|
|
|
}${
|
|
|
|
invite.guild.banner
|
|
|
|
? `${
|
|
|
|
invite.guild.icon || invite.guild.splash ? " | " : ""
|
|
|
|
}[Banner](${BANNER_BASE}${invite.guild.id}/${
|
|
|
|
invite.guild.banner
|
|
|
|
}.${
|
|
|
|
invite.guild.banner.startsWith("a_")
|
|
|
|
? "gif?size=1024"
|
|
|
|
: "png?size=1024"
|
|
|
|
})`
|
|
|
|
: ""
|
|
|
|
}`,
|
|
|
|
inline: false,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
if (invite.guild?.splash) {
|
|
|
|
embed.image = {
|
|
|
|
url: `${SPLASH_BASE}${invite.guild.id}/${invite.guild.splash}.png?size=256`,
|
|
|
|
};
|
|
|
|
}
|
2023-05-30 01:51:50 +00:00
|
|
|
} else if (invite.type == 1) {
|
|
|
|
embed.title += " (Group DM)";
|
|
|
|
embed.fields.push(
|
2023-05-30 02:33:52 +00:00
|
|
|
...[
|
|
|
|
{
|
|
|
|
name: "Channel",
|
|
|
|
value: `**${
|
|
|
|
invite.channel.name ??
|
|
|
|
invite.channel.recipients
|
|
|
|
.map((member) => member.username)
|
|
|
|
.join(", ")
|
|
|
|
}** (${invite.channel.id})`,
|
|
|
|
inline: false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "Member Count",
|
2023-09-15 05:22:27 +00:00
|
|
|
value: `<:offline:1152111682886316042>${invite.approximate_member_count} members`,
|
2023-05-30 02:33:52 +00:00
|
|
|
inline: true,
|
|
|
|
},
|
2023-05-30 02:35:40 +00:00
|
|
|
expires,
|
2023-05-30 02:34:46 +00:00
|
|
|
invite.channel.name != null && {
|
2023-05-30 02:33:52 +00:00
|
|
|
name: "Recipients",
|
|
|
|
value: invite.channel.recipients
|
2023-05-30 02:16:36 +00:00
|
|
|
.map((member) => member.username)
|
2023-05-30 02:33:52 +00:00
|
|
|
.join(", "),
|
|
|
|
inline: false,
|
|
|
|
},
|
|
|
|
inviter,
|
|
|
|
].filter((x) => !!x)
|
2023-05-30 01:51:50 +00:00
|
|
|
);
|
2023-05-30 02:27:43 +00:00
|
|
|
|
|
|
|
const groupIcon = invite.channel.icon
|
|
|
|
? `${CHANNEL_ICON_BASE}${invite.channel.id}/${invite.channel.icon}.${
|
|
|
|
invite.channel.icon.startsWith("a_")
|
2023-05-30 02:07:21 +00:00
|
|
|
? "gif?size=1024&_=.gif"
|
|
|
|
: "png?size=1024"
|
2023-05-30 02:27:43 +00:00
|
|
|
}`
|
|
|
|
: "https://discord.com" +
|
|
|
|
DEFAULT_GROUP_DM_AVATARS[
|
|
|
|
(Math.floor(Number(invite.channel.id) / Math.pow(2, 22)) +
|
|
|
|
1420070400000) %
|
|
|
|
DEFAULT_GROUP_DM_AVATARS.length
|
|
|
|
];
|
2021-06-02 00:58:39 +00:00
|
|
|
|
2023-05-30 02:27:43 +00:00
|
|
|
embed.thumbnail = {
|
|
|
|
url: groupIcon,
|
|
|
|
};
|
2021-06-02 00:58:39 +00:00
|
|
|
embed.fields.push({
|
|
|
|
name: "\u200b",
|
2023-05-30 02:27:43 +00:00
|
|
|
value: `[Icon](${groupIcon})`,
|
2021-06-02 00:58:39 +00:00
|
|
|
inline: false,
|
|
|
|
});
|
2023-05-30 02:27:43 +00:00
|
|
|
} else if (invite.type == 2) {
|
|
|
|
embed.title += " (Friend)";
|
|
|
|
embed.fields.push(expires, inviter);
|
2021-06-02 00:58:39 +00:00
|
|
|
|
2023-05-30 02:27:43 +00:00
|
|
|
const avatarURL =
|
|
|
|
invite.inviter?.avatar &&
|
|
|
|
`${AVATAR_BASE}${invite.inviter.id}/${invite.inviter.avatar}.${
|
|
|
|
invite.inviter.avatar.startsWith("a_")
|
|
|
|
? "gif?size=1024&_=.gif"
|
|
|
|
: "png?size=1024"
|
|
|
|
}`;
|
|
|
|
|
|
|
|
if (avatarURL) {
|
|
|
|
embed.thumbnail = {
|
|
|
|
url: avatarURL,
|
|
|
|
};
|
|
|
|
embed.fields.push({
|
|
|
|
name: "\u200b",
|
|
|
|
value: `[Avatar](${avatarURL})`,
|
|
|
|
inline: false,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
return `Unhandled invite type: \`${invite.type}\``;
|
2021-06-02 00:58:39 +00:00
|
|
|
}
|
|
|
|
|
2023-05-30 01:51:50 +00:00
|
|
|
return {embed};
|
2021-06-02 00:58:39 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
hf.registerCommand(lookupinvite);
|
2021-06-11 03:54:17 +00:00
|
|
|
|
|
|
|
const snowflake = new Command("snowflake");
|
|
|
|
snowflake.category = CATEGORY;
|
|
|
|
snowflake.helpText = "Converts a snowflake ID into readable time.";
|
|
|
|
snowflake.usage = "<--twitter> [snowflake]";
|
2023-05-30 01:51:50 +00:00
|
|
|
snowflake.callback = function (msg, line, [snowflake], {twitter}) {
|
2022-11-30 01:15:41 +00:00
|
|
|
const num = parseInt(snowflake);
|
2021-06-11 03:54:17 +00:00
|
|
|
if (!isNaN(num)) {
|
|
|
|
let binary = num.toString(2);
|
|
|
|
binary = "0".repeat(64 - binary.length) + binary;
|
|
|
|
const timestamp =
|
|
|
|
parseInt(binary.substr(0, 42), 2) +
|
|
|
|
(twitter ? 1288834974657 : 1420070400000);
|
|
|
|
|
2022-11-30 01:15:41 +00:00
|
|
|
return `The timestamp for \`${snowflake}\` is <t:${Math.floor(
|
|
|
|
timestamp / 1000
|
|
|
|
)}:F>`;
|
2021-06-11 03:54:17 +00:00
|
|
|
} else {
|
|
|
|
return "Argument provided is not a number.";
|
|
|
|
}
|
|
|
|
};
|
|
|
|
hf.registerCommand(snowflake);
|
2021-06-22 04:22:32 +00:00
|
|
|
|
2021-06-22 04:35:04 +00:00
|
|
|
function flagFromInt(int) {
|
|
|
|
const bits = int.toString(2);
|
|
|
|
const splitBits = bits.split("").reverse();
|
2021-06-22 04:22:32 +00:00
|
|
|
|
2021-06-22 04:35:04 +00:00
|
|
|
const reassignedBits = {};
|
2021-06-22 04:22:32 +00:00
|
|
|
|
2021-06-22 04:35:04 +00:00
|
|
|
for (const shift in splitBits) {
|
|
|
|
reassignedBits[shift] = splitBits[shift];
|
|
|
|
}
|
2021-06-22 04:22:32 +00:00
|
|
|
|
2021-06-22 04:35:04 +00:00
|
|
|
const flags = Object.keys(reassignedBits).filter(
|
|
|
|
(bit) => reassignedBits[bit] == 1
|
|
|
|
);
|
2021-06-22 04:22:32 +00:00
|
|
|
|
2021-06-22 04:35:04 +00:00
|
|
|
let out = "";
|
|
|
|
|
|
|
|
for (const flag of flags) {
|
|
|
|
out +=
|
|
|
|
(USER_FLAGS[flag] || "<Undocumented Flag>") +
|
|
|
|
` (1 << ${flag}, ${1n << BigInt(flag)})\n`;
|
|
|
|
}
|
2021-06-22 04:22:32 +00:00
|
|
|
|
2021-06-22 04:35:04 +00:00
|
|
|
return out;
|
|
|
|
}
|
|
|
|
|
|
|
|
const flagdump = new Command("flagdump");
|
|
|
|
flagdump.category = CATEGORY;
|
|
|
|
flagdump.helpText = "Dumps Discord user flags.";
|
|
|
|
flagdump.usage = "[flags or user mention]";
|
2023-05-30 01:51:50 +00:00
|
|
|
flagdump.callback = async function (msg, line, [numOrMention], {id, list}) {
|
2022-11-30 01:15:41 +00:00
|
|
|
const num = Number(numOrMention);
|
2023-05-27 17:35:59 +00:00
|
|
|
if (list) {
|
|
|
|
let allFlags = 0n;
|
|
|
|
for (const index in USER_FLAGS) {
|
|
|
|
if (USER_FLAGS[index] == undefined) continue;
|
|
|
|
allFlags += 1n << BigInt(index);
|
|
|
|
}
|
|
|
|
return `All flags:\n\`\`\`${flagFromInt(allFlags)}\`\`\``;
|
|
|
|
} else if (/<@!?(\d+)>/.test(numOrMention) || !isNaN(id)) {
|
2022-11-30 01:15:41 +00:00
|
|
|
const targetId = id || numOrMention.match(/<@!?(\d+)>/)?.[1];
|
|
|
|
if (!targetId) return "Got null ID.";
|
2021-08-30 18:01:33 +00:00
|
|
|
const guild = msg.channel.guild || hf.bot.guilds.get(msg.guildID);
|
2023-05-30 01:51:50 +00:00
|
|
|
let user = guild && (await guild.fetchMembers({userIDs: [targetId]}));
|
2021-08-30 18:01:33 +00:00
|
|
|
if (!user || !user[0]) {
|
2021-06-22 04:35:04 +00:00
|
|
|
user = hf.bot.users.get(id);
|
|
|
|
} else {
|
|
|
|
user = user[0].user;
|
2021-06-22 04:22:32 +00:00
|
|
|
}
|
|
|
|
|
2021-06-22 04:35:04 +00:00
|
|
|
if (!user) {
|
|
|
|
return "User not cached.";
|
|
|
|
} else {
|
2023-09-15 03:09:20 +00:00
|
|
|
return `\`${pomello(user)}\`'s public flags:\n\`\`\`${flagFromInt(
|
|
|
|
user.publicFlags
|
|
|
|
)}\`\`\``;
|
2021-06-22 04:35:04 +00:00
|
|
|
}
|
|
|
|
} else if (!isNaN(num)) {
|
|
|
|
return `\`\`\`\n${flagFromInt(num)}\`\`\``;
|
2021-06-22 04:22:32 +00:00
|
|
|
} else {
|
2023-09-15 03:09:20 +00:00
|
|
|
return `\`${pomello(msg.author)}\`'s public flags:\n\`\`\`${flagFromInt(
|
|
|
|
msg.author.publicFlags
|
|
|
|
)}\`\`\``;
|
2021-06-22 04:22:32 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
hf.registerCommand(flagdump);
|
2021-08-12 03:31:56 +00:00
|
|
|
|
|
|
|
const jumbo = new Command("jumbo");
|
|
|
|
jumbo.category = CATEGORY;
|
|
|
|
jumbo.helpText = "Gets the raw image of an emoji.";
|
|
|
|
jumbo.usage = "<emoji>";
|
|
|
|
jumbo.addAlias("e");
|
|
|
|
jumbo.addAlias("emote");
|
|
|
|
jumbo.addAlias("emoji");
|
2023-05-30 01:51:50 +00:00
|
|
|
jumbo.callback = async function (msg, line) {
|
2021-08-12 03:31:56 +00:00
|
|
|
if (CUSTOM_EMOTE_REGEX.test(line)) {
|
2021-08-12 03:33:58 +00:00
|
|
|
const [_, animatedFlag, name, id] = line.match(CUSTOM_EMOTE_REGEX);
|
2021-08-12 03:31:56 +00:00
|
|
|
const animated = animatedFlag === "a";
|
|
|
|
|
|
|
|
return {
|
2021-08-30 02:04:26 +00:00
|
|
|
embeds: [
|
|
|
|
{
|
|
|
|
title: `:${name}: - \`${id}\``,
|
2021-08-12 03:31:56 +00:00
|
|
|
url: `${EMOTE_BASE}${id}.${animated ? "gif" : "png"}?v=1`,
|
2021-08-30 02:04:26 +00:00
|
|
|
image: {
|
|
|
|
url: `${EMOTE_BASE}${id}.${animated ? "gif" : "png"}?v=1`,
|
|
|
|
},
|
2021-08-12 03:31:56 +00:00
|
|
|
},
|
2021-08-30 02:04:26 +00:00
|
|
|
],
|
2021-08-12 03:31:56 +00:00
|
|
|
};
|
|
|
|
} else {
|
|
|
|
let setName = "twemoji";
|
|
|
|
for (const set in EMOJI_SETS) {
|
|
|
|
if (line.startsWith(`--${set} `)) {
|
|
|
|
setName = set;
|
|
|
|
line = line.replace(`--${set} `, "");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const set = EMOJI_SETS[setName];
|
|
|
|
|
|
|
|
const emoji = Array.from(line)
|
|
|
|
.map((char) => char.codePointAt().toString(16))
|
|
|
|
.join(set.sep);
|
|
|
|
const url = set.prefix + emoji + set.suffix;
|
|
|
|
|
2023-04-09 17:46:48 +00:00
|
|
|
const name = EMOJI_NAMES[line]
|
|
|
|
? `\\:${EMOJI_NAMES[line]}\\:`
|
2022-10-12 15:08:35 +00:00
|
|
|
: await getNamesFromString(line).then((name) =>
|
2023-05-30 01:51:50 +00:00
|
|
|
name.map((x) => x[1]).join(", ")
|
|
|
|
);
|
2021-08-12 03:31:56 +00:00
|
|
|
|
2023-05-30 01:51:50 +00:00
|
|
|
const emojiFound = await fetch(url, {method: "HEAD"}).then((res) => res.ok);
|
2021-08-12 03:31:56 +00:00
|
|
|
|
2023-04-09 17:46:48 +00:00
|
|
|
if (emojiFound) {
|
2021-08-12 03:31:56 +00:00
|
|
|
return "Emoji not found. The emoji set chosen might not have this emote as an image.";
|
|
|
|
}
|
|
|
|
|
|
|
|
if (set.suffix == ".svg") {
|
2022-10-10 19:13:02 +00:00
|
|
|
const svg = await fetch(url)
|
|
|
|
.then((res) => res.arrayBuffer())
|
|
|
|
.then((b) => Buffer.from(b));
|
2023-05-30 01:51:50 +00:00
|
|
|
const converted = await sharp(svg, {density: 2400})
|
2021-08-12 03:31:56 +00:00
|
|
|
.resize(1024)
|
|
|
|
.toBuffer();
|
|
|
|
|
|
|
|
return {
|
2021-08-30 02:04:26 +00:00
|
|
|
embeds: [
|
|
|
|
{
|
|
|
|
title: `${name} (${emoji.toUpperCase().replace(/[-_]/g, ", ")})`,
|
|
|
|
url,
|
|
|
|
image: {
|
|
|
|
url: "attachment://emoji.png",
|
|
|
|
},
|
2021-08-12 03:31:56 +00:00
|
|
|
},
|
2021-08-30 02:04:26 +00:00
|
|
|
],
|
2021-08-12 03:31:56 +00:00
|
|
|
file: {
|
|
|
|
file: converted,
|
|
|
|
name: "emoji.png",
|
|
|
|
},
|
|
|
|
};
|
|
|
|
} else {
|
|
|
|
return {
|
2021-08-30 02:04:26 +00:00
|
|
|
embeds: [
|
|
|
|
{
|
|
|
|
title: `${name} (${emoji.toUpperCase().replace(/[-_]/g, ", ")})`,
|
2021-08-12 03:31:56 +00:00
|
|
|
url,
|
2021-08-30 02:04:26 +00:00
|
|
|
image: {
|
|
|
|
url,
|
|
|
|
},
|
2021-08-12 03:31:56 +00:00
|
|
|
},
|
2021-08-30 02:04:26 +00:00
|
|
|
],
|
2021-08-12 03:31:56 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
hf.registerCommand(jumbo);
|
2022-03-29 17:38:02 +00:00
|
|
|
|
|
|
|
const charinfo = new Command("charinfo");
|
|
|
|
charinfo.category = CATEGORY;
|
2022-08-16 22:54:27 +00:00
|
|
|
charinfo.helpText = "Get information about a set of characters.";
|
2022-03-29 17:38:02 +00:00
|
|
|
charinfo.usage = "[characters]";
|
|
|
|
charinfo.addAlias("char");
|
2023-05-30 01:51:50 +00:00
|
|
|
charinfo.callback = async function (msg, line) {
|
2022-03-29 17:46:40 +00:00
|
|
|
const names = await getNamesFromString(line);
|
2022-03-29 17:38:02 +00:00
|
|
|
const chars = [...line];
|
|
|
|
const lines = names
|
|
|
|
.map(
|
|
|
|
([code, name], index) =>
|
|
|
|
`\`\\u${code}\`: ${name} - ${chars[index]} - <http://www.fileformat.info/info/unicode/char/${code}>`
|
|
|
|
)
|
|
|
|
.join("\n");
|
|
|
|
|
|
|
|
if (lines.length > 2000) {
|
2022-04-02 02:07:15 +00:00
|
|
|
return "Output too long: " + (await hastebin(lines));
|
2022-03-29 17:38:02 +00:00
|
|
|
} else {
|
|
|
|
return lines;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
hf.registerCommand(charinfo);
|
2022-10-10 04:38:15 +00:00
|
|
|
|
|
|
|
const presence = new Command("presence");
|
|
|
|
presence.category = CATEGORY;
|
|
|
|
presence.helpText = "Get presences of a user.";
|
|
|
|
presence.usage = "<user>";
|
2023-03-25 19:49:43 +00:00
|
|
|
presence.addAlias("status");
|
2023-05-30 01:51:50 +00:00
|
|
|
presence.callback = async function (msg, line) {
|
2022-10-10 04:38:15 +00:00
|
|
|
if (!msg.guildID) return "Can only be used in guilds.";
|
|
|
|
|
|
|
|
let target;
|
|
|
|
if (line) {
|
|
|
|
const user = await lookupUser(msg, line);
|
|
|
|
if (
|
|
|
|
user == "No results" ||
|
|
|
|
user == "Canceled" ||
|
|
|
|
user == "Request timed out"
|
|
|
|
) {
|
|
|
|
return user;
|
|
|
|
} else {
|
|
|
|
let member = user;
|
|
|
|
const guild = msg.channel.guild || hf.bot.guilds.get(msg.guildID);
|
|
|
|
if (guild) {
|
|
|
|
if (guild.members.has(user.id)) {
|
|
|
|
member = guild.members.get(user.id);
|
|
|
|
} else {
|
|
|
|
const fetched = await guild.fetchMembers({
|
|
|
|
userIDs: [user.id],
|
|
|
|
});
|
|
|
|
member = fetched[0];
|
|
|
|
}
|
2022-10-10 19:13:02 +00:00
|
|
|
target = member;
|
2022-10-10 04:38:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
target = msg.member;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (target) {
|
2023-09-15 03:09:20 +00:00
|
|
|
if (!target.clientStatus) return `**${pomello(target)}** is offline.`;
|
2022-10-10 04:38:15 +00:00
|
|
|
|
|
|
|
let icons = "";
|
2023-01-22 20:15:54 +00:00
|
|
|
for (const platform of Object.keys(target.clientStatus)) {
|
|
|
|
const status = target.clientStatus[platform];
|
2022-10-10 04:38:15 +00:00
|
|
|
|
2023-01-22 20:29:04 +00:00
|
|
|
icons += (PRESENCE_ICONS[platform][status] ?? "") + " ";
|
2022-10-10 04:38:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
const embeds = [];
|
2022-10-10 19:13:02 +00:00
|
|
|
const files = [];
|
|
|
|
|
2023-01-22 20:15:54 +00:00
|
|
|
for (const index in target.activities) {
|
|
|
|
const activity = target.activities[index];
|
2022-10-10 19:13:02 +00:00
|
|
|
if (activity.type == 4) {
|
2023-01-16 18:38:27 +00:00
|
|
|
const embed = {};
|
|
|
|
|
2022-10-10 19:42:02 +00:00
|
|
|
if (activity.emoji) {
|
|
|
|
if (activity.emoji.id) {
|
2023-05-30 01:51:50 +00:00
|
|
|
const url = `${EMOTE_BASE}${activity.emoji.id}.${
|
|
|
|
activity.emoji.animated ? "gif" : "png"
|
|
|
|
}`;
|
2023-01-16 18:38:27 +00:00
|
|
|
embed.author = {
|
|
|
|
url,
|
2023-01-22 04:45:57 +00:00
|
|
|
icon_url: url,
|
2023-01-16 18:57:31 +00:00
|
|
|
name: activity.state ?? "\u200b",
|
2023-01-16 18:38:27 +00:00
|
|
|
};
|
2022-10-10 19:42:02 +00:00
|
|
|
} else {
|
2023-01-16 18:38:27 +00:00
|
|
|
embed.title = `${activity.emoji.name} ${activity.state ?? ""}`;
|
2022-10-10 19:42:02 +00:00
|
|
|
}
|
2023-01-16 18:38:27 +00:00
|
|
|
} else {
|
|
|
|
embed.title = activity.state ?? "";
|
2022-10-10 19:13:02 +00:00
|
|
|
}
|
|
|
|
|
2023-01-16 18:38:27 +00:00
|
|
|
embeds.push(embed);
|
2022-10-10 19:13:02 +00:00
|
|
|
} else {
|
|
|
|
const embed = {
|
|
|
|
title: `${PRESENCE_TYPES[activity.type]} **${activity.name}**`,
|
2023-01-13 06:44:53 +00:00
|
|
|
fields: [],
|
2022-10-10 19:13:02 +00:00
|
|
|
};
|
|
|
|
const descLines = [];
|
|
|
|
if (activity.type == 2) {
|
|
|
|
if (activity.details) descLines.push(`**${activity.details}**`);
|
|
|
|
if (activity.state) descLines.push(activity.state);
|
|
|
|
if (activity.assets?.large_text)
|
|
|
|
descLines.push(activity.assets.large_text);
|
|
|
|
} else {
|
|
|
|
if (activity.details) descLines.push(activity.details);
|
2023-04-22 01:53:34 +00:00
|
|
|
if (activity.state) {
|
|
|
|
let stateLine = activity.state;
|
|
|
|
if (activity.party?.size) {
|
|
|
|
stateLine += ` (${activity.party.size[0]} of ${activity.party.size[1]})`;
|
|
|
|
}
|
|
|
|
descLines.push(stateLine);
|
|
|
|
}
|
2022-10-10 19:13:02 +00:00
|
|
|
}
|
|
|
|
|
2022-10-10 19:16:28 +00:00
|
|
|
if (activity.timestamps) {
|
|
|
|
if (activity.timestamps.start && !activity.timestamps.end) {
|
|
|
|
descLines.push(
|
|
|
|
formatTime(Date.now() - activity.timestamps.start) + " elapsed"
|
|
|
|
);
|
|
|
|
} else if (!activity.timestamps.start && activity.timestamps.end) {
|
|
|
|
descLines.push(
|
|
|
|
formatTime(activity.timestamps.end - Date.now()) + " remaining"
|
|
|
|
);
|
2023-04-22 01:50:42 +00:00
|
|
|
} else if (
|
|
|
|
activity.timestamps.start != null &&
|
|
|
|
activity.timestamps.end != null
|
|
|
|
) {
|
2022-10-10 19:16:28 +00:00
|
|
|
const position = Date.now() - activity.timestamps.start;
|
|
|
|
const length = activity.timestamps.end - activity.timestamps.start;
|
|
|
|
|
|
|
|
const timeEnd = formatTime(length);
|
|
|
|
const timePos = formatTime(position);
|
|
|
|
|
2023-08-24 22:53:33 +00:00
|
|
|
const progress = position >= length ? 1 : position / length;
|
2022-10-10 19:16:28 +00:00
|
|
|
const barLength = Math.round(progress * NOWPLAYING_BAR_LENGTH);
|
|
|
|
|
|
|
|
const bar = `\`[${"=".repeat(barLength)}${" ".repeat(
|
|
|
|
NOWPLAYING_BAR_LENGTH - barLength
|
|
|
|
)}]\``;
|
|
|
|
const time = `\`${timePos}${" ".repeat(
|
|
|
|
NOWPLAYING_BAR_LENGTH + 2 - timePos.length - timeEnd.length
|
|
|
|
)}${timeEnd}\``;
|
|
|
|
|
|
|
|
descLines.push(bar);
|
|
|
|
descLines.push(time);
|
|
|
|
}
|
2022-10-10 19:13:02 +00:00
|
|
|
}
|
|
|
|
|
2023-01-13 06:44:53 +00:00
|
|
|
if (activity.assets?.large_text && activity.type != 2) {
|
|
|
|
embed.fields.push({
|
|
|
|
name: "Large Text",
|
|
|
|
value: activity.assets.large_text,
|
|
|
|
});
|
|
|
|
}
|
2022-12-01 20:30:14 +00:00
|
|
|
|
2023-01-13 06:44:53 +00:00
|
|
|
if (activity.assets?.small_text) {
|
|
|
|
embed.fields.push({
|
|
|
|
name: "Small Text",
|
|
|
|
value: activity.assets.small_text,
|
|
|
|
});
|
2022-12-01 20:30:14 +00:00
|
|
|
}
|
|
|
|
|
2022-10-10 19:13:02 +00:00
|
|
|
embed.description = descLines.join("\n");
|
|
|
|
|
2022-10-10 19:21:17 +00:00
|
|
|
if (activity.assets) {
|
|
|
|
if (activity.assets.large_image != null) {
|
|
|
|
let largeUrl;
|
|
|
|
if (activity.assets.large_image.startsWith("mp:")) {
|
2022-10-10 19:22:19 +00:00
|
|
|
largeUrl = activity.assets.large_image.replace(
|
2022-10-10 19:21:17 +00:00
|
|
|
"mp:",
|
|
|
|
"https://media.discordapp.net/"
|
|
|
|
);
|
2022-10-10 19:37:44 +00:00
|
|
|
} else if (activity.assets.large_image.startsWith("spotify:")) {
|
|
|
|
largeUrl = activity.assets.large_image.replace(
|
|
|
|
"spotify:",
|
|
|
|
"https://i.scdn.co/image/"
|
|
|
|
);
|
2022-10-10 19:21:17 +00:00
|
|
|
} else {
|
|
|
|
largeUrl = `https://cdn.discordapp.com/app-assets/${activity.application_id}/${activity.assets.large_image}.png`;
|
|
|
|
}
|
|
|
|
|
|
|
|
let smallUrl;
|
|
|
|
if (activity.assets.small_image != null) {
|
|
|
|
if (activity.assets.small_image.startsWith("mp:")) {
|
2022-10-10 19:22:19 +00:00
|
|
|
smallUrl = activity.assets.small_image.replace(
|
2022-10-10 19:21:17 +00:00
|
|
|
"mp:",
|
|
|
|
"https://media.discordapp.net/"
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
smallUrl = `https://cdn.discordapp.com/app-assets/${activity.application_id}/${activity.assets.small_image}.png`;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const largeImage = await fetch(largeUrl)
|
|
|
|
.then((res) => res.arrayBuffer())
|
|
|
|
.then((b) => Buffer.from(b));
|
|
|
|
const presenceImage = sharp(largeImage).resize(60, 60);
|
|
|
|
if (smallUrl) {
|
|
|
|
const smallImage = await fetch(smallUrl)
|
|
|
|
.then((res) => res.arrayBuffer())
|
|
|
|
.then((b) => Buffer.from(b));
|
|
|
|
const smallImageBuffer = await sharp(smallImage)
|
|
|
|
.resize(20, 20)
|
|
|
|
.toBuffer();
|
|
|
|
|
|
|
|
presenceImage.composite([
|
|
|
|
{
|
|
|
|
input: smallImageBuffer,
|
|
|
|
gravity: "southeast",
|
|
|
|
},
|
|
|
|
]);
|
|
|
|
}
|
2022-10-10 19:13:02 +00:00
|
|
|
|
2022-10-10 19:21:17 +00:00
|
|
|
files.push({
|
2022-10-10 19:27:43 +00:00
|
|
|
contents: await presenceImage.toBuffer(),
|
2022-10-10 19:21:17 +00:00
|
|
|
name: `${index}.png`,
|
|
|
|
});
|
|
|
|
embed.thumbnail = {
|
|
|
|
url: `attachment://${index}.png`,
|
|
|
|
};
|
|
|
|
} else if (
|
|
|
|
!activity.assets.large_image &&
|
|
|
|
activity.assets.small_image != null
|
|
|
|
) {
|
|
|
|
let smallUrl;
|
2022-10-10 19:13:02 +00:00
|
|
|
if (activity.assets.small_image.startsWith("mp:")) {
|
2022-10-10 19:22:19 +00:00
|
|
|
smallUrl = activity.assets.small_image.replace(
|
2022-10-10 19:13:02 +00:00
|
|
|
"mp:",
|
|
|
|
"https://media.discordapp.net/"
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
smallUrl = `https://cdn.discordapp.com/app-assets/${activity.application_id}/${activity.assets.small_image}.png`;
|
|
|
|
}
|
|
|
|
|
|
|
|
const smallImage = await fetch(smallUrl)
|
|
|
|
.then((res) => res.arrayBuffer())
|
|
|
|
.then((b) => Buffer.from(b));
|
2022-10-10 19:21:17 +00:00
|
|
|
const presenceImage = await sharp(smallImage)
|
|
|
|
.resize(60, 60)
|
2022-10-10 19:14:22 +00:00
|
|
|
.toBuffer();
|
2022-10-10 19:13:02 +00:00
|
|
|
|
2022-10-10 19:21:17 +00:00
|
|
|
files.push({
|
2022-10-10 19:27:43 +00:00
|
|
|
contents: presenceImage,
|
2022-10-10 19:21:17 +00:00
|
|
|
name: `${index}.png`,
|
|
|
|
});
|
|
|
|
embed.thumbnail = {
|
|
|
|
url: `attachment://${index}.png`,
|
|
|
|
};
|
2022-10-10 19:13:02 +00:00
|
|
|
}
|
|
|
|
}
|
2023-03-25 19:40:53 +00:00
|
|
|
|
|
|
|
if (
|
|
|
|
activity.application_id &&
|
|
|
|
!activity.assets?.large_image &&
|
|
|
|
!activity.assets?.small_image
|
|
|
|
) {
|
|
|
|
const game = GameData.find(
|
|
|
|
(game) => game.id == activity.application_id
|
|
|
|
);
|
|
|
|
if (game?.icon) {
|
|
|
|
embed.thumbnail = {
|
2023-03-25 19:44:52 +00:00
|
|
|
url: `https://cdn.discordapp.com/app-icons/${game.id}/${game.icon}.png?size=40&keep_aspect_ratio=false`,
|
2023-03-25 19:40:53 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-10 19:21:17 +00:00
|
|
|
embeds.push(embed);
|
2022-10-10 19:13:02 +00:00
|
|
|
}
|
|
|
|
}
|
2022-10-10 04:38:15 +00:00
|
|
|
|
|
|
|
return {
|
2023-09-15 03:09:20 +00:00
|
|
|
content: `Presence for **${pomello(target)}**: ${icons.trim()}`,
|
2022-10-10 19:13:02 +00:00
|
|
|
embeds,
|
|
|
|
files,
|
2022-10-10 04:38:15 +00:00
|
|
|
};
|
|
|
|
} else {
|
|
|
|
return ":warning: Could not get user???";
|
|
|
|
}
|
|
|
|
};
|
|
|
|
hf.registerCommand(presence);
|
2023-09-15 02:57:22 +00:00
|
|
|
|
|
|
|
// }}}
|