3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 12:25:02 +00:00

Include Sticker and Emoji events in Logs

This commit is contained in:
Dark 2021-07-29 01:02:29 +02:00
parent 1e69da7cbc
commit 3886d2d1dd
No known key found for this signature in database
GPG key ID: 384C4B4F5B1E25A8
7 changed files with 169 additions and 1 deletions

View file

@ -1,10 +1,12 @@
import {
Emoji,
GuildChannel,
GuildMember,
PartialGuildMember,
Role,
Snowflake,
StageInstance,
Sticker,
ThreadChannel,
User,
} from "discord.js";
@ -127,3 +129,51 @@ export function stageToConfigAccessibleStage(stage: StageInstance): IConfigAcces
return toReturn;
}
export interface IConfigAccessibleEmoji {
id: Snowflake;
name: string;
createdAt?: number;
animated: boolean;
identifier: string;
}
export function emojiToConfigAccessibleEmoji(emoji: Emoji): IConfigAccessibleEmoji {
const toReturn: IConfigAccessibleEmoji = {
id: emoji.id!,
name: emoji.name!,
createdAt: emoji.createdTimestamp ?? undefined,
animated: emoji.animated ?? false,
identifier: emoji.identifier,
};
return toReturn;
}
export interface IConfigAccessibleSticker {
id: Snowflake;
guildId?: Snowflake;
packId?: Snowflake;
name: string;
description: string;
tags: string;
format: string;
animated: boolean;
url: string;
}
export function stickerToConfigAccessibleSticker(sticker: Sticker): IConfigAccessibleSticker {
const toReturn: IConfigAccessibleSticker = {
id: sticker.id,
guildId: sticker.guildId ?? undefined,
packId: sticker.packId ?? undefined,
name: sticker.name,
description: sticker.description ?? "",
tags: sticker.tags?.join(", ") ?? "",
format: sticker.format,
animated: sticker.format === "PNG" ? false : true,
url: sticker.url,
};
return toReturn;
}