mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 11:28:15 +00:00
hopefully the last dir change
This commit is contained in:
@@ -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),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user