Enhance bot and WebUI functionality with new features and environment updates
- Added support for new environment variables in `.env.example` for public site and legal operator information. - Integrated core commands into the bot's command structure for improved functionality. - Implemented a new `publishBotStatus` function to update bot status in Redis, enhancing monitoring capabilities. - Updated the landing page to include features, invite links, and support server access, improving user experience. - Enhanced localization with new keys for core commands and landing page elements in both English and German. - Improved error handling and logging for bot presence updates and status publishing.
This commit is contained in:
28
packages/shared/src/public.ts
Normal file
28
packages/shared/src/public.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const PublicStatsSchema = z.object({
|
||||
guildCount: z.number().int().nonnegative(),
|
||||
approximateUserCount: z.number().int().nonnegative(),
|
||||
updatedAt: z.string()
|
||||
});
|
||||
|
||||
export type PublicStats = z.infer<typeof PublicStatsSchema>;
|
||||
|
||||
export const BotStatusShardSchema = z.object({
|
||||
id: z.number().int().nonnegative(),
|
||||
status: z.string(),
|
||||
guildCount: z.number().int().nonnegative(),
|
||||
ping: z.number()
|
||||
});
|
||||
|
||||
export const BotStatusPayloadSchema = z.object({
|
||||
shards: z.array(BotStatusShardSchema),
|
||||
apiLatencyMs: z.number(),
|
||||
guildCount: z.number().int().nonnegative(),
|
||||
uptimeSeconds: z.number(),
|
||||
updatedAt: z.string()
|
||||
});
|
||||
|
||||
export type BotStatusPayload = z.infer<typeof BotStatusPayloadSchema>;
|
||||
|
||||
export const BOT_STATUS_REDIS_KEY = 'bot:status';
|
||||
Reference in New Issue
Block a user