Skip to main content

Faultybot Discord Handler

Project description

Faultybot

Python JavaScript PHP

VS Code Pycharm

Git

Technical fundamentals

To use the bot you need a Discord bot and a Lichess account. We recommend creating another new account for this purpose. The account is only important if you want to kick people. Otherwise you don't need a Lichess account. The presence of Python is required.

Create a Discord bot

Lichess bots can be created on the Discord Developer page. Since this is a different topic, we recommend the video from freeCodeCamp. It is linked at the end of this text. Of course, the bot must also be invited to their server and be able to write there. But this is your responsibility. YouTube Video about Discord Bots

Lichess Bot

If you decide to use a Lichess bot, you will need to generate an OAuth2 token or an API token. Actually it doesn't matter what rights it has. However, for the project at hand, it must have the right to act in the team.

team:write

Installing the bot

Clone git

You can download the git simply by using the command git clone. Please use the master branch

git clone https://github.com/jplight/faultybot.git

Pip install

Actually, pip should already be there. If this is not the case, I will give a short instruction here. Simply copy the following commands into a shell or CMD. The instructions are only for Windows users. Linux and Mac users know everything better and therefore don't need them.

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py

Installation of the pip suspensions

This is also done with a simple console input.

pip install -r client\requirements.txt 

Please note that the requirements file is located in the subfolder client.

Creating the Config File

Create a file named ftpdata.py in the subfolder client. Please use the syntax below and enter your values. You can obtain the FTP data from your website hoster. They are needed to transfer the cheater lists to the server.

# FTP 
user = "DATA"
pwd = "DATA"
port = "DATA"
url = "DATA"

# Lichess
bot_token = "DATA"

Server Config

I assume at this point that you own a web server and know how to use it.

Upload Files

Please upload the files from the Server folder to the Web Server. PHP7 (, JavaScript and CSS as well as SCSS) are required there. However, this is by far not a special feature. I write the JS files here because there are hosters who reject these file formats. I am aware that CSS and JS are executed locally.

FTP scope

Create another FTP account. This should only have access to the flag folder. This data is important for the config file created earlier. The bot then creates a *.txt file and writes it to the server via FTP. This would otherwise be too much for the output. That's about it. The bot automatically generates the links and then sends them to the user via a message.

How to use the bot

To view all players who have violated the TOS, write the following in the chat with the bot. The bot only searches for new cheaters every 4 hours after the last call. That would otherwise generate too much traffic. The flag "new" can be used to circumvent this.

>faulty >>TEAM-ID<< 

However, if they want to kick players, write the following:

>kickfaulty >>TEAM-ID<< >>TOKEN<< 

Please note that only one token can be uniquely assigned to a bot at a time. This bot must then also be TeamLeader in the desired team. This means that you cannot kick people all over the place. You can only do that in your teams.

Have Fun

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

faultybot-0.0.2.tar.gz (8.0 kB view hashes)

Uploaded Source

Built Distribution

faultybot-0.0.2-py3-none-any.whl (8.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page