more fixxes

This commit is contained in:
ITOH
2021-05-01 18:42:46 +02:00
parent 51095db12f
commit eda4895da3
8 changed files with 29 additions and 29 deletions

View File

@@ -21,7 +21,7 @@ export enum DiscordChannelTypes {
/** A temporary sub-channel within a GUILD_TEXT channel that is only viewable by those invited and those with the MANAGE_THREADS permission */
GuildPivateThread,
/** A voice channel for hosting events with an audience */
GUILD_STAGE_VOICE = 13,
GuildStageVoice = 13,
}
export type ChannelTypes = DiscordChannelTypes;

View File

@@ -1,16 +1,16 @@
import { defaultTestOptions, tempData } from "../ws/start_bot.ts";
import { assertExists } from "../deps.ts";
import { cache } from "../../src/cache.ts";
import { categoryChildren, createChannel } from "../../src/helpers/mod.ts";
import { DiscordChannelTypes } from "../../src/types/channels/channel_types.ts";
import { assertExists } from "../deps.ts";
import { delayUntil } from "../util/delay_until.ts";
import { defaultTestOptions, tempData } from "../ws/start_bot.ts";
Deno.test({
name: "[channel] category channel ids",
async fn() {
const category = await createChannel(tempData.guildId, {
name: "Discordeno-test",
type: DiscordChannelTypes.GUILD_CATEGORY,
type: DiscordChannelTypes.GuildCategory,
});
// Assertions

View File

@@ -15,7 +15,7 @@ async function ifItFailsBlameWolf(options: CreateGuildChannel, _save = false) {
// Assertions
assertExists(channel);
assertEquals(channel.type, options.type || DiscordChannelTypes.GUILD_TEXT);
assertEquals(channel.type, options.type || DiscordChannelTypes.GuildText);
// Delay the execution by 5 seconds to allow CHANNEL_CREATE event to be processed
await delayUntil(10000, () => cache.channels.has(channel.id));

View File

@@ -61,7 +61,7 @@ Deno.test({
await ifItFailsBlameWolf(
{
name: "Discordeno-clone-test",
type: DiscordChannelTypes.GUILD_CATEGORY,
type: DiscordChannelTypes.GuildCategory,
},
false,
);
@@ -75,7 +75,7 @@ Deno.test({
await ifItFailsBlameWolf(
{
name: "Discordeno-clone-test",
type: DiscordChannelTypes.GUILD_VOICE,
type: DiscordChannelTypes.GuildVoice,
},
false,
);
@@ -89,7 +89,7 @@ Deno.test({
await ifItFailsBlameWolf(
{
name: "discordeno-clone-test",
type: DiscordChannelTypes.GUILD_VOICE,
type: DiscordChannelTypes.GuildVoice,
bitrate: 32000,
},
false,
@@ -104,7 +104,7 @@ Deno.test({
await ifItFailsBlameWolf(
{
name: "Discordeno-clone-test",
type: DiscordChannelTypes.GUILD_VOICE,
type: DiscordChannelTypes.GuildVoice,
userLimit: 32,
},
false,

View File

@@ -1,19 +1,19 @@
import { defaultTestOptions, tempData } from "../ws/start_bot.ts";
import { assertEquals, assertExists } from "../deps.ts";
import { cache } from "../../src/cache.ts";
import { DiscordChannelTypes } from "../../src/types/channels/channel_types.ts";
import { CreateGuildChannel } from "../../src/types/guilds/create_guild_channel.ts";
import { createChannel } from "../../src/helpers/channels/create_channel.ts";
import { delayUntil } from "../util/delay_until.ts";
import { DiscordOverwriteTypes } from "../../src/types/channels/overwrite_types.ts";
import { botId } from "../../src/bot.ts";
import { cache } from "../../src/cache.ts";
import { createChannel } from "../../src/helpers/channels/create_channel.ts";
import { DiscordChannelTypes } from "../../src/types/channels/channel_types.ts";
import { DiscordOverwriteTypes } from "../../src/types/channels/overwrite_types.ts";
import { CreateGuildChannel } from "../../src/types/guilds/create_guild_channel.ts";
import { assertEquals, assertExists } from "../deps.ts";
import { delayUntil } from "../util/delay_until.ts";
import { defaultTestOptions, tempData } from "../ws/start_bot.ts";
async function ifItFailsBlameWolf(options: CreateGuildChannel, save = false) {
const channel = await createChannel(tempData.guildId, options);
// Assertions
assertExists(channel);
assertEquals(channel.type, options.type || DiscordChannelTypes.GUILD_TEXT);
assertEquals(channel.type, options.type || DiscordChannelTypes.GuildText);
if (save) tempData.channelId = channel.id;
@@ -60,7 +60,7 @@ Deno.test({
await ifItFailsBlameWolf(
{
name: "Discordeno-test",
type: DiscordChannelTypes.GUILD_CATEGORY,
type: DiscordChannelTypes.GuildCategory,
},
true,
);
@@ -90,7 +90,7 @@ Deno.test({
await ifItFailsBlameWolf(
{
name: "Discordeno-test",
type: DiscordChannelTypes.GUILD_VOICE,
type: DiscordChannelTypes.GuildVoice,
},
true,
);
@@ -104,7 +104,7 @@ Deno.test({
await ifItFailsBlameWolf(
{
name: "discordeno-test",
type: DiscordChannelTypes.GUILD_VOICE,
type: DiscordChannelTypes.GuildVoice,
bitrate: 32000,
},
true,
@@ -119,7 +119,7 @@ Deno.test({
await ifItFailsBlameWolf(
{
name: "Discordeno-test",
type: DiscordChannelTypes.GUILD_VOICE,
type: DiscordChannelTypes.GuildVoice,
userLimit: 32,
},
true,

View File

@@ -14,7 +14,7 @@ async function ifItFailsBlameWolf(options: CreateGuildChannel, _save = false) {
// Assertions
assertExists(channel);
assertEquals(channel.type, options.type || DiscordChannelTypes.GUILD_TEXT);
assertEquals(channel.type, options.type || DiscordChannelTypes.GuildText);
// Delay the execution by 5 seconds to allow CHANNEL_CREATE event to be processed
await delayUntil(10000, () => cache.channels.has(channel.id));

View File

@@ -16,7 +16,7 @@ async function ifItFailsBlameWolf(options: CreateGuildChannel, _save = false) {
// Assertions
assertExists(channel);
assertEquals(channel.type, options.type || DiscordChannelTypes.GUILD_TEXT);
assertEquals(channel.type, options.type || DiscordChannelTypes.GuildText);
// Delay the execution by 5 seconds to allow CHANNEL_CREATE event to be processed
await delayUntil(10000, () => cache.channels.has(channel.id));

View File

@@ -1,19 +1,19 @@
import { botId } from "../../src/bot.ts";
import { cache } from "../../src/cache.ts";
import { createChannel } from "../../src/helpers/channels/create_channel.ts";
import { defaultTestOptions, tempData } from "../ws/start_bot.ts";
import { delayUntil } from "../util/delay_until.ts";
import { assertEquals, assertExists } from "../deps.ts";
import { isChannelSynced } from "../../src/helpers/channels/is_channel_synced.ts";
import { DiscordChannelTypes } from "../../src/types/channels/channel_types.ts";
import { botId } from "../../src/bot.ts";
import { DiscordOverwriteTypes } from "../../src/types/channels/overwrite_types.ts";
import { assertEquals, assertExists } from "../deps.ts";
import { delayUntil } from "../util/delay_until.ts";
import { defaultTestOptions, tempData } from "../ws/start_bot.ts";
Deno.test({
name: "[channel] is channel synced.",
async fn() {
const category = await createChannel(tempData.guildId, {
name: "synced-category",
type: DiscordChannelTypes.GUILD_CATEGORY,
type: DiscordChannelTypes.GuildCategory,
permissionOverwrites: [
{
id: botId,