|
- import {
- BitFieldResolvable,
- GatewayIntentsString,
- IntentsBitField,
- Partials,
- } from 'discord.js';
-
- // eslint-disable-next-line @typescript-eslint/no-namespace
- export namespace discord {
- export const botIntents = (
- (process.env.DISCORD_BOT_INTENTS as string)
- .split(',')
- .map((s) => (
- Object.entries(IntentsBitField.Flags).find(([key]) => key === s)?.[1]
- ))
- .filter((v) => typeof v === 'number') as unknown as BitFieldResolvable<GatewayIntentsString, number>
- );
- export const botPartials = (
- (process.env.DISCORD_BOT_PARTIALS as string)
- .split(',')
- .map((s) => (
- Object.entries(Partials)
- .find(([key]) => key === s)?.[1]
- ))
- .filter((v) => typeof v === 'number') as unknown as Partials[]
- );
- }
-
- // eslint-disable-next-line @typescript-eslint/no-namespace
- export namespace gelbooru {
- export const apiUrl = process.env.GELBOORU_API_URL as string;
- export const apiKey = process.env.GELBOORU_API_KEY as string;
- export const userId = process.env.GELBOORU_API_USER_ID as string;
- }
-
- // eslint-disable-next-line @typescript-eslint/no-namespace
- export namespace saucenao {
- export const apiUrl = process.env.SAUCENAO_API_URL as string;
- export const apiKey = process.env.SAUCENAO_API_KEY as string;
- }
|