-
-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration
Drago edited this page Dec 6, 2024
·
2 revisions
This document details all configuration options for the DevAssist Discord bot.
DISCORD_TOKEN=your_discord_token_here
ANTHROPIC_API_KEY=api_key_here
GEMINI_API_KEY=api_key_here
LOG_LEVEL=INFO
DATABASE_PATH=data/subscriptions.db
TICKET_CATEGORY_ID=123456789
STAFF_ROLE_ID=987654321
Controls subscription tiers and their features:
{
"tiers": {
"free": {
"code_reviews_per_day": 5,
"ai_responses_per_day": 10
},
"pro": {
"price_monthly": 9.99,
"code_reviews_per_day": 20
},
"enterprise": {
"price_monthly": 29.99,
"code_reviews_per_day": "unlimited"
}
}
}
Defines project scaffolding templates:
{
"python-web": {
"name": "Python Web Application",
"description": "FastAPI web application template",
"structure": [...]
}
}
Configures command settings:
{
"categories": {
"programming": {
"code_review": {
"cooldown": 60,
"premium_only": false
}
}
}
}
Required permissions integer: 8
Includes:
- Manage Messages
- Manage Channels
- View Channels
- Send Messages
- Embed Links
- Attach Files
- Read Message History
- Add Reactions
Required intents:
- Message Content
- Guild Members
- Guild Messages
- Guild Message Reactions
Default SQLite database location: data/subscriptions.db
Custom location:
subscription = Subscription(db_path="custom/path/to/db.sqlite")
import logging
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
handlers=[
logging.FileHandler('bot.log'),
logging.StreamHandler()
]
)
-
Token Security
- Never commit tokens to repository
- Rotate tokens regularly
- Use environment variables
-
Permission Management
- Implement role-based access
- Restrict sensitive commands
- Regular permission audits
-
Rate Limiting
- Implement cooldowns
- Monitor API usage
- Prevent abuse
Create custom code analyzers:
class CustomAnalyzer(CodeAnalyzer):
def __init__(self):
super().__init__()
self.custom_rules = [...]
Add custom commands:
@commands.command()
async def custom_command(self, ctx):
# Implementation
pass