Compare commits

..

2 commits

View file

@ -1049,6 +1049,22 @@ lookupinvite.callback = async function (msg, line) {
};
hf.registerCommand(lookupinvite);
const inviteinfoInteraction = new InteractionCommand("inviteinfo");
inviteinfoInteraction.helpText = "Get information on an invite code";
inviteinfoInteraction.options.invite = {
name: "invite",
type: Constants.ApplicationCommandOptionTypes.STRING,
description: "Invite code to get info for",
required: true,
default: "",
};
inviteinfoInteraction.callback = async function (interaction) {
const invite = getOption(interaction, inviteinfoInteraction, "invite");
return lookupinvite.callback(interaction, invite);
};
hf.registerCommand(inviteinfoInteraction);
const snowflake = new Command("snowflake");
snowflake.category = CATEGORY;
snowflake.helpText = "Converts a snowflake ID into readable time.";
@ -1981,7 +1997,11 @@ guildinfo.callback = async function (msg, line) {
if (!line || line == "") {
if (!msg.guildID) return "Not in a guild.";
const __guild = msg.channel.guild ?? hf.bot.guilds.get(msg.guildID);
if (__guild) _guild = {source: "local", data: __guild};
if (__guild) {
_guild = {source: "local", data: __guild};
} else {
_guild = await getGuild(msg.guildID);
}
} else {
if (!SNOWFLAKE_REGEX.test(line)) return "Not a snowflake.";
const snowflake = line.match(SNOWFLAKE_REGEX)[1];