Skip to main content

Welcome Contributors!

Thank you for your interest in contributing to MusicBot! We welcome contributions from the community and appreciate your help in making this project better.

Getting Started

To contribute to MusicBot, you’ll need to fork and clone the repository:
  1. Fork the repository on GitHub at https://github.com/spyflow/musicbot
  2. Clone your fork to your local machine:
git clone https://github.com/YOUR-USERNAME/musicbot.git
cd musicbot
  1. Create a new branch for your feature or bug fix:
git checkout -b feature/your-feature-name

Areas for Contribution

There are many ways you can contribute to MusicBot:

New Features

  • Implement playlist support
  • Add music streaming from other platforms
  • Create advanced queue management features
  • Develop audio effects and filters
  • Add user preference settings

Bug Fixes

  • Fix existing issues reported on GitHub
  • Improve error handling
  • Enhance stability and performance
  • Resolve edge cases in playback logic

Documentation

  • Improve README and setup instructions
  • Add code comments and docstrings
  • Create user guides and tutorials
  • Translate documentation to other languages

Code Style Guidelines

To maintain code consistency, please follow these guidelines:
  • Follow existing patterns: Review bot.py to understand the codebase structure and coding conventions
  • Use meaningful variable names: Follow the naming conventions used in the project (e.g., guild_state, voice_client)
  • Add comments: Document complex logic and explain your reasoning
  • Include docstrings: Add docstrings to all functions and classes following the existing format
  • Keep functions focused: Each function should have a single, well-defined purpose
  • Handle errors gracefully: Use proper exception handling with informative error messages
  • Log appropriately: Use the logging module to track important events and errors

Example Code Structure

@bot.command(name='example', help='Description of what this command does')
async def example_command(ctx: commands.Context, *, argument: str = ""):
    """
    Detailed docstring explaining the command's purpose,
    arguments, and behavior.
    
    Args:
        ctx (commands.Context): The context of the command.
        argument (str): Description of the argument.
    """
    logger.info(f"Example command invoked by {ctx.author.name}")
    
    try:
        # Your implementation here
        await ctx.send("Success message")
    except Exception as e:
        logger.error(f"Error in example command: {e}", exc_info=True)
        await ctx.send("Error message for users")

Pull Request Process

  1. Test your changes thoroughly before submitting
    • Ensure your code works as expected
    • Test edge cases and error conditions
    • Verify that existing functionality still works
  2. Update documentation if needed
    • Update the README.md if you’ve changed usage or setup
    • Add comments to explain complex code
  3. Commit your changes with clear, descriptive messages:
git add .
git commit -m "Add feature: description of your changes"
  1. Push to your fork:
git push origin feature/your-feature-name
  1. Create a pull request on GitHub:
    • Provide a clear description of your changes
    • Explain the problem you’re solving or feature you’re adding
    • Reference any related issues
    • Include screenshots or examples if applicable
  2. Respond to feedback: Be prepared to make changes based on code review feedback

License

By contributing to MusicBot, you agree that your contributions will be licensed under the CC BY-NC-SA 4.0 License (Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International). This means:
  • Attribution: You must give appropriate credit
  • NonCommercial: The work cannot be used for commercial purposes
  • ShareAlike: Adaptations must be shared under the same license
Please ensure you understand and agree to these terms before contributing.

Questions?

If you have questions about contributing, feel free to:
  • Open an issue on GitHub
  • Contact the maintainer (see Support page)
  • Review existing pull requests for examples
We appreciate your contributions and look forward to working with you!

Build docs developers (and LLMs) love