Update README with environment variable configuration and bot command details; enhance event and tool handler initialization

This commit is contained in:
pacnpal
2025-02-24 14:09:27 -05:00
parent b0612c9c7e
commit 015c40441b
7 changed files with 152 additions and 18 deletions

101
README.md
View File

@@ -33,7 +33,32 @@ uv pip install -r requirements.txt
## Configuration
All configuration is done through environment variables. Create a `.env` file:
### Environment Variables
Create a `.env` file with required configuration:
### System Prompt & Personality
The bot's personality and behavior are configured through `system_prompt.yaml`. This defines:
- Core personality traits and behavior
- Response patterns and style
- Tool usage guidelines
- Context handling rules
Example system_prompt.yaml structure:
```yaml
sections:
- title: "Personality"
content: "Define the bot's character and tone"
- title: "Tools"
content: "Define how the bot uses available tools"
- title: "Context"
content: "Define how the bot handles conversation context"
```
The system prompt works in conjunction with the available tools to create natural, contextual interactions. When using `!reset_memory`, the bot reloads this configuration while preserving user data and preferences.
### Environment Variables
```env
# Required Environment Variables
@@ -191,10 +216,76 @@ The bot includes comprehensive monitoring:
- System state
3. Performance Metrics
- Response times
- Queue latency
- API latency
- Database performance
- Response times
- Queue latency
- API latency
- Database performance
4. Tool Usage Monitoring
- Detection of tool invocations
- Tool execution tracking
- Success/failure logging
- Comprehensive logging for:
- User mentions
- Thread creation
- Emoji reactions
- Emoticon conversions
- Tool usage summaries per message
## Bot Commands
### Owner Commands
- `!reset_memory` - Reset the bot's memory back to initial system prompt
- Tracks number of resets per user
- Preserves user interaction history and preferences
- Shows reset count in response
## Bot Tools & Capabilities
The bot uses a natural language tool system that allows it to perform actions based on conversation context:
### Available Tools
1. **User Mentions** (@username)
- Naturally mention users in conversation
- Example: "Hey @john, what do you think?"
- Automatically resolves nicknames and usernames
2. **Emoji Reactions**
- Add emoji reactions to messages
- Supports Unicode emojis, custom emojis, and standard Discord emojis
- Example: "That's awesome! 👍" (will add thumbs up reaction)
- Can convert emoticons like :) to proper emojis
3. **Rich Embeds**
- Create formatted embed messages
- Supports titles, descriptions, and custom colors
- Example:
```
[Embed]
Poll Results
First place: X
Second place: Y
[/Embed]
```
4. **Threading**
- Automatically creates discussion threads
- Supports various conversation patterns:
* Comparisons: "X vs Y"
* Reviews: "This coaster is overrated"
* Topics: "Safety discussion" or "Maintenance review"
- Automatically formats thread names for consistency
### Tool Usage
The bot uses these tools naturally in conversation without requiring explicit commands. It can:
- Recognize when to mention users based on context
- Add appropriate emoji reactions to messages
- Create organized threads for discussions
- Format information in embeds for better readability
All tools are used through natural language processing, making interactions feel more conversational and intuitive.
## Running the Bot