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:
14
apps/webui/src/app/api/public/stats/route.ts
Normal file
14
apps/webui/src/app/api/public/stats/route.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { NextResponse } from 'next/server';
|
||||
import { getPublicStats } from '@/lib/public-stats';
|
||||
|
||||
export async function GET() {
|
||||
try {
|
||||
const stats = await getPublicStats();
|
||||
return NextResponse.json(stats, {
|
||||
headers: { 'Cache-Control': 'public, s-maxage=30, stale-while-revalidate=60' }
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('[public/stats]', error);
|
||||
return NextResponse.json({ error: 'Failed to load stats' }, { status: 500 });
|
||||
}
|
||||
}
|
||||
14
apps/webui/src/app/api/public/status/route.ts
Normal file
14
apps/webui/src/app/api/public/status/route.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { NextResponse } from 'next/server';
|
||||
import { getPublicStatus } from '@/lib/public-status';
|
||||
|
||||
export async function GET() {
|
||||
try {
|
||||
const status = await getPublicStatus();
|
||||
return NextResponse.json(status, {
|
||||
headers: { 'Cache-Control': 'public, s-maxage=15, stale-while-revalidate=30' }
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('[public/status]', error);
|
||||
return NextResponse.json({ error: 'Failed to load status' }, { status: 500 });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user