Code Monkey home page Code Monkey logo

g5-bot's Introduction

G5 Bot

Discord Bot Supplement for Get5-Web

This bot is meant to be used in supplement with Get5-Web or as a standalone 10man gathering bot.

What does it do?

G5 Bot will allow you to create an organize ten mans, moving people to respective voice channels, and hound people to ready up after reaching a certain amount. It will be able to do vetoes within Discord via reactions, so you can avoid the hassle of setting up a server only having to go tgrough vetoes in-game. As a standalone bot, it is very limited as it will only work on the Discord side, moving people and creating teams. The real features come from the integration with the Get5-Web database.

Ideally, when the teams are created, a match will inserted into the database, and vetoes and server selection will be done through the Discord, via reacts based on the bots output. It will query the database for any available public servers, check if they're online, and add them to the list of available servers (or pick the first available, haven't decided). Once vetoes and server has been selected, the bot will send a few rcon commands to the server to setup the match, and present you with the match page, ready to connect!

How do I run it?

python3 -m venv venv
source venv/bin/activate
python3 -m pip install requirements.txt
cp settingsTemplate.ini > settings.ini

If you wish to have full functionality, and you have Get5-Web installed on your system, input the get5 database user, port, host, and database name located in the [DATABASE] section of the INI file. Get your Discord bot token, channels, mentionable roles, etc. inputted and simply run the bot with python bot.py. This will launch the bot with the given settings and you should be good to go! If no database is supplied or it fails to connect, it will automagically remove the get5 functionality, so you can use it just as a regular bot to setup teams and decide on a map!

This bot is currently in its alpha stages, and not all of the functionality has been inputted, nor tested. Please do file bug reports, and I will look into them when I have time. Pull Requests are always welcome!

Thanks

meeoh for his initial implementation of a discord 10man bot!

bboychris168 for helping me with some Discord.py functionality!

g5-bot's People

Contributors

dependabot[bot] avatar phlexplexico avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

g5-bot's Issues

[BUG] Veto System Not Working

After making the server selection it seems captains are nulled out. This causes issues where people cannot continue vetoing.

Proper Explanation of Config

Probably best to completely explain what everything in the config does through a wiki article or something, just so it's easier to reference.

[FEATURE] Leaderboard Cog

Since a leaderboard is incorporated into G5V, it really doesn't make much sense for the bot to show a leaderboard. However, some people may wish to roll with the API and Bot only. So this issue is to track as a future feature to enabled a [p]leaderboard call that would get the top players in a pug. This may also require a new call from the G5API too, if it isn't there.

Move Config Parser to own file

Instead of calling it a bunch, maybe it's best to put it in cogs/utils as well so we can just import it instead of instantiating it every time we create a new cog? Saves some lines.

[Feature Enhancement] Enable Check Auths

From #5.

The plan for this enhancement will gather the connected Steam IDs from people's Discord accounts. It will be required for a user to join a match. Each time the match is created and the teams are chosen, the bot will update the auths blob in the team table to each SteamID on the teams. That way, we can keep get5_check_auths 1 in the live.cfg or knife.cfg so when users join in warmup, there won't be restrictions.

Also included will be an admin only command (and consequently, a new setting in the file) that will allow users to add steam64 IDs to the server after the fact (if a user does not have a steam account linked). It should be something like [p]matchadd team1/2 STEAM64 which will add the user to a given team, sending the command via Rcon.

This is definitely something good for someone to work on if they want to get their feet wet with Python, Peewee, and Rcon commands within a discord.py wrapper. I'll probably start work on this, and may comment some of the gotcha's here as well.

[Enhancement] Rewrite Bot to Be Multi-server friendly

Right now the bot is only able to process one server per instance. It can only accept one room, two voice channels, one group and one guild. A good feature to start incorporating would be to remove all these settings from the settings.ini file, and move them into the sqllite database. That way, the bot could join a server, and go through a whole setup shpiel to allow for use in multiple servers across a single instance.

This basically will require yet another re-write of the bot, including some of the logic for checking the globals.py (which would now be stored as an object for each captain/team/etc. Most likely as such:

{
  "guildID": {
    "captain": "discordID",
    "team1": ["list", "of", "ids"],
  }
}

Or something to that extent.

Create Veto Cog

Preferable to veto through reactions to avoid chat clutter, especially if others are typing too.

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.