Giter Site home page Giter Site logo

discord-chess-bot's Introduction

Discord-Chess-Bot

Chess-Bot Logo

Stars Badge Forks Badge Pull Requests Badge Issues Badge GitHub contributors License Badge

In this repository, you will find the source code for a Discord bot that is capable of hosting multiplayer chess games and Chess.com player information wrapper. Enjoy!


How to Use the Bot

Method 1: Invite Link:

In the case you are interested in just using the bot, you can invite the bot to your server by following this link.

Method 2: Running it Independently

Installation Instructions

You can download or modify the program by Cloning or Downloading the project or by saving it as a ".zip" file. Once the downloaded file is extracted into a separate folder, follow these instructions:

Discord.py + Other Dependencies Setup

  1. Use the command pip install Discord in cmd or terminal to install Discord.py 1.6.1 or the latest version.
  2. Use the command pip install chess.com in cmd or terminal to install Chess.com Wrapper 1.2.1 or the latest version.
  3. Use the command pip install chess in cmd or terminal to install python-chess 1.4.1 or the latest version.
  4. Use the command pip install cairosvg in cmd or terminal to install CairoSVG 1.1 or the latest version.
  5. Documentation for Discord.py could be found here.
  6. Documentation for Chess.com Wrapper could be found here and here.
  7. Documentation for CairoSVG could be found here.

Before Running

  1. Open token.txt and copy and paste the Discord Token so that the corresponding Discord bot is able to run the given program.

Running locally

In the case

  1. Open cmd and navigate to the directory where the source code for this project can be found.
  2. Once on the root directory of this project, run python filepath/local-bot.py

Hosting via Heroku

Via Heroku Git

  1. Log onto Heroku.
  2. Create a new application or open an existing application. Note the name of the application.
  3. Go to Settings > Add Build path > Python
  4. Install the Heroku CLI by following this link.
  5. Navigate to the directory of the bot.
  6. Create two files named Procfile and requirements.txt
  7. Initialize and commit all of the files in your discord bot directory into a git repository. Sign into heroku via the command line and push the git repository to heroku.
    heroku login
    heroku git:clone -a "NAME_OF_HEROKU_APPLICATION_GOES_HERE"
    git add .
    git commit -am “whatever commit text you want here”
    git push heroku master
    
  8. Turn our bot on from heroku dashboard.
  9. Navigate to the Bot Directory run echo > Procfile in that directory
  10. Edit requirements.txt to include the following: git+https://github.com/Rapptz/discord.py dnspython==1.16.0 PyNaCl==1.3.0 async-timeout==3.0.1
  11. Go to Heroku.com and go to Resources. Press Edit, and hit the sliding button so that it is on and hit Confirm.
  12. The bot should be active after a few minutes, and enjoy!

Via Heroku Website

  1. Log onto Heroku.
  2. Create a new application or open an existing application.
  3. Go to Deploy > Deployment method > Connect with GitHub and add this repository. You must have access to this repository on a Github account for this to work, or create your own and include all of the files found in this repository.
  4. Go to Deploy > Deploy Branch > Main Branch to depoly the recent version of the Main branch.
  5. Repeat steps 2-4 whenever the Main Branch is updated to have access the latest features of the bot.
  6. Go to Resources. Press Edit, and hit the sliding button so that it is on and hit Confirm.
  7. The bot should be active after a few minutes. Enjoy!

Contribute

Contributions are always welcome! Please create a PR and include a description of how your PR will improve the overall program and what it does. Making Contributions to a project guide.

License

This project is licensed under MIT license.

Support Us!

Give this repo a ⭐️ if you found this project helpful!

discord-chess-bot's People

Contributors

brandonhs avatar kaweees avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

discord-chess-bot's Issues

Getting this error

C:\Users\Yass\Desktop\Discord-Chess-Bot>py bot.py
Traceback (most recent call last):
File "C:\Users\Yass\Desktop\Discord-Chess-Bot\bot.py", line 179, in
client.run(getToken())
File "C:\Users\Yass\AppData\Roaming\Python\Python39\site-packages\discord\client.py", line 718, in run
return future.result()
File "C:\Users\Yass\AppData\Roaming\Python\Python39\site-packages\discord\client.py", line 697, in runner
await self.start(*args, **kwargs)
File "C:\Users\Yass\AppData\Roaming\Python\Python39\site-packages\discord\client.py", line 660, in start
await self.login(*args, bot=bot)
File "C:\Users\Yass\AppData\Roaming\Python\Python39\site-packages\discord\client.py", line 509, in login
await self.http.static_login(token.strip(), bot=bot)
AttributeError: 'NoneType' object has no attribute 'strip'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.