Hello there! If you're reading this, then you're probably interested in contributing to this project. This document will guide you through the process of contributing to this project.
This guide is intended for those who want to contribute to the code development of this project. If you're looking for other ways to contribute, please read Other Ways to Contribute section.
You obviously need to fork this repository and clone it to your local machine.
Then you may read the any documents related on contributing, you can find most
of the documents in tests
, modules
, extensions
, and classes
directory
on README.md
file. Each classes and modules has been heavily documented
regarding their usage and implementation.
"why not make a docs web?" you may ask... I personally don't think it's necessary to make a docs web for this bot, as it's not a library or framework that needs to be documented. It's just a bot, and I think it's better to read the documentation directly from the class, module, or function itself.
You may also accepts Code of Conduct and LICENSE regarding your contribution and modification.
You need to know some stuff about what we've been doing in this bot:
- All 3rd APIs were separated to each file in
classes
directory as... class. - All data spit by API are dataclasses, unless it's not possible as some key may not documented properly, missing, or... both (im looking at you, SIMKL).
Enum
is basically fancierLiteral
, and you can assign synonym with same value. However, this is not mandatory, but highly recommended.- Classes must have their own test file in
tests
directory. - Classes must be run with
with
statement to ensure the connection onaiohttp
is closed properly. - Classes should have auto caching mechanism saved as JSON file in
cache
directory, unless if the method is always changing, such asget_user
method. - All commands were grouped and placed in
extensions
directory. - Classes, functions, methods, immutable variables, or even the script itself are documented with docstrings.
- All functions and variables must be statically typed to prevent any unexpected errors.
- Naming convetions:
UpperCamelCase
for classes, dataclass, and enumUPPER_SNAKE_CASE
for immutable variablessnake_case
for functions, methods, mutable variables, and file namelowercase
for extension file namespaced lowercase
for command name, consist of:command
* the command namegroup
* the command groupsubcommand
* the subcommand name
- Project must pass all tests and CI/CD before merging to branch.
Before you can start developing the bot, you need to install additional dependencies. Execute the following command:
pip install -U -r requirements-dev.txt
-
Create a new file in the
extensions
directory with the following format:import interactions as ipy class Example(ipy.Extension): def __init__(self, bot): self.bot = bot @ipy.slash_command( name="example", description="Example command", ) async def example(self, ctx: ipy.SlashContext) -> None: await ctx.send("Example") def setup(bot): Example(bot)
-
???
-
Run the bot via
python main.py
and test the command. -
Profit!
- Create a new file in the
classes
directory - Read carefully the instruction written in
classes/README.md
- Write test script in
tests
directory then run it - Integrate the class to the commands if test passed
You can easily do all that stuff by just running dev.py
script.
python dev.py
However, autoformat the scripts requires your confirmation, as default
configuration of this repo is based on DeepSource's configuration, which
is a lot different than the default configuration of autopep8
.
If you acknowledge the risk, type y
if asked.
If you're not interested in contributing to the code development, you can contribute in other ways, such as:
If you found any bugs, please report it to the Issues section. Please make sure that the bug you're reporting is not a duplicate of existing issue.
Suggesting new features is also a way to contribute to this project. You can suggest new features by following similar steps as Reporting Bugs.
Found any typos or grammatical errors in the documentation? You can fix it by submitting a pull request to this repository... Though, you can also just report it if you're confused on how to fix it.
If you're interested in donating to the project, you can do so by pressing ❤️ Sponsor button on the top of this page. You can also donate to the project by sending some money to my PayPal or Ko-fi.
Kewarganegaraan Indonesia dan tinggal di Indonesia? Kamu bisa juga donasi ke Trakteer atau Saweria.
By starring this repository, you're helping this project to be more visible to other people. This will also help the project to be more popular, and more people will use this bot.
Whatever you do, we appreciate your contribution to this project! 😉