/[sudobot]/trunk/src/utils/Emoji.ts
ViewVC logotype

Annotation of /trunk/src/utils/Emoji.ts

Parent Directory Parent Directory | Revision Log Revision Log


Revision 86 - (hide annotations)
Mon Jul 29 17:28:32 2024 UTC (8 months, 1 week ago) by rakin
File MIME type: application/typescript
File size: 581 byte(s)
Updated the database system
1 rakin 51 import { Emoji } from "discord.js";
2     import DiscordClient from "../client/Client";
3    
4     function globalConfig() {
5     return DiscordClient.client.config.props.global;
6     }
7    
8     export async function fetchEmoji(name: string) {
9     return await findEmoji(e => e.name === name);
10     }
11    
12 rakin 86 export async function fetchEmojiStr(name: string) {
13     return (await findEmoji(e => e.name === name))?.toString();
14     }
15    
16 rakin 51 export async function findEmoji(callback: (e: Emoji) => boolean) {
17 rakin 67 return await DiscordClient.client.guilds.cache.find(g => g.id === globalConfig().id)!.emojis.cache.find(callback);
18 rakin 51 }

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26