Contributing
Thank you for your interest in contributing to Solstice! This guide covers everything you need to know to make high-quality contributions.
Getting Started
- Fork the repository on GitHub
- Clone your fork locally:bash
git clone https://github.com/YOUR_USERNAME/SolsticeIO.git cd SolsticeIO - Create a branch for your work:bash
git checkout -b feature/my-feature - Set up the development environment - follow Getting Started
Project Architecture
Before contributing, read the Architecture document to understand the hybrid Go + Python design. Key points:
- Go handles all Bot API interactions, database, and queue management
- Python handles only voice chat streaming (PyTgCalls)
- They communicate via localhost HTTP (ports 5050/5051)
- All state is in MongoDB; all caching in Upstash Redis
Code Organization
Go Code (internal/)
| Directory | Convention |
|---|---|
telegram/ | One file per feature module (admins.go, fun.go, tools.go, etc.) |
database/ | All DB functions in a single file (db.go) - package-level functions |
config/ | Single file, singleton pattern |
queue/ | Single file, mutex-protected struct |
youtube/ | One file per concern (search, extraction, cache, proxy) |
Adding a New Command
- Create the handler function in the appropriate file:go
func (h *BotHandler) handleMyCommand(c telebot.Context) error { // Your logic here return c.Reply("Response") } - Register it in the corresponding
Init*()function:gofunc (h *BotHandler) InitTools() { // ... existing handlers h.Bot.Handle("/mycommand", h.handleMyCommand) } - Add help text to
strings/langs/en.yml - Update the help menu in
help.goif applicable
Adding a New Language String
- Add the key to
strings/langs/en.yml:yamlmy_key: "Hello {0}, welcome to {1}!" - Use it in code:go
text := i18n.GetString("my_key", userName, chatName)
Code Style
Go
- Follow standard
gofmtformatting - Use descriptive function names (
handleBan, nothBan) - Keep sassy bot personality in user-facing strings
- Use
h.logError()for all error logging - Always check
h.CheckAdminSassy(c)for admin commands - Use
h.getTargetUser(c)for resolving target users
Python
- Follow PEP 8
- Use async/await for all I/O operations
- Keep the daemon focused - no business logic (that belongs in Go)
Commit Messages
Use Conventional Commits:
feat: add /dice command with random roll
fix: resolve race condition in queue shuffle
docs: update command reference with new flags
refactor: extract proxy pool into separate packagePull Request Process
- Ensure your code builds:
go build ./... - Test your changes manually with a bot instance
- Update documentation if you added/changed commands
- Push to your fork and open a PR against
main - Describe what your PR does and why
PR Title Format
feat: Brief description of the feature
fix: Brief description of the bug fix
docs: Brief description of documentation changeDevelopment Tips
Running in Development Mode
Set DEVELOPER_MODE=true in .env for verbose logging.
Testing Without Voice Chat
You can test all non-VC commands without the Python daemon running. The bot will still respond to admin, fun, utility, and management commands.
Useful Commands During Development
bash
# Build and run in one step
go run cmd/bot/main.go
# Check for compilation errors without building
go vet ./...
# Format all Go files
gofmt -w .
# Update Go dependencies
go mod tidyReporting Issues
When reporting bugs, include:
- Steps to reproduce the issue
- Expected behavior vs actual behavior
- Error logs (from the logger channel or console)
- Environment (OS, Go version, Python version)
License
By contributing to Solstice, you agree that your contributions will be licensed under the GNU General Public License v3.0.
