BREAKING: update channel types names (#2417)

* update channel types names

* fix ChannelTypes enum changes

Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
This commit is contained in:
LTS20050703
2022-09-04 12:01:17 -05:00
committed by GitHub
co-authored by Skillz4Killz
parent b90b32de9e
commit 792c48b498
5 changed files with 16 additions and 12 deletions
@@ -35,7 +35,7 @@ export interface StartThreadWithoutMessage {
/** The reason you are creating the thread */
reason?: string;
/** the type of thread to create */
type: ChannelTypes.GuildNewsThread | ChannelTypes.GuildPublicThread | ChannelTypes.GuildPrivateThread;
type: ChannelTypes.AnnouncementThread | ChannelTypes.PublicThread | ChannelTypes.PrivateThread;
/** whether non-moderators can add other non-moderators to a thread; only available when creating a private thread */
invitable?: boolean;
}
+2 -2
View File
@@ -9,12 +9,12 @@ Deno.test({
const bot = loadBot();
const channel = await bot.helpers.createChannel(CACHED_COMMUNITY_GUILD_ID, {
name: "Discordeno-test",
type: ChannelTypes.GuildNews,
type: ChannelTypes.GuildAnnouncement,
});
// Assertions
assertExists(channel);
assertEquals(channel.type, ChannelTypes.GuildNews);
assertEquals(channel.type, ChannelTypes.GuildAnnouncement);
assertEquals(channel.topic, undefined);
assertEquals(channel.bitrate, undefined);
assertEquals(channel.userLimit, undefined);
+6 -2
View File
@@ -23,8 +23,12 @@ Deno.test({
// Change the channel to a news channel
await t.step("[channel] change the channel to a news channel with a reason", async () => {
const editedChannel = await bot.helpers.editChannel(channel.id, { type: ChannelTypes.GuildNews }, "reason");
assertEquals(editedChannel.type, ChannelTypes.GuildNews);
const editedChannel = await bot.helpers.editChannel(
channel.id,
{ type: ChannelTypes.GuildAnnouncement },
"reason",
);
assertEquals(editedChannel.type, ChannelTypes.GuildAnnouncement);
});
// Change from a news channel to a text channel
+2 -2
View File
@@ -1,5 +1,5 @@
import { ChannelTypes } from "../../../mod.ts";
import { assertEquals, assertExists, assertNotEquals } from "../../deps.ts";
import { assertExists, assertNotEquals } from "../../deps.ts";
import { loadBot } from "../../mod.ts";
import { CACHED_COMMUNITY_GUILD_ID } from "../../utils.ts";
@@ -9,7 +9,7 @@ Deno.test({
const bot = loadBot();
const channel = await bot.helpers.createChannel(CACHED_COMMUNITY_GUILD_ID, {
name: "Discordeno-test",
type: ChannelTypes.GuildNews,
type: ChannelTypes.GuildAnnouncement,
});
// Assertions
+5 -5
View File
@@ -290,13 +290,13 @@ export enum ChannelTypes {
/** An organizational category that contains up to 50 channels */
GuildCategory,
/** A channel that users can follow and crosspost into their own server */
GuildNews,
/** A temporary sub-channel within a GUILD_NEWS channel */
GuildNewsThread = 10,
GuildAnnouncement,
/** A temporary sub-channel within a GUILD_ANNOUNCEMENT channel */
AnnouncementThread = 10,
/** A temporary sub-channel within a GUILD_TEXT channel */
GuildPublicThread,
PublicThread,
/** A temporary sub-channel within a GUILD_TEXT channel that is only viewable by those invited and those with the MANAGE_THREADS permission */
GuildPrivateThread,
PrivateThread,
/** A voice channel for hosting events with an audience */
GuildStageVoice,
/** A channel in a hub containing the listed servers */