mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-19 13:03:31 +01:00
feat(GuildChannel): support conversion between text and news (#5022)
* feat(GuildChannel): support conversion between text and news * fix(Typings): add type to ChannelData * fix(GuildChannel): use ChannelUpdate action handler to change class type * Update src/structures/TextChannel.js Co-authored-by: Sugden <28943913+NotSugden@users.noreply.github.com> * fix(Typings): re-use ChannelType from GuildCreateChannelOptions * fix(Typings): only allow text-news conversion * fix(Typings): exclude -> pick (vlads suggestion) * fix(Typings): pick -> exclude in two other spots Co-authored-by: Sugden <28943913+NotSugden@users.noreply.github.com>
This commit is contained in:
3
typings/index.d.ts
vendored
3
typings/index.d.ts
vendored
@@ -1162,6 +1162,7 @@ declare module 'discord.js' {
|
||||
options?: { avatar?: BufferResolvable | Base64Resolvable; reason?: string },
|
||||
): Promise<Webhook>;
|
||||
public setNSFW(nsfw: boolean, reason?: string): Promise<NewsChannel>;
|
||||
public setType(type: Pick<typeof ChannelType, 'text' | 'news'>, reason?: string): Promise<GuildChannel>;
|
||||
public fetchWebhooks(): Promise<Collection<Snowflake, Webhook>>;
|
||||
public addFollower(channel: GuildChannelResolvable, reason?: string): Promise<NewsChannel>;
|
||||
}
|
||||
@@ -1513,6 +1514,7 @@ declare module 'discord.js' {
|
||||
): Promise<Webhook>;
|
||||
public setNSFW(nsfw: boolean, reason?: string): Promise<TextChannel>;
|
||||
public setRateLimitPerUser(rateLimitPerUser: number, reason?: string): Promise<TextChannel>;
|
||||
public setType(type: Pick<typeof ChannelType, 'text' | 'news'>, reason?: string): Promise<GuildChannel>;
|
||||
public fetchWebhooks(): Promise<Collection<Snowflake, Webhook>>;
|
||||
}
|
||||
|
||||
@@ -2339,6 +2341,7 @@ declare module 'discord.js' {
|
||||
|
||||
interface ChannelData {
|
||||
name?: string;
|
||||
type?: Pick<typeof ChannelType, 'text' | 'news'>;
|
||||
position?: number;
|
||||
topic?: string;
|
||||
nsfw?: boolean;
|
||||
|
||||
Reference in New Issue
Block a user