mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 03:18:17 +00:00
fix lint
This commit is contained in:
@@ -11,4 +11,4 @@ jobs:
|
||||
- name: Commit formatted files
|
||||
uses: EndBug/add-and-commit@v7
|
||||
- name: Run lint script
|
||||
run: deno lint src/** test/** --unstable --ignore=./src/types,./src/interactions/types
|
||||
run: deno lint src/** test/** --unstable --ignore=./src/types
|
||||
|
||||
@@ -2,10 +2,7 @@ import { eventHandlers } from "../../bot.ts";
|
||||
import { cacheHandlers } from "../../cache.ts";
|
||||
import { structures } from "../../structures/mod.ts";
|
||||
import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import {
|
||||
DiscordGuildMemberWithUser,
|
||||
GuildMemberWithUser,
|
||||
} from "../../types/guilds/guild_member.ts";
|
||||
import { DiscordGuildMemberWithUser } from "../../types/guilds/guild_member.ts";
|
||||
import { DiscordMessage, Message } from "../../types/messages/message.ts";
|
||||
import { snakeKeysToCamelCase } from "../../util/utils.ts";
|
||||
|
||||
|
||||
@@ -37,15 +37,15 @@ export function fetchMembers(
|
||||
|
||||
// TODO: finish implementing this
|
||||
function requestAllMembers(
|
||||
guildId: string,
|
||||
shardId: number,
|
||||
resolve: (
|
||||
_guildId: string,
|
||||
_shardId: number,
|
||||
_resolve: (
|
||||
value:
|
||||
| Collection<string, DiscordenoMember>
|
||||
| PromiseLike<Collection<string, DiscordenoMember>>,
|
||||
) => void,
|
||||
// deno-lint-ignore no-explicit-any
|
||||
options: any,
|
||||
_options: any,
|
||||
): void {
|
||||
throw new Error("Function not implemented.");
|
||||
}
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
import { cacheHandlers } from "../../cache.ts";
|
||||
import { rest } from "../../rest/rest.ts";
|
||||
import { structures } from "../../structures/mod.ts";
|
||||
import {
|
||||
DiscordGuildMember,
|
||||
DiscordGuildMemberWithUser,
|
||||
} from "../../types/guilds/guild_member.ts";
|
||||
import { DiscordGuildMemberWithUser } from "../../types/guilds/guild_member.ts";
|
||||
import { endpoints } from "../../util/constants.ts";
|
||||
|
||||
/** Returns a guild member object for the specified user.
|
||||
|
||||
@@ -7,7 +7,6 @@ import { DiscordGatewayIntents } from "../../types/gateway/gateway_intents.ts";
|
||||
import {
|
||||
DiscordGuildMember,
|
||||
DiscordGuildMemberWithUser,
|
||||
GuildMember,
|
||||
} from "../../types/guilds/guild_member.ts";
|
||||
import { ListGuildMembers } from "../../types/guilds/list_guild_members.ts";
|
||||
import { Errors } from "../../types/misc/errors.ts";
|
||||
|
||||
@@ -22,15 +22,16 @@ export async function getMembersByQuery(
|
||||
}) as Promise<Collection<string, DiscordenoMember>>;
|
||||
}
|
||||
|
||||
// TODO: implement this
|
||||
function requestAllMembers(
|
||||
id: string,
|
||||
shardId: number,
|
||||
resolve: (
|
||||
_id: string,
|
||||
_shardId: number,
|
||||
_resolve: (
|
||||
value:
|
||||
| Collection<string, DiscordenoMember>
|
||||
| PromiseLike<Collection<string, DiscordenoMember>>,
|
||||
) => void,
|
||||
arg3: { query: string; limit: number },
|
||||
_arg3: { query: string; limit: number },
|
||||
): void {
|
||||
throw new Error("Function not implemented.");
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ import { botId } from "../../bot.ts";
|
||||
import { rest } from "../../rest/rest.ts";
|
||||
import { DiscordenoMessage } from "../../structures/message.ts";
|
||||
import { structures } from "../../structures/mod.ts";
|
||||
import { CreateMessage } from "../../types/messages/create_message.ts";
|
||||
import { EditMessage } from "../../types/messages/edit_message.ts";
|
||||
import { DiscordMessage } from "../../types/messages/message.ts";
|
||||
import { Errors } from "../../types/misc/errors.ts";
|
||||
|
||||
@@ -29,6 +29,8 @@ export async function startServer(
|
||||
const server = serve({ port: serverOptions.port });
|
||||
|
||||
for await (const req of server) {
|
||||
// TODO: this is going to be removed
|
||||
// deno-lint-ignore no-deprecated-deno-api
|
||||
const buffer = await Deno.readAll(req.body);
|
||||
const signature = req.headers.get("X-Signature-Ed25519");
|
||||
const timestamp = req.headers.get("X-Signature-Timestamp");
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// deno-lint-ignore-file no-unused-vars
|
||||
import { checkRateLimits } from "./check_rate_limits.ts";
|
||||
import { cleanupQueues } from "./cleanup_queues.ts";
|
||||
import { createRequestBody } from "./create_request_body.ts";
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { eventHandlers } from "../bot.ts";
|
||||
import { cache } from "../cache.ts";
|
||||
import { channelOverwriteHasPermission } from "../helpers/channels/channel_overwrite_has_permission.ts";
|
||||
import { cloneChannel } from "../helpers/channels/clone_channel.ts";
|
||||
import { deleteChannel } from "../helpers/channels/delete_channel.ts";
|
||||
import { deleteChannelOverwrite } from "../helpers/channels/delete_channel_overwrite.ts";
|
||||
import { editChannel } from "../helpers/channels/edit_channel.ts";
|
||||
import { editChannelOverwrite } from "../helpers/channels/edit_channel_overwrite.ts";
|
||||
import { cloneChannel } from "../helpers/channels/clone_channel.ts";
|
||||
import { sendMessage } from "../helpers/messages/send_message.ts";
|
||||
import { disconnectMember } from "../helpers/mod.ts";
|
||||
import { Channel, DiscordChannel } from "../types/channels/channel.ts";
|
||||
@@ -40,7 +40,7 @@ const baseChannel: Partial<DiscordenoChannel> = {
|
||||
if (!voiceStates) return undefined;
|
||||
|
||||
return new Collection(
|
||||
voiceStates.map((vs, key) => [key, cache.members.get(key)]),
|
||||
voiceStates.map((vs) => [vs.userId, cache.members.get(vs.userId)]),
|
||||
);
|
||||
},
|
||||
send(content) {
|
||||
|
||||
@@ -3,9 +3,9 @@ import { ws } from "./ws.ts";
|
||||
|
||||
/** Allows users to hook in and change to communicate to different clusters across different servers or anything they like. For example using redis pubsub to talk to other servers. */
|
||||
export async function tellClusterToIdentify(
|
||||
workerId: number,
|
||||
_workerId: number,
|
||||
shardId: number,
|
||||
bucketId: number,
|
||||
_bucketId: number,
|
||||
) {
|
||||
// When resharding this may exist already
|
||||
const oldShard = ws.shards.get(shardId);
|
||||
|
||||
@@ -1,18 +1,16 @@
|
||||
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 { deleteChannelOverwrite } from "../../src/helpers/channels/delete_channel_overwrite.ts";
|
||||
import { editChannelOverwrite } from "../../src/helpers/channels/edit_channel_overwrite.ts";
|
||||
import { cache } from "../../src/cache.ts";
|
||||
import { channelOverwriteHasPermission } from "../../src/helpers/channels/channel_overwrite_has_permission.ts";
|
||||
import { DiscordBitwisePermissionFlags } from "../../src/types/permissions/bitwise_permission_flags.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) {
|
||||
// TODO: whats save?
|
||||
async function ifItFailsBlameWolf(options: CreateGuildChannel, _save = false) {
|
||||
const channel = await createChannel(tempData.guildId, options);
|
||||
|
||||
// Assertions
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
import { defaultTestOptions, tempData } from "../ws/start_bot.ts";
|
||||
import { assertEquals, assertExists } from "../deps.ts";
|
||||
import { botId } from "../../src/bot.ts";
|
||||
import { cache } from "../../src/cache.ts";
|
||||
import { cloneChannel } from "../../src/helpers/channels/clone_channel.ts";
|
||||
import { createChannel } from "../../src/helpers/channels/create_channel.ts";
|
||||
import { CreateGuildChannel } from "../../src/types/guilds/create_guild_channel.ts";
|
||||
import { delayUntil } from "../util/delay_until.ts";
|
||||
import { botId } from "../../src/bot.ts";
|
||||
import { DiscordOverwriteTypes } from "../../src/types/channels/overwrite_types.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) {
|
||||
// TODO: whats save
|
||||
async function ifItFailsBlameWolf(options: CreateGuildChannel, _save = false) {
|
||||
const channel = await createChannel(tempData.guildId, options);
|
||||
|
||||
const cloned = await cloneChannel(channel.id);
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
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 { deleteChannelOverwrite } from "../../src/helpers/channels/delete_channel_overwrite.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) {
|
||||
async function ifItFailsBlameWolf(options: CreateGuildChannel, _save = false) {
|
||||
const channel = await createChannel(tempData.guildId, options);
|
||||
|
||||
// Assertions
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
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 { deleteChannelOverwrite } from "../../src/helpers/channels/delete_channel_overwrite.ts";
|
||||
import { editChannelOverwrite } from "../../src/helpers/channels/edit_channel_overwrite.ts";
|
||||
import { cache } from "../../src/cache.ts";
|
||||
import { channelOverwriteHasPermission } from "../../src/helpers/channels/channel_overwrite_has_permission.ts";
|
||||
import { DiscordBitwisePermissionFlags } from "../../src/types/permissions/bitwise_permission_flags.ts";
|
||||
import { createChannel } from "../../src/helpers/channels/create_channel.ts";
|
||||
import { editChannelOverwrite } from "../../src/helpers/channels/edit_channel_overwrite.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) {
|
||||
// TODO: whats save
|
||||
async function ifItFailsBlameWolf(options: CreateGuildChannel, _save = false) {
|
||||
const channel = await createChannel(tempData.guildId, options);
|
||||
|
||||
// Assertions
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
import { cache } from "../../src/cache.ts";
|
||||
import { createChannel } from "../../src/helpers/channels/create_channel.ts";
|
||||
import { deleteChannel } from "../../src/helpers/channels/delete_channel.ts";
|
||||
import { defaultTestOptions, tempData } from "../ws/start_bot.ts";
|
||||
import { delayUntil } from "../util/delay_until.ts";
|
||||
import { editChannel } from "../../src/helpers/channels/edit_channel.ts";
|
||||
import { assertEquals } from "../deps.ts";
|
||||
import { getChannel } from "../../src/helpers/channels/get_channel.ts";
|
||||
import { botId } from "../../src/bot.ts";
|
||||
import { assertEquals } from "../deps.ts";
|
||||
import { delayUntil } from "../util/delay_until.ts";
|
||||
import { defaultTestOptions, tempData } from "../ws/start_bot.ts";
|
||||
|
||||
Deno.test({
|
||||
name: "[channel] get a channel",
|
||||
|
||||
@@ -1,13 +1,8 @@
|
||||
import { cache } from "../../src/cache.ts";
|
||||
import { createChannel } from "../../src/helpers/channels/create_channel.ts";
|
||||
import { deleteChannel } from "../../src/helpers/channels/delete_channel.ts";
|
||||
import { defaultTestOptions, tempData } from "../ws/start_bot.ts";
|
||||
import { delayUntil } from "../util/delay_until.ts";
|
||||
import { editChannel } from "../../src/helpers/channels/edit_channel.ts";
|
||||
import { assertEquals } from "../deps.ts";
|
||||
import { getChannel } from "../../src/helpers/channels/get_channel.ts";
|
||||
import { botId } from "../../src/bot.ts";
|
||||
import { getChannels } from "../../src/helpers/channels/get_channels.ts";
|
||||
import { assertEquals } from "../deps.ts";
|
||||
import { delayUntil } from "../util/delay_until.ts";
|
||||
import { defaultTestOptions, tempData } from "../ws/start_bot.ts";
|
||||
|
||||
Deno.test({
|
||||
name: "[channel] get channels.",
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
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 { getChannels } from "../../src/helpers/channels/get_channels.ts";
|
||||
import { sendMessage } from "../../src/helpers/messages/send_message.ts";
|
||||
import { getPins } from "../../src/helpers/channels/get_pins.ts";
|
||||
import { DiscordenoMessage } from "../../src/structures/message.ts";
|
||||
import { sendMessage } from "../../src/helpers/messages/send_message.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] get pins.",
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
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 { startTyping } from "../../src/helpers/channels/start_typing.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] is typing.",
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
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 { startTyping } from "../../src/helpers/channels/start_typing.ts";
|
||||
import { swapChannels } from "../../src/helpers/channels/swap_channels.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] swap channels",
|
||||
|
||||
@@ -1,15 +1,10 @@
|
||||
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 { startTyping } from "../../src/helpers/channels/start_typing.ts";
|
||||
import { createInvite } from "../../src/helpers/invites/create_invite.ts";
|
||||
import { getInvite } from "../../src/helpers/invites/get_invite.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: "[invite] create invite",
|
||||
@@ -33,7 +28,7 @@ Deno.test({
|
||||
const invite = await createInvite(channel.id, {
|
||||
maxAge: 86400,
|
||||
maxUses: 0,
|
||||
temporary: false, // @ts-ignore
|
||||
temporary: false,
|
||||
unique: false,
|
||||
});
|
||||
|
||||
|
||||
@@ -1,17 +1,11 @@
|
||||
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 { startTyping } from "../../src/helpers/channels/start_typing.ts";
|
||||
import { createInvite } from "../../src/helpers/invites/create_invite.ts";
|
||||
import { getInvite } from "../../src/helpers/invites/get_invite.ts";
|
||||
import { deleteInvite } from "../../src/helpers/invites/delete_invite.ts";
|
||||
import { getChannelInvites } from "../../src/helpers/invites/get_channel_invites.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: "[invite] delete invite",
|
||||
@@ -35,7 +29,7 @@ Deno.test({
|
||||
const invite = await createInvite(channel.id, {
|
||||
maxAge: 86400,
|
||||
maxUses: 0,
|
||||
temporary: false, // @ts-ignore
|
||||
temporary: false,
|
||||
unique: false,
|
||||
});
|
||||
|
||||
|
||||
@@ -1,17 +1,10 @@
|
||||
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 { startTyping } from "../../src/helpers/channels/start_typing.ts";
|
||||
import { createInvite } from "../../src/helpers/invites/create_invite.ts";
|
||||
import { getInvite } from "../../src/helpers/invites/get_invite.ts";
|
||||
import { getChannelInvites } from "../../src/helpers/invites/get_channel_invites.ts";
|
||||
import { delay } from "../../src/util/utils.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: "[invite] get channel invites",
|
||||
@@ -35,7 +28,7 @@ Deno.test({
|
||||
const invite = await createInvite(channel.id, {
|
||||
maxAge: 86400,
|
||||
maxUses: 0,
|
||||
temporary: false, // @ts-ignore
|
||||
temporary: false,
|
||||
unique: false,
|
||||
});
|
||||
|
||||
@@ -45,7 +38,7 @@ Deno.test({
|
||||
const secondInvite = await createInvite(channel.id, {
|
||||
maxAge: 32400,
|
||||
maxUses: 5,
|
||||
temporary: true, // @ts-ignore
|
||||
temporary: true,
|
||||
unique: true,
|
||||
});
|
||||
|
||||
|
||||
@@ -1,15 +1,10 @@
|
||||
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 { startTyping } from "../../src/helpers/channels/start_typing.ts";
|
||||
import { createInvite } from "../../src/helpers/invites/create_invite.ts";
|
||||
import { getInvite } from "../../src/helpers/invites/get_invite.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: "[invite] get invite",
|
||||
@@ -33,7 +28,7 @@ Deno.test({
|
||||
const invite = await createInvite(channel.id, {
|
||||
maxAge: 86400,
|
||||
maxUses: 0,
|
||||
temporary: false, // @ts-ignore
|
||||
temporary: false,
|
||||
unique: false,
|
||||
});
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { defaultTestOptions, tempData } from "../ws/start_bot.ts";
|
||||
import { assertEquals, assertExists } from "../deps.ts";
|
||||
import { cache } from "../../src/cache.ts";
|
||||
import { sendMessage } from "../../src/helpers/messages/send_message.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(
|
||||
type: "getter" | "raw",
|
||||
@@ -11,6 +11,7 @@ async function ifItFailsBlameWolf(
|
||||
const channel = cache.channels.get(tempData.channelId);
|
||||
assertExists(channel);
|
||||
|
||||
// deno-lint-ignore no-explicit-any
|
||||
let messageContent: any = "Hello World!";
|
||||
let secondMessageId = undefined;
|
||||
if (content === "embed") {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// deno-lint-ignore require-await
|
||||
export async function delayUntil(
|
||||
maxMs: number,
|
||||
isReady: () => boolean | undefined,
|
||||
|
||||
@@ -4,7 +4,6 @@ import { deleteServer } from "../../src/helpers/guilds/delete_server.ts";
|
||||
import { delay } from "../../src/util/utils.ts";
|
||||
import { ws } from "../../src/ws/ws.ts";
|
||||
import { assertExists } from "../deps.ts";
|
||||
import { delayUntil } from "../util/delay_until.ts";
|
||||
|
||||
// Set necessary settings
|
||||
// Disables the logger which logs everything
|
||||
|
||||
Reference in New Issue
Block a user