mirror of
https://github.com/kirameki-cafe/Yumi.git
synced 2026-09-14 03:09:59 +00:00
17 lines
480 B
TypeScript
17 lines
480 B
TypeScript
import { Snowflake } from 'discord.js';
|
|
import { I18n } from 'i18n';
|
|
|
|
import Cache from '../providers/Cache';
|
|
import Locale from '../providers/Locale';
|
|
|
|
export async function getGuildLocale(id: Snowflake): Promise<I18n> {
|
|
const cachedGuild = await Cache.getCachedGuild(id);
|
|
if (!cachedGuild) return Locale.getLocaleProvider("en");
|
|
|
|
const LocaleProvider = Locale.getLocaleProvider(cachedGuild.locale);
|
|
return LocaleProvider;
|
|
}
|
|
|
|
export default {
|
|
getGuildLocale
|
|
} |