16 lines
475 B
TypeScript
16 lines
475 B
TypeScript
import type { LayoutServerLoad } from './$types';
|
|
|
|
import { bot } from '$lib/discordbot';
|
|
|
|
export const load: LayoutServerLoad = async () => {
|
|
const info = await bot.getUserActivityInGuild().catch(() => null);
|
|
|
|
return {
|
|
status: info?.status ?? 'offline',
|
|
activities: info?.activities ?? [],
|
|
displayName: info?.displayName ?? null,
|
|
avatarUrl: info?.avatarUrl ?? null,
|
|
guildTag: info?.guildTag ?? null,
|
|
guildTagBadgeImage: info?.guildTagBadgeImage ?? null
|
|
};
|
|
}; |