diff --git a/src/common/shorters/guilds.ts b/src/common/shorters/guilds.ts index 9d71d70..e1206c5 100644 --- a/src/common/shorters/guilds.ts +++ b/src/common/shorters/guilds.ts @@ -11,7 +11,6 @@ import type { RESTPostAPIGuildChannelJSONBody, RESTPostAPIGuildsJSONBody, } from 'discord-api-types/v10'; -import { toSnakeCase, type ObjectToLower } from '..'; import { resolveFiles } from '../../builders'; import { BaseChannel, Guild, GuildMember, type CreateStickerBodyRequest } from '../../structures'; import channelFrom from '../../structures/channels'; @@ -118,7 +117,7 @@ export class GuildShorter extends BaseShorter { } } channels = await this.client.proxy.guilds(guildId).channels.get(); - await this.client.cache.channels?.patch( + await this.client.cache.channels?.set( channels.map<[string, APIChannel]>(x => [x.id, x]), guildId, ); @@ -263,16 +262,11 @@ export class GuildShorter extends BaseShorter { * @param reason The reason for editing the rule. * @returns A Promise that resolves to the edited auto-moderation rule. */ - edit: ( - guildId: string, - ruleId: string, - body: ObjectToLower, - reason?: string, - ) => { + edit: (guildId: string, ruleId: string, body: RESTPatchAPIAutoModerationRuleJSONBody, reason?: string) => { return this.client.proxy .guilds(guildId) ['auto-moderation'].rules(ruleId) - .patch({ body: toSnakeCase(body), reason }) + .patch({ body, reason }) .then(rule => Transformers.AutoModerationRule(this.client, rule)); }, }; diff --git a/src/structures/AutoModerationRule.ts b/src/structures/AutoModerationRule.ts index 9181663..11b4697 100644 --- a/src/structures/AutoModerationRule.ts +++ b/src/structures/AutoModerationRule.ts @@ -4,7 +4,7 @@ import type { RESTPostAPIAutoModerationRuleJSONBody, } from 'discord-api-types/v10'; import type { UsingClient } from '../commands'; -import { toCamelCase, type MethodContext, type ObjectToLower } from '../common'; +import type { MethodContext, ObjectToLower } from '../common'; import { DiscordBase } from './extra/DiscordBase'; export interface AutoModerationRule extends ObjectToLower {} @@ -26,7 +26,7 @@ export class AutoModerationRule extends DiscordBase { return this.client.guilds.moderation.fetch(this.guildId, this.id); } - edit(body: ObjectToLower, reason?: string) { + edit(body: RESTPatchAPIAutoModerationRuleJSONBody, reason?: string) { return this.client.guilds.moderation.edit(this.guildId, this.id, body, reason); } @@ -41,7 +41,7 @@ export class AutoModerationRule extends DiscordBase { delete: (ruleId: string, reason?: string) => client.guilds.moderation.delete(guildId, ruleId, reason), fetch: (ruleId: string) => client.guilds.moderation.fetch(guildId, ruleId), edit: (ruleId: string, body: RESTPatchAPIAutoModerationRuleJSONBody, reason?: string) => - client.guilds.moderation.edit(guildId, ruleId, toCamelCase(body), reason), + client.guilds.moderation.edit(guildId, ruleId, body, reason), }; } }