Skip to content

Commit 4fee83d

Browse files
docs: configuration
1 parent 8b7a227 commit 4fee83d

File tree

1 file changed

+26
-110
lines changed

1 file changed

+26
-110
lines changed

docs/src/getting-started/configuration.md

Lines changed: 26 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,39 @@
11
# Configuration
22

3-
Learn how to configure GitCord to suit your needs.
3+
Set up GitCord for your needs.
44

55
## Environment Variables
66

7-
GitCord uses environment variables for configuration. Create a `.env` file in the project root:
7+
Create a `.env` file in the project root:
88

99
```env
1010
# Required: Your Discord bot token
1111
DISCORD_TOKEN=your_bot_token_here
1212
13-
# Optional: Logging level (DEBUG, INFO, WARNING, ERROR)
14-
LOG_LEVEL=INFO
15-
16-
# Optional: Bot prefix for legacy commands (default: !)
17-
COMMAND_PREFIX=!
18-
19-
# Optional: Database URL for persistent storage
20-
DATABASE_URL=sqlite:///gitcord.db
13+
# Optional: Bot prefix for commands (default: !)
14+
PREFIX=!
2115
```
2216

23-
## Bot Configuration
17+
## Bot Permissions
2418

25-
### Permissions
26-
27-
Ensure your bot has these permissions:
19+
Your bot needs these permissions:
2820

2921
- **Manage Channels**: Create, edit, and delete channels
30-
- **Manage Roles**: Set up channel permissions
3122
- **Send Messages**: Send responses to commands
3223
- **Embed Links**: Send rich embeds
3324
- **Use Slash Commands**: Register and use slash commands
34-
- **Attach Files**: Upload template files
3525

36-
### Intents
26+
## Discord Intents
3727

38-
The bot requires these Discord intents:
28+
The bot needs these Discord intents:
3929

4030
- **Guilds**: Access server information
4131
- **Guild Messages**: Read and send messages
4232
- **Message Content**: Read message content for prefix commands
4333

44-
## Template Configuration
45-
46-
### YAML Structure
34+
## YAML Templates
4735

48-
Templates use YAML format with this structure:
36+
Templates use YAML format:
4937

5038
```yaml
5139
# Single channel
@@ -59,119 +47,47 @@ nsfw: Optional boolean for NSFW channels
5947
name: category-name
6048
type: category
6149
channels:
62-
- name: channel-1
63-
type: text
64-
topic: Channel description
65-
- name: channel-2
66-
type: voice
67-
topic: Voice channel description
68-
```
69-
70-
### Template Locations
71-
72-
Templates can be stored in:
73-
74-
1. **Built-in templates**: `gitcord-template/` directory
75-
2. **Custom templates**: Upload via Discord commands
76-
3. **Local files**: Reference local YAML files
77-
78-
## Logging Configuration
79-
80-
Configure logging in your environment:
81-
82-
```env
83-
# Log level options
84-
LOG_LEVEL=DEBUG # Most verbose
85-
LOG_LEVEL=INFO # Standard information
86-
LOG_LEVEL=WARNING # Warnings and errors only
87-
LOG_LEVEL=ERROR # Errors only
50+
- channel-1
51+
- channel-2
8852
```
8953
90-
## Database Configuration
54+
## Template Locations
9155
92-
For persistent storage, configure a database:
56+
Templates are available exclusively at:
9357
94-
```env
95-
# SQLite (default)
96-
DATABASE_URL=sqlite:///gitcord.db
58+
- [gitcord-template GitHub Repository](https://github.com/evolvewithevan/gitcord-template)
9759
98-
# PostgreSQL
99-
DATABASE_URL=postgresql://user:password@localhost/gitcord
60+
## Logging
10061
101-
# MySQL
102-
DATABASE_URL=mysql://user:password@localhost/gitcord
103-
```
62+
GitCord uses Python's built-in logging. Logs go to the console by default.
10463
105-
## Custom CSS and JavaScript
64+
**Note:** Database configuration and advanced options are not currently available.
10665
107-
Add custom styling to the documentation:
66+
## Security
10867
109-
1. Create `docs/src/custom.css`:
110-
```css
111-
/* Custom styles */
112-
.book-summary {
113-
background-color: #f5f5f5;
114-
}
115-
```
116-
117-
2. Create `docs/src/custom.js`:
118-
```javascript
119-
// Custom JavaScript
120-
console.log('GitCord documentation loaded');
121-
```
122-
123-
## Advanced Configuration
124-
125-
### Command Cooldowns
126-
127-
Configure command cooldowns in the bot code:
128-
129-
```python
130-
# In cog files
131-
@commands.cooldown(1, 30, commands.BucketType.guild)
132-
async def create_channel(self, ctx):
133-
# Command implementation
134-
```
135-
136-
### Error Handling
137-
138-
Customize error handling:
139-
140-
```python
141-
# Global error handler
142-
@bot.event
143-
async def on_command_error(ctx, error):
144-
if isinstance(error, commands.MissingPermissions):
145-
await ctx.send("You don't have permission to use this command.")
146-
```
147-
148-
## Security Considerations
149-
150-
- Keep your bot token secure and never commit it to version control
151-
- Use environment variables for sensitive configuration
68+
- Keep your bot token secure
69+
- Never commit tokens to version control
70+
- Use environment variables for sensitive data
15271
- Regularly rotate your bot token
153-
- Limit bot permissions to only what's necessary
154-
- Monitor bot activity and logs
72+
- Give bot only necessary permissions
15573
156-
## Troubleshooting Configuration
74+
## Problems?
15775
15876
### Common Issues
15977
16078
1. **Bot not responding**: Check token and permissions
16179
2. **Commands not working**: Verify slash commands are registered
162-
3. **Template errors**: Validate YAML syntax
80+
3. **Template errors**: Check YAML syntax
16381
4. **Permission errors**: Ensure bot has required permissions
16482
16583
### Debug Mode
16684
16785
Enable debug mode for detailed logging:
16886
16987
```env
170-
LOG_LEVEL=DEBUG
88+
DEBUG=true
17189
```
17290

173-
This provides verbose output for troubleshooting configuration issues.
174-
17591
## Next Steps
17692

17793
- Learn about [Available Commands](../user-guide/commands.md)

0 commit comments

Comments
 (0)