Type fixes for djs

This commit is contained in:
Dark 2021-06-30 04:56:56 +02:00
parent 653d6c1dc2
commit 0822fc15e5
No known key found for this signature in database
GPG key ID: 2CD6ACB6B0A87B8A
130 changed files with 8877 additions and 411 deletions

View file

@ -1,4 +1,4 @@
import { CategoryChannel, MessageEmbedOptions, TextChannel, VoiceChannel } from "discord.js";
import { CategoryChannel, MessageEmbedOptions, Snowflake, TextChannel, VoiceChannel } from "discord.js";
import humanizeDuration from "humanize-duration";
import { GuildPluginData } from "knub";
import moment from "moment-timezone";
@ -25,7 +25,7 @@ export async function getServerInfoEmbed(
const thisServer = serverId === pluginData.guild.id ? pluginData.guild : null;
const [restGuild, guildPreview] = await Promise.all([
thisServer
? memoize(() => pluginData.client.guilds.fetch(serverId), `getRESTGuild_${serverId}`, 10 * MINUTES)
? memoize(() => pluginData.client.guilds.fetch(serverId as Snowflake), `getRESTGuild_${serverId}`, 10 * MINUTES)
: null,
getGuildPreview(pluginData.client, serverId),
]);
@ -68,7 +68,7 @@ export async function getServerInfoEmbed(
const ownerName = `${owner.username}#${owner.discriminator}`;
basicInformation.push(`Owner: **${ownerName}** (\`${thisServer.ownerID}\`)`);
basicInformation.push(`Voice region: **${thisServer.region}**`);
// basicInformation.push(`Voice region: **${thisServer.region}**`); Outdated, as automatic voice regions are fully live
}
if (features.length > 0) {