README.md

Orbit Discord Bot

Orbit is a feature-rich Discord bot designed to enhance community server functionality with various utility, moderation, and fun commands.

Features

Utility Commands

  • /ping - Check bot latency
  • /serverinfo - Get detailed server information
  • /userinfo - View user profile details
  • /avatar - Display user's avatar
  • /roleinfo - Get information about a role
  • /giveaway - Create and manage giveaways
  • /remind - Set personal reminders
  • /poll - Create interactive polls

Moderation Commands

  • /ban - Ban users from the server
  • /timeout - Temporarily timeout users

Fun Commands

  • /8ball - Ask the magic 8-ball a question
  • /joke - Get random jokes (Programming/General/Pun)
  • /random - Generate random numbers
  • /echo - Make the bot repeat your message
  • /booru - Search for images across various booru sites (NSFW)
  • /play-sound - Play audio files in voice channels

Services

  • Giveaway Service: Automatically manages and ends giveaways
  • Reminder Service: Handles scheduled reminders
  • Bluesky Service: Cross-posts from Bluesky to Discord (configurable)
  • HTTP Server: Provides API endpoints for bot functionality

Technical Stack

  • Runtime: Node.js
  • Language: TypeScript
  • Database: Supabase
  • Dependencies:
    • discord.js
    • @supabase/supabase-js
    • express
    • @atproto/api
    • Various utility packages

Setup

  1. Clone the repository:
git clone https://github.com/chocoOnEstrogen/orbit.git
cd orbit
  1. Install dependencies:
npm install
  1. Copy .env.sample to .env and fill in the required values:
DISCORD_BOT_TOKEN=your_bot_token
DISCORD_GUILD_ID=your_guild_id
DISCORD_CLIENT_ID=your_client_id
NODE_ENV=development
BLUESKY_IDENTIFIER=your_bluesky_handle
BLUESKY_PASSWORD=your_bluesky_password
BLUESKY_FEED_INTERVAL=60000
SUPABASE_ANON_KEY=your_supabase_anon_key
SUPABASE_SERVICE_ROLE=your_supabase_service_role
SUPABASE_URL=your_supabase_url
  1. Set up the database:
  • Execute the SQL scripts in supabase/data.sql in your Supabase project
  1. Build the project:
npm run build
  1. Deploy commands:
npm run deploy-commands
  1. Start the bot:
npm start

For development:

npm run dev

Development

Project Structure

  • src/commands/ - Command implementations
  • src/events/ - Discord event handlers
  • src/services/ - Background services
  • src/configs/ - Configuration files
  • src/types/ - TypeScript type definitions
  • src/utils/ - Utility functions
  • src/server/ - HTTP server implementation

Adding New Commands

  1. Create a new file in the appropriate category under src/commands/
  2. Implement the command using the Command type interface
  3. Run npm run deploy-commands to register new commands

Code Style

The project uses Prettier for code formatting:

npm run format   # Format code

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

License

ISC License - See LICENSE file for details

Support

For issues and feature requests, please use the GitHub issue tracker.