mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-04 01:40:08 +00:00
Merge branch 'fp-attempt-9001' of https://github.com/discordeno/discordeno into fp-attempt-9001
This commit is contained in:
@@ -88,8 +88,8 @@ export async function processGlobalQueue(rest: RestManager) {
|
||||
// If NOT rate limited remove from queue
|
||||
if (response.status !== 429) {
|
||||
// rest.debug(JSON.stringify((await response.json()).errors));
|
||||
console.log(JSON.stringify((await response.json())));
|
||||
|
||||
console.log(JSON.stringify(await response.json()));
|
||||
|
||||
request.request.reject(new Error(`[${response.status}] ${error}`));
|
||||
} else {
|
||||
if (request.payload.retryCount++ >= rest.maxRetryCount) {
|
||||
|
||||
@@ -3,3 +3,4 @@ import "./util/validate_length.ts";
|
||||
import "./util/utils.ts";
|
||||
import "./util/hash.ts";
|
||||
import "./util/format_urls.ts";
|
||||
import "./util/permissions.ts";
|
||||
|
||||
49
tests/util/permissions.ts
Normal file
49
tests/util/permissions.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
import { PermissionStrings } from "../../src/types/permissions/permission_strings.ts";
|
||||
import { calculateBits } from "../../src/util/permissions.ts";
|
||||
import { assertEquals } from "../deps.ts";
|
||||
const permissionStrins: PermissionStrings[] = [
|
||||
"CREATE_INSTANT_INVITE",
|
||||
"KICK_MEMBERS",
|
||||
"BAN_MEMBERS",
|
||||
"ADMINISTRATOR",
|
||||
"MANAGE_CHANNELS",
|
||||
"MANAGE_GUILD",
|
||||
"ADD_REACTIONS",
|
||||
"VIEW_AUDIT_LOG",
|
||||
"PRIORITY_SPEAKER",
|
||||
"STREAM",
|
||||
"VIEW_CHANNEL",
|
||||
"SEND_MESSAGES",
|
||||
"SEND_TTS_MESSAGES",
|
||||
"MANAGE_MESSAGES",
|
||||
"EMBED_LINKS",
|
||||
"ATTACH_FILES",
|
||||
"READ_MESSAGE_HISTORY",
|
||||
"MENTION_EVERYONE",
|
||||
"USE_EXTERNAL_EMOJIS",
|
||||
"VIEW_GUILD_INSIGHTS",
|
||||
"CONNECT",
|
||||
"SPEAK",
|
||||
"MUTE_MEMBERS",
|
||||
"DEAFEN_MEMBERS",
|
||||
"MOVE_MEMBERS",
|
||||
"USE_VAD",
|
||||
"CHANGE_NICKNAME",
|
||||
"MANAGE_NICKNAMES",
|
||||
"MANAGE_ROLES",
|
||||
"MANAGE_WEBHOOKS",
|
||||
"MANAGE_EMOJIS",
|
||||
"USE_SLASH_COMMANDS",
|
||||
"REQUEST_TO_SPEAK",
|
||||
"MANAGE_THREADS",
|
||||
"USE_PUBLIC_THREADS",
|
||||
"USE_PRIVATE_THREADS",
|
||||
"USE_EXTERNAL_STICKERS",
|
||||
];
|
||||
const permissionString = "266287972351";
|
||||
Deno.test({
|
||||
name: "[utils] calculate bits",
|
||||
fn() {
|
||||
assertEquals(calculateBits(permissionStrins), permissionString);
|
||||
},
|
||||
});
|
||||
@@ -25,6 +25,6 @@ Deno.test({
|
||||
const before = Date.now();
|
||||
await delay(2000);
|
||||
const after = Date.now();
|
||||
if (after - before < 2000) throw new Error(`delay(2000) delayed ${after - before}ms`);
|
||||
assertEquals(after - before >= 2000, true);
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user