mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-01 20:46:08 +00:00
fix: use emojis cache
This commit is contained in:
parent
d06cd2e847
commit
0dbb331e71
@ -39,7 +39,7 @@ export class EmojiShorter extends BaseShorter {
|
||||
const emoji = await this.client.proxy.guilds(guildId).emojis.post({
|
||||
body: bodyResolved,
|
||||
});
|
||||
await this.client.cache.channels?.setIfNI('GuildEmojisAndStickers', emoji.id!, guildId, emoji);
|
||||
await this.client.cache.emojis?.setIfNI('GuildEmojisAndStickers', emoji.id!, guildId, emoji);
|
||||
return new GuildEmoji(this.client, emoji, guildId);
|
||||
}
|
||||
|
||||
@ -68,7 +68,7 @@ export class EmojiShorter extends BaseShorter {
|
||||
*/
|
||||
async delete(guildId: string, emojiId: string, reason?: string) {
|
||||
await this.client.proxy.guilds(guildId).emojis(emojiId).delete({ reason });
|
||||
await this.client.cache.channels?.removeIfNI('GuildEmojisAndStickers', emojiId, guildId);
|
||||
await this.client.cache.emojis?.removeIfNI('GuildEmojisAndStickers', emojiId, guildId);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -81,7 +81,7 @@ export class EmojiShorter extends BaseShorter {
|
||||
*/
|
||||
async edit(guildId: string, emojiId: string, body: RESTPatchAPIGuildEmojiJSONBody, reason?: string) {
|
||||
const emoji = await this.client.proxy.guilds(guildId).emojis(emojiId).patch({ body, reason });
|
||||
await this.client.cache.channels?.setIfNI('GuildEmojisAndStickers', emoji.id!, guildId, emoji);
|
||||
await this.client.cache.emojis?.setIfNI('GuildEmojisAndStickers', emoji.id!, guildId, emoji);
|
||||
return new GuildEmoji(this.client, emoji, guildId);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user