mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
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:
co-authored by
Skillz4Killz
parent
b90b32de9e
commit
792c48b498
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user