Website Status
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
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
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user