misc. bugfixes
This commit is contained in:
parent
6e22687bf6
commit
7bf5e1f3c6
2 changed files with 11 additions and 4 deletions
|
@ -1,7 +1,14 @@
|
||||||
import { getChannelId, getRoleId } from "knub/dist/utils";
|
import { getChannelId, getRoleId } from "knub/dist/utils";
|
||||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||||
import { sendErrorMessage } from "../../../pluginUtils";
|
import { sendErrorMessage } from "../../../pluginUtils";
|
||||||
import { customEmojiRegex, isValidSnowflake, parseInviteCodeInput, resolveInvite, resolveUser } from "../../../utils";
|
import {
|
||||||
|
customEmojiRegex,
|
||||||
|
isValidSnowflake,
|
||||||
|
noop,
|
||||||
|
parseInviteCodeInput,
|
||||||
|
resolveInvite,
|
||||||
|
resolveUser,
|
||||||
|
} from "../../../utils";
|
||||||
import { canReadChannel } from "../../../utils/canReadChannel";
|
import { canReadChannel } from "../../../utils/canReadChannel";
|
||||||
import { resolveMessageTarget } from "../../../utils/resolveMessageTarget";
|
import { resolveMessageTarget } from "../../../utils/resolveMessageTarget";
|
||||||
import { getChannelInfoEmbed } from "../functions/getChannelInfoEmbed";
|
import { getChannelInfoEmbed } from "../functions/getChannelInfoEmbed";
|
||||||
|
@ -50,7 +57,7 @@ export const InfoCmd = utilityCmd({
|
||||||
|
|
||||||
// 2. Server
|
// 2. Server
|
||||||
if (userCfg.can_server) {
|
if (userCfg.can_server) {
|
||||||
const guild = pluginData.client.guilds.fetch(value);
|
const guild = await pluginData.client.guilds.fetch(value).catch(noop);
|
||||||
if (guild) {
|
if (guild) {
|
||||||
const embed = await getServerInfoEmbed(pluginData, value, message.author.id);
|
const embed = await getServerInfoEmbed(pluginData, value, message.author.id);
|
||||||
if (embed) {
|
if (embed) {
|
||||||
|
@ -108,7 +115,7 @@ export const InfoCmd = utilityCmd({
|
||||||
|
|
||||||
// 6. Server again (fallback for discovery servers)
|
// 6. Server again (fallback for discovery servers)
|
||||||
if (userCfg.can_server) {
|
if (userCfg.can_server) {
|
||||||
const serverPreview = getGuildPreview(pluginData.client, value).catch(() => null);
|
const serverPreview = await getGuildPreview(pluginData.client, value).catch(() => null);
|
||||||
if (serverPreview) {
|
if (serverPreview) {
|
||||||
const embed = await getServerInfoEmbed(pluginData, value, message.author.id);
|
const embed = await getServerInfoEmbed(pluginData, value, message.author.id);
|
||||||
if (embed) {
|
if (embed) {
|
||||||
|
|
|
@ -1258,7 +1258,7 @@ export async function resolveInvite<T extends boolean>(
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore: the getInvite() withCounts typings are blergh
|
// @ts-ignore: the getInvite() withCounts typings are blergh
|
||||||
const promise = client.getInvite(code, withCounts).catch(() => null);
|
const promise = client.fetchInvite(code).catch(() => null);
|
||||||
inviteCache.set(key, promise);
|
inviteCache.set(key, promise);
|
||||||
|
|
||||||
return promise as ResolveInviteReturnType<T>;
|
return promise as ResolveInviteReturnType<T>;
|
||||||
|
|
Loading…
Add table
Reference in a new issue