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:
@@ -36,7 +36,17 @@ const EnvSchema = z.object({
|
||||
.filter((id) => id.length > 0)
|
||||
: []
|
||||
)
|
||||
)
|
||||
),
|
||||
WEBUI_URL: z.preprocess(emptyToUndefined, z.string().url().optional()),
|
||||
SUPPORT_SERVER_URL: z.preprocess(emptyToUndefined, z.string().url().optional())
|
||||
});
|
||||
|
||||
export const env = EnvSchema.parse(process.env);
|
||||
|
||||
export function buildBotInviteUrl(clientId = env.BOT_CLIENT_ID): string {
|
||||
const url = new URL('https://discord.com/api/oauth2/authorize');
|
||||
url.searchParams.set('client_id', clientId);
|
||||
url.searchParams.set('permissions', '8');
|
||||
url.searchParams.set('scope', 'bot applications.commands');
|
||||
return url.toString();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user