Code Monkey home page Code Monkey logo

beardlessbot's Introduction

Beardless Bot

Full Release 2.4.2 Coverage badge Unit tests badge Docstring coverage badge flake8 badge

A Discord bot supporting gambling (coin flips and blackjack), a currency system, fun facts, and more.

Originally created for use in eggsoup's Discord server.

If you just want to add the bot to your own Discord server while I host it, you can simply click this link, then skip down to Setup. If you want to run your own instance of Beardless Bot, follow the steps outlined directly below in Installation.

Installation

  1. Download the repository.

  2. Download Python 3, and then run pip3 install -r resources/requirements.txt. Beardless Bot requires Python 3.10 or newer, and has been tested on 3.10.4, 3.11.9, and 3.12.3. If you are using python virtualenv, name your virtualenv "venv" and run source venv/bin/activate before running pip3 install.

  3. Create a file named ".env" in the same directory as Bot.py. Insert into it the line DISCORDTOKEN=yourtoken, where yourtoken is the Discord API token you get from here.

  4. As of Full Release v1.3.0, Beardless Bot supports calls to the Brawlhalla API. If you don't have an API key, those commands will simply be disabled; the Bot will work fine. If you do have an API key, place it in .env as BRAWLKEY=yourkey. If you want to fork this repo and have Brawlhalla commands covered by unit tests, you'll need to define a repository secret with the name BRAWLKEY. For more information, see this guide.

  5. Run python3 Bot.py to start the bot.

Setup

  • To use the !spar command, create a channel named looking-for-spar.

  • To use Beardless Bot's event logging, create a channel named bb-log.

  • To use special colors, create roles named special red, special blue, special pink, and special orange.

Contributing to Beardless Bot

Interested in improving Beardless Bot? Great! If you have an idea, feel free to open a Pull Request with an explanation of what your changes accomplish. There are also several issues open in the Issues tab that could use someone tackling them. Please make sure your code is PEP8 compliant (except for tabs), with a column limit of 80.

Testing

To run Beardless Bot's suite of unit tests, do bash unitTests.sh. This will also generate a coverage badge. To run an individual test--for instance, the Muted role creation test--use the pytest command, like so: pytest -v bb_test.py::test_createMutedRole. To run the suite of code quality tests, do pytest -vk quality.

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

beardlessbot's People

Contributors

apoorvaramak avatar criticalhunter avatar levbernstein avatar noittam avatar punit-choudhary avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

beardlessbot's Issues

Migrate to Nextcord

Development has ceased on discord.py. Nextcord, a successor to and superset of discord.py, looks like a good alternative.

Convert getClan to a single API call

Currently, getClan requires two calls to the Brawlhalla API: one to get clan ID from player stats, and another to get clan info from clan ID. As a result, it runs at half the speed of the other commands that make API calls.

specific users' money not updating properly

For some reason, when using the bot for BeardlessBucks it does not update the CSV containing everyone's current balance properly. This issue has been encountered by multiple users. I can provide screenshots if necessary. Personally, I know that my balance is supposed to be 679809237 while Apoorva's balance is supposed to be 0.

!blackjack does not report for unregistered users

Will take a loot at this in the morning; likely due to using the wrong value for authorstring or tempname. If that is the issue, it can be fixed by replacing with text.author.id or text.author, depending on location.

Single quotation mark breaks argparse

For commands that take an arg, any arg featuring exactly one " will break the command. Prompts either an UnexpectedQuoteError or ExpectedClosingQuoteError depending on the circumstances. Can likely be fixed by adding a conditional in on_command_error(); just needs to inform the user.

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.