Update to discord.js v13.8.0, adding support for text-in-voice

This commit is contained in:
Dragory 2022-06-13 21:19:56 +03:00
parent ba78103807
commit b05fbe1d04
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
32 changed files with 151 additions and 149 deletions
backend/src

View file

@ -1,4 +1,4 @@
import { GuildChannel, GuildMember, Snowflake, Util, User } from "discord.js";
import { GuildChannel, GuildMember, Snowflake, Util, User, GuildTextBasedChannel } from "discord.js";
import { baseCommandParameterTypeHelpers, baseTypeConverters, CommandContext, TypeConversionError } from "knub";
import { createTypeHelper } from "knub-command-manager";
import {
@ -14,6 +14,8 @@ import {
import { isValidTimezone } from "./utils/isValidTimezone";
import { MessageTarget, resolveMessageTarget } from "./utils/resolveMessageTarget";
import { inputPatternToRegExp } from "./validatorUtils";
import { getChannelId } from "knub/dist/utils";
import { disableCodeBlocks } from "knub/dist/helpers";
export const commandTypes = {
...baseTypeConverters,
@ -100,6 +102,11 @@ export const commandTypes = {
return value;
},
guildTextBasedChannel(value: string, context: CommandContext<any>) {
// FIXME: Remove once Knub's types have been fixed
return baseTypeConverters.textChannel(value, context) as GuildTextBasedChannel;
},
};
export const commandTypeHelpers = {
@ -113,4 +120,5 @@ export const commandTypeHelpers = {
anyId: createTypeHelper<Promise<Snowflake>>(commandTypes.anyId),
regex: createTypeHelper<RegExp>(commandTypes.regex),
timezone: createTypeHelper<string>(commandTypes.timezone),
guildTextBasedChannel: createTypeHelper<GuildTextBasedChannel>(commandTypes.guildTextBasedChannel),
};