Skip to content

SW Codes is a discord bot to facilitate the use of codes on the mobile game Summoners War

License

Notifications You must be signed in to change notification settings

Okaneeee/SWCodes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sw logo

🔖 SW Codes 🔖

Table of Content

Click me!

Getting Started

Installation

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 select Download 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

Quick Start

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

Updating

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

Commands

  • /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.

Long-Term Support (LTS)

As the developer

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.

Dependencies

Version Done Status
Python 3.10 Python 3.10
Python 3.11 Python 3.11
Python 3.12 Python 3.12

Code Quality & Security

Actions Done Status
CodeQL CodeQL
Dependabot Dependabot

References

Copyright

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

About

SW Codes is a discord bot to facilitate the use of codes on the mobile game Summoners War

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages