mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-02 21:16:09 +00:00
fix: bad typing
This commit is contained in:
parent
ae21fc075a
commit
3c66dd899f
@ -11,7 +11,6 @@ import type {
|
|||||||
RESTPostAPIGuildChannelJSONBody,
|
RESTPostAPIGuildChannelJSONBody,
|
||||||
RESTPostAPIGuildsJSONBody,
|
RESTPostAPIGuildsJSONBody,
|
||||||
} from 'discord-api-types/v10';
|
} from 'discord-api-types/v10';
|
||||||
import { toSnakeCase, type ObjectToLower } from '..';
|
|
||||||
import { resolveFiles } from '../../builders';
|
import { resolveFiles } from '../../builders';
|
||||||
import { BaseChannel, Guild, GuildMember, type CreateStickerBodyRequest } from '../../structures';
|
import { BaseChannel, Guild, GuildMember, type CreateStickerBodyRequest } from '../../structures';
|
||||||
import channelFrom from '../../structures/channels';
|
import channelFrom from '../../structures/channels';
|
||||||
@ -118,7 +117,7 @@ export class GuildShorter extends BaseShorter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
channels = await this.client.proxy.guilds(guildId).channels.get();
|
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]),
|
channels.map<[string, APIChannel]>(x => [x.id, x]),
|
||||||
guildId,
|
guildId,
|
||||||
);
|
);
|
||||||
@ -263,16 +262,11 @@ export class GuildShorter extends BaseShorter {
|
|||||||
* @param reason The reason for editing the rule.
|
* @param reason The reason for editing the rule.
|
||||||
* @returns A Promise that resolves to the edited auto-moderation rule.
|
* @returns A Promise that resolves to the edited auto-moderation rule.
|
||||||
*/
|
*/
|
||||||
edit: (
|
edit: (guildId: string, ruleId: string, body: RESTPatchAPIAutoModerationRuleJSONBody, reason?: string) => {
|
||||||
guildId: string,
|
|
||||||
ruleId: string,
|
|
||||||
body: ObjectToLower<RESTPatchAPIAutoModerationRuleJSONBody>,
|
|
||||||
reason?: string,
|
|
||||||
) => {
|
|
||||||
return this.client.proxy
|
return this.client.proxy
|
||||||
.guilds(guildId)
|
.guilds(guildId)
|
||||||
['auto-moderation'].rules(ruleId)
|
['auto-moderation'].rules(ruleId)
|
||||||
.patch({ body: toSnakeCase(body), reason })
|
.patch({ body, reason })
|
||||||
.then(rule => Transformers.AutoModerationRule(this.client, rule));
|
.then(rule => Transformers.AutoModerationRule(this.client, rule));
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -4,7 +4,7 @@ import type {
|
|||||||
RESTPostAPIAutoModerationRuleJSONBody,
|
RESTPostAPIAutoModerationRuleJSONBody,
|
||||||
} from 'discord-api-types/v10';
|
} from 'discord-api-types/v10';
|
||||||
import type { UsingClient } from '../commands';
|
import type { UsingClient } from '../commands';
|
||||||
import { toCamelCase, type MethodContext, type ObjectToLower } from '../common';
|
import type { MethodContext, ObjectToLower } from '../common';
|
||||||
import { DiscordBase } from './extra/DiscordBase';
|
import { DiscordBase } from './extra/DiscordBase';
|
||||||
|
|
||||||
export interface AutoModerationRule extends ObjectToLower<APIAutoModerationRule> {}
|
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);
|
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);
|
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),
|
delete: (ruleId: string, reason?: string) => client.guilds.moderation.delete(guildId, ruleId, reason),
|
||||||
fetch: (ruleId: string) => client.guilds.moderation.fetch(guildId, ruleId),
|
fetch: (ruleId: string) => client.guilds.moderation.fetch(guildId, ruleId),
|
||||||
edit: (ruleId: string, body: RESTPatchAPIAutoModerationRuleJSONBody, reason?: string) =>
|
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