Skip to content

How To Contribute

SELECT stupidity FROM discord edited this page May 29, 2022 · 1 revision

Welcome to the Coding Bot V6 - How To Contribute!

First off, thank you very much for considering contributing to the Coding Bot V6 project. Even if you decide not to contribute, you could always follow the project for updates and such.

Why you should read the guidelines?

First and foremost, this will respect the time of the people developing/contributing to the project and make it easier to finalize your pull request.

  • Other reasons:
    • To maintain code quality
    • To write readable and consistent code with regard to the style used in this project.
    • Making the Merge process much faster.

What kind of contributions are we looking for?

Coding Bot V6 is an Open Sourced project written in python and uses the library discord.py and we would love to receive contributions from our community! Anything, from fixing typos, to finding bugs, to improving code structure, to adding new features.

What kind of contributions we are not looking for?

Since the project is open source, we would like contributors to only adds/modify things relevant to the project. Any PR that push for irrelevant things will be closed and not be merged. E.g: PR #1 - By @Lexionas74

To Contribute to the project, please follow the following guidelines.

  • Make sure PEP 8 is being followed.

    • This includes:
      • One space gap while variable assignment or comparison. e.g: my_variable = 7, my_variable == 7
      • One space gap in arguments passed and parameters defined in a function. def call(param1, param2, param3), call(arg1, arg2, arg2)
      • Type hint parameters if possible, it helps the IDE to understand what type of parameter it is expecting and thus will list methods of that object
      • 4 Space (don't use tabs!) indents where required for consistency purposes
      • No camel cased variables for consistency purposes. E.g: instead of myVariable = 7 use my_variable = 7
      • Constants or global variables to be named in all capital, separated with _, e.g: MY_GLOBAL_VARIABLE, MY_CONSTANT
      • Naming variables properly according to their purpose. E.g: instead of x = 7, my_num = 7
  • Any extra database that is to be made for some purpose must create a connection inside __aenter__ method of Database class in ext/models.py and to reuse the connection, bot.conn.key must be used, where key is to be replaced with the key of the dictionary that holds all the open connections

  • All Websocket Event listeners are to go inside cogs/listeners.py. Instead of naming the function the name of the event, pass the event to @commands.Cog.listener('event') and name the function adhering to what it does in case of multiple events of the same name are required for two different purposes.

    E.g:

    @commands.Cog.listener('on_message')
    async def afk_listener(self, message: discord.Message):
        # rest of the code.
  • While making a PR (Pull Request), a clear title and description would be nice although not mandatory, it would make the merging process much faster.

  • Do not make a PR for adding irrelevant content.