mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-01 20:46:08 +00:00
fix: bad typing
This commit is contained in:
parent
ae21fc075a
commit
3c66dd899f
@ -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<RESTPatchAPIAutoModerationRuleJSONBody>,
|
||||
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));
|
||||
},
|
||||
};
|
||||
|
@ -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<APIAutoModerationRule> {}
|
||||
@ -26,7 +26,7 @@ export class AutoModerationRule extends DiscordBase<APIAutoModerationRule> {
|
||||
return this.client.guilds.moderation.fetch(this.guildId, this.id);
|
||||
}
|
||||
|
||||
edit(body: ObjectToLower<RESTPatchAPIAutoModerationRuleJSONBody>, 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<APIAutoModerationRule> {
|
||||
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),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user