-
Notifications
You must be signed in to change notification settings - Fork 1
How to Contribute
There are many ways to contribute to the MK Bot project: logging bugs, submitting pull requests, reporting issues, and creating suggestions.
After cloning and building the repo, check out the issues list. Issues labeled help wanted
are good issues to submit a PR for. Issues labeled good first issue
are great candidates to pick up if you are in the code for the first time. If you are contributing significant changes, please discuss with the assignee of the issue first before starting to work on the issue.
In order to download necessary tools, clone the repository, and install dependencies
You'll need the following tools:
Tip
It is recommended to install poetry
as follows.
python -m pip install --user pipx
python -m pipx ensurepath
pipx install poetry
- msbuild, at least version 16.5 (Optional)
- Visual Studio Code (Optional)
- FFmpeg (Optional)
Note
You need to install FFmpeg
to use voice.
- Inno Setup, at least version 6.2 (Optional)
First, fork the MK Bot repository so that you can make a pull request. Then, clone your fork locally:
git clone https://github.com/<<<your-github-account>>>/mkbot.git
Occasionally you will want to merge changes in the upstream repository (the official mkbot repo) with your fork.
cd mkbot
git checkout main
git pull https://github.com/mgylabs/mkbot.git main
Manage any merge conflicts, commit them, and then push them to your fork.
- Enter the following commands in terminal.
.\scripts\dep.bat
.\scripts\prepare.bat
./scripts/dep.sh
./scripts/prepare.sh
- Edit
config.json
,mgcert.json
atsrc\data
directory.
- config.json
{
"discordToken": "Your Bot TOKEN",
}
- mgcert.json
{
"adminUsers": ["admin_username#0000"],
"trustedUsers": ["trusted_username#0000"]
}
Enter the following a command in a terminal:
poetry run python mkbot.py
Important
Console + Discord Host builds are only supported on win32-x64
.
- Enter the following commands in terminal.
cd mkbot
.\scripts\dep.bat
- Go into
vscode
, press Ctrl+Shift+B and selectbuild
to start the build task.
.\scripts\mkbot.bat
- Open the vscode repository folder.
- Choose the
Python: mkbot.py
launch configuration from the launch dropdown in the Debug viewlet and press F5. - Enter the following command in a terminal:
poetry run python mkbot.py --debug
Note
Run discord_host
with the above command, and when the python files in the src
folder are changed, the discord_host
is automatically restarted.
Tip
To use discord_host
that automatically reloads changes to Python files without using a debugger, enter the following command in the terminal:
poetry run python mkbot.py
Run the tests directly from a terminal by running poetry run pytest
from the mkbot
folder.
If your changes contain dependency changes, you should perform manual testing in packaged application as follows:
- Go into
vscode
, press Ctrl+Shift+B and selectTest in Packaged Application
to manually test packaged application. - If there are errors caused by the dependency changes, you may need to add hook files. See, Add hook files for more details.
A hook file is a Python script, and can use all Python features. It can also import helper methods from PyInstaller.utils.hooks
and useful variables from PyInstaller.compat
.
The name of a hook file is hook-full.import.name.py
, where full.import.name is the fully-qualified name of an imported script or module. You can browse through the existing hooks in the hooks
folder of the PyInstaller distribution folder and see the names of the packages for which hooks have been written. For example hook-PyQt5.QtCore.py
is a hook file telling about hidden imports needed by the module PyQt5.QtCore
. When your script contains import PyQt5.QtCore
(or from PyQt5 import QtCore
), Analysis notes that hook-PyQt5.QtCore.py
exists, and will call it.
The hook files of the MK Bot project is located in src/hooks
.
See, Understanding PyInstaller Hooks for more details.
from PyInstaller.utils.hooks import collect_dynamic_libs
binaries = collect_dynamic_libs('module_name')
from PyInstaller.utils.hooks import collect_data_files
datas = collect_data_files('module_name')
hiddenimports = ['hidden_module_name']
MK Bot can be packaged for the following platform: win32-x64
- When
build
task is complete, press Ctrl+Shift+B and selectpackage
. - Run
MKBotSetup-Pre.exe
to install MK Bot.
Note
If you install MK Bot manually, MK Bot will not auto-update when new builds are released so you will need to regularly build and install from source to receive all the latest fixes and improvements.
© 2025 Mulgyeol Labs