hopefully the last dir change

This commit is contained in:
ITOH
2021-05-05 20:06:32 +02:00
parent ee2e263d63
commit 7ff0d242ff
113 changed files with 267 additions and 250 deletions
+2 -2
View File
@@ -2,7 +2,7 @@ import { rest } from "../../rest/rest.ts";
import type { ModifyGuildWelcomeScreen } from "../../types/guilds/modify_guild_welcome_screen.ts";
import type { WelcomeScreen } from "../../types/guilds/welcome_screen.ts";
import { endpoints } from "../../util/constants.ts";
import { camelKeysToSnakeCase } from "../../util/utils.ts";
import { snakelize } from "../../util/utils.ts";
export async function editWelcomeScreen(
guildId: bigint,
@@ -11,6 +11,6 @@ export async function editWelcomeScreen(
return await rest.runMethod<WelcomeScreen>(
"patch",
endpoints.GUILD_WELCOME_SCREEN(guildId),
camelKeysToSnakeCase(options),
snakelize(options),
);
}
+2 -2
View File
@@ -3,7 +3,7 @@ import type { AuditLog } from "../../types/audit_log/audit_log.ts";
import type { GetGuildAuditLog } from "../../types/audit_log/get_guild_audit_log.ts";
import { endpoints } from "../../util/constants.ts";
import { requireBotGuildPermissions } from "../../util/permissions.ts";
import { camelKeysToSnakeCase } from "../../util/utils.ts";
import { snakelize } from "../../util/utils.ts";
/** Returns the audit logs for the guild. Requires VIEW AUDIT LOGS permission */
export async function getAuditLogs(
@@ -15,7 +15,7 @@ export async function getAuditLogs(
return await rest.runMethod<AuditLog>(
"get",
endpoints.GUILD_AUDIT_LOGS(guildId),
camelKeysToSnakeCase({
snakelize({
...options,
limit: options.limit && options.limit >= 1 && options.limit <= 100
? options.limit
+3 -3
View File
@@ -1,9 +1,9 @@
import { rest } from "../../rest/rest.ts";
import type { GetGuildPruneCountQuery } from "../../types/guilds/get_guild_prune_count.ts";
import { Errors } from "../../types/discordeno/errors.ts";
import type { GetGuildPruneCountQuery } from "../../types/guilds/get_guild_prune_count.ts";
import { endpoints } from "../../util/constants.ts";
import { requireBotGuildPermissions } from "../../util/permissions.ts";
import { camelKeysToSnakeCase } from "../../util/utils.ts";
import { snakelize } from "../../util/utils.ts";
/** Check how many members would be removed from the server in a prune operation. Requires the KICK_MEMBERS permission */
export async function getPruneCount(
@@ -20,7 +20,7 @@ export async function getPruneCount(
const result = await rest.runMethod(
"get",
endpoints.GUILD_PRUNE(guildId),
camelKeysToSnakeCase(options ?? {}),
snakelize(options ?? {}),
);
return result.pruned as number;
+2 -2
View File
@@ -3,7 +3,7 @@ import type {
UpdateSelfVoiceState,
} from "../../types/guilds/update_self_voice_state.ts";
import { endpoints } from "../../util/constants.ts";
import { camelKeysToSnakeCase } from "../../util/utils.ts";
import { snakelize } from "../../util/utils.ts";
/**
* Updates the current user's voice state.
@@ -21,6 +21,6 @@ export async function updateBotVoiceState(
return await rest.runMethod(
"patch",
endpoints.UPDATE_VOICE_STATE(guildId),
camelKeysToSnakeCase(data),
snakelize(data),
);
}
@@ -3,7 +3,7 @@ import type {
UpdateOthersVoiceState,
} from "../../types/guilds/update_others_voice_state.ts";
import { endpoints } from "../../util/constants.ts";
import { camelKeysToSnakeCase } from "../../util/utils.ts";
import { snakelize } from "../../util/utils.ts";
/**
* Updates another user's voice state.
@@ -22,6 +22,6 @@ export function updateVoiceState(
return rest.runMethod(
"patch",
endpoints.UPDATE_VOICE_STATE(guildId, userId),
camelKeysToSnakeCase(data),
snakelize(data),
);
}