Click me!
Instructions for cloning with git (recommended)
- Open a terminal and navigate to the directory where you want to clone the repo.
- Run the following commands:
git clone https://github.com/Okaneeee/SWCodes.git cd SWCodes
Instructions for zip downloading
- Click on the green
Code
button and selectDownload ZIP
or click here. - Extract the zip file to the directory where you want to clone the repo. Or in Linux:
sudo apt-get install unzip sudo unzip SWCodes-main.zip -d SWCodes
- Open a terminal in the folder where you extracted the zip file and run the following command:
cd discord-chatbot
This repo was made with Python 3.11.9
. So you'll need to install python. You can check the working versions of Python for this repo here.
The repo uses some dependencies. You can install them by running the following command:
Windows:
pip install -r requirements.txt
Linux:
pip3 install -r requirements.txt
You'll need to setup a .env
file first. The .env
need to be on the same folder as the repo. You can use the following template, or you can rename the .env.example
file to .env
.
TOKEN =
OWNERID =
TOKEN is the bot token you get from the Discord Developer Portal.
More information here.
OWNERID is the ID of the owner (you). You can get your ID by right-clicking your name in Discord and selecting Copy ID
.
More information on how to get your ID here.
After, you'll need to add your bot to your server.
Finally, you can run the bot by running the following command:
python src/main.py
You'll need first to stop the bot by pressing CTRL + C
in the terminal where the bot is running.
If you cloned the repo when you did the installation, you can update the repo by running the following command:
git pull
If you downloaded the repo as a zip file, you can download the new version by following the same installation steps you did before.
After, unzip the file using the following command in the same directory as the zip file:
sudo unzip SWCodes-main.zip -d SWCodes
and type A
to replace all the files.
Finally, you can run the bot again by doing:
cd SWCodes
python src/main.py
/help
Shows the help message with all the commands listed.
/usecode [hiveid] [code]
Use a code on an account.
/registerid [hiveid]
Register your Hive ID (linked in the database with the Discord ID of the command invoker).
/unregisterid [hiveid]
Unregister your Hive ID (only the one who registered it can unregister it).
/trigger [code]
Trigger a code on all registered Hive IDs.
ONLY THE OWNER CAN USE THIS COMMAND.
I will be maintaining this repo for a long time. I will be fixing eventual bugs and do the necessary changes in case of a new Discord API update, a new Python version or if the Summoners War API changes.
I will also be updating the dependencies with Dependabot.
Version | Done | Status |
---|---|---|
Python 3.10 | ✔ | |
Python 3.11 | ✔ | |
Python 3.12 | ✔ |
Actions | Done | Status |
---|---|---|
CodeQL | ✔ | |
Dependabot | ✔ |
This project is licensed under the MIT License - see the LICENSE file for details.
This include all contributions to the project, even from the community.
Copyright © 2024 Okaneeee | Anatole