GithubHelp home page GithubHelp logo

taranvohra / bbot Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 4.0 927 KB

A small, fast and scaleable discord bot for conducting UT99 pugs and query UT99 servers ๐Ÿค–

License: GNU General Public License v3.0

TypeScript 99.88% Dockerfile 0.12%
pugs ut99 hacktoberfest

bbot's Introduction

A small, fast and scaleable discord bot for conducting UT99 pugs and query UT99 servers.

Manual Setup ๐Ÿ’ป

  1. Create a discord application (bot) from here
  2. This bot uses mongoDB as it's primary database. Create a free cloud database instance from here
  3. Install Docker from here
  4. Create a file locally named docker-compose.yml and paste contents from here
  5. In the same folder create a file locally named .env and paste contents from here
  6. Copy the Discord Bot Token from the bot created at Step 1 and paste it after = inside .env file
  7. Copy the database URI from the database created from Step 2 and paste it after = inside .env file
  8. On your terminal/cmd run docker-compose up -d ๐ŸŽ‰

Commands ๐Ÿ“œ

Before you continue ๐Ÿง

Commands denoted by ๐Ÿฑโ€๐Ÿ‘ค are privileged meaning the user must have a role named bBot to be able to use that command.

Commands denoted by ๐Ÿ˜ธ can be used by everyone.

General

register ๐Ÿฑโ€๐Ÿ‘ค
Usage -> .register

Registers your discord server with bBot. This is the first command you should be using after the bot is invited to your discord server.

setpugchannel ๐Ÿฑโ€๐Ÿ‘ค
Usage -> .setpugchannel

Typing this command in a channel will mark that channel to be used for pug commands.

setquerychannel ๐Ÿฑโ€๐Ÿ‘ค
Usage -> .setquerychannel

Typing this command in a channel will mark that channel to be used for query commands.

ignorecommandgroup, igc ๐Ÿฑโ€๐Ÿ‘ค
Usage -> .ignorecommandgroup group

All ignorable commands are classified into 2 groups, namely, pugs and queries. If for instance you do not want query commands from the bot and only care about the rest of it then you can ignore the queries group.

unignorecommandgroup, uigc ๐Ÿฑโ€๐Ÿ‘ค
Usage -> .unignorecommandgroup group

To unignore a command group which was previously ignored.

warn ๐Ÿฑโ€๐Ÿ‘ค
Usage -> .warn @mention#0000 reason

Warns an user. Simultaneously, creates a log entry for auditing purposes.

logs ๐Ÿฑโ€๐Ÿ‘ค
Usage -> .logs @mention#0000

Shows the last 10 logs of the mentioned user.

invite ๐Ÿ˜ธ
Usage -> .invite

Generates an invite for your server with no expiry and unlimited uses. If such an invite already exists, it re-uses that.

Pugs

addgametype, agm ๐Ÿฑโ€๐Ÿ‘ค
Usage -> .addgametype name totalPlayers totalTeams

Creates a new gametype which can be now pugged.

Note that totalTeams must be less than 4 due to UT99 supporting 4 team colors only OR mix if it's a mix gamemode

deletegametype, dgm ๐Ÿฑโ€๐Ÿ‘ค
Usage -> .deletegametype name

Deletes an already present gametype.

Note that if there is atleast 1 user joined for the gametype then this command will not work until the list is cleared.

defaultjoin ๐Ÿ˜ธ
Usage -> .defaultjoin gametype1 gametype2 etc

Stores your default preference for joining pugs

list, ls ๐Ÿ˜ธ
Usage -> .list gametype or .list

There are 2 versions of this command, with gametype and without.

  • If gametype is mentioned then it will show all the users who have currently joined the gametype
  • If gametype is not mentioned then it will summarise all the gametypes with their names and a count of number of players joined / max players

liast ๐Ÿ˜ธ
Usage -> .liast

Combination of list and last.

lsa ๐Ÿ˜ธ
Usage -> .lsa

Shows the list of all gametypes with users who present.

join, j ๐Ÿ˜ธ
Usage -> .join gametype or .j

There are 2 versions of this command, with gametype and without.

  • If gametype is mentioned then it will join that particular gametype.
  • If gametype is not mentioned then it will join all gametypes saved in your default join preferences.

leave, lv, l ๐Ÿ˜ธ
Usage -> .leave gametype

Removes yourself from the gametype.

lva ๐Ÿ˜ธ
Usage -> .lva

Removes yourself from all gametypes that you've joined.

promote, p ๐Ÿ˜ธ
Usage -> .promote gametype or .promote

There are 2 versions of this command, with gametype and without.

  • If gametype is mentioned then it will promote that particular gametype.
  • If gametype is not mentioned then it will promote all gametypes with atleast 1 user joined sorted by the least number of users required to fill that pug.

Since this command makes use discord's @here usage, then in order to counter spam, users can be given a COOLDOWN role which will prevent them from using the command once every 120 seconds.

captain, capt ๐Ÿ˜ธ
Usage -> .captain

Adds you to the list of captains of the filled pug. Team color is RNG.

picking ๐Ÿ˜ธ
Usage -> .picking

Shows the current picking states of filled pug(s).

pick, p ๐Ÿ˜ธ
Usage -> .pick index index2(?)

Picks at the user at the mentioned index and add them to your team. index2 can be specified if bot asks you to pick 2 players.

๐Ÿ’ฒ Bonus Usage ๐Ÿ’ฒ You can do a random pick by typing random instead of the index.

tag ๐Ÿ˜ธ
Usage -> .tag info

Adds meta information about yourself in all the pugs you've joined.

For example if you have no microphone then you can tag yourself .tag nomic. This will help the captains later while picking and making a decision.

stats ๐Ÿ˜ธ
Usage -> .stats or .stats @mention#0000

There are 2 versions of this command, with mentioned user and without.

  • If user is mentioned, then it will show the stats of the mentioned user.
  • If user is not mentioned, then it will show your own stats.

last ๐Ÿ˜ธ
Usage -> .last gametype or .last

There are 2 versions of this command, with gametype and without.

  • If gametype is mentioned, then it will show the last pug played for that specific gametype.
  • If gametype is not mentioned, then it will show the last pug played irrespective of any gametype.

๐Ÿ’ฒ Bonus Usage ๐Ÿ’ฒ You can go beyond last by specifying a number after last like last3 or add that many t characters like .lasttt

top10played ๐Ÿ˜ธ
Usage -> .top10played gametype

Generates an image of top 10 puggers for the gametype (sorted by most number of pugs played for the gametype).

pugstats ๐Ÿ˜ธ
Usage -> .pugstats

Outputs a summary of total number of pugs played, individual pug count(s) and a timestamp when the first pug was played

autoremove, ar ๐Ÿ˜ธ
Usage -> .autoremove expiry(?)

Automatically removes the user from all the pugs they have joined after expiry. Note that If no expiry is provided, it clears your autoremoval request (if any).

โฒ Expiry Parameters โฒ m for minutes or h for hours or d for days.

For example, .autoremove 30m will automatically remove the user from all the pugs after 30 minutes. .autoremove will clear your autoremoval request.

add ๐Ÿฑโ€๐Ÿ‘ค
Usage -> .add @mention#0000 gametype1 gametype2 etc

Adds the mentioned user to the list of specified gametypes.

remove ๐Ÿฑโ€๐Ÿ‘ค
Usage -> .remove @mention#0000 gametype1 gametype2 etc

Removes the mentioned user from the list of specified gametypes.

forcepick ๐Ÿฑโ€๐Ÿ‘ค
Usage -> .forcepick @mention#0000 index

Picks the player at the specified index for mentioned user's team.

reset ๐Ÿฑโ€๐Ÿ‘ค
Usage -> .reset pugname

Resets the pug back into picking mode if it was filled.

block ๐Ÿฑโ€๐Ÿ‘ค
Usage -> .block @mention#0000 duration reason

Blocks the mentioned user from joining pugs for a certain period of time.

โฒ Duration Parameters โฒ m for minutes or h for hours or d for days. For example, .block @mention#0000 1d xyz reason will block the mentioned user for 1 day.

unblock ๐Ÿฑโ€๐Ÿ‘ค
Usage -> .unblock @mention#0000

Unblocks the mentioned user.

showblocked ๐Ÿฑโ€๐Ÿ‘ค
Usage -> .showblocked

Shows the list of blocked users.

blockcaptain/blockcapt ๐Ÿฑโ€๐Ÿ‘ค
Usage -> .blockcaptain @mention#0000 reason

Blocks the mentioned user from becoming a captain in pugs.

unblockcaptain/unblockcapt ๐Ÿฑโ€๐Ÿ‘ค
Usage -> .unblockcaptain @mention#0000

Unblocks the mentioned user from becoming a captain in pugs.

showblockedcaptain/showblockedcapt ๐Ÿฑโ€๐Ÿ‘ค
Usage -> .showblocked

Shows the list of blocked captains.

enablecoinflip ๐Ÿฑโ€๐Ÿ‘ค
Usage -> .enablecoinflip gametype

Enables coin flip feature for the specified gametype (for mapvote purposes).

When the picking finishes, it will randomly decide which team won mapvote.

disablecoinflip ๐Ÿฑโ€๐Ÿ‘ค
Usage -> .disablecoinflip gametype

Disabled coin flip feature for the specified gametype.

teamemojis ๐Ÿฑโ€๐Ÿ‘ค
Usage -> .teameojis emoji gametype

Sets the preferred teamemoji for the gametype. emoji can be one of agonies, cores or logos.

Note that if gametype is omitted then the default is change it for ALL gametypes.

setpickingorder ๐Ÿฑโ€๐Ÿ‘ค
Usage -> .setpickingorder gametype pickingOrder

Enforces a custom picking order for the gametype. An example of a picking order for a gametype with 2 teams is 1 2 2 1 1 2 2 1. It goes like Red picks first, then blue picks 2 times then red picks 2 times then blue picks 2 times and finally last pick goes to red

Red - 1
Blue - 2
Green - 3
Gold - 4

Note that this command does not work for DUEL/MIX/DM gametypes.

Queries

addqueryserver, aqs ๐Ÿฑโ€๐Ÿ‘ค
Usage -> .addqueryserver address name

Adds a query server to the list of query servers.

deletequeryserver, dqs ๐Ÿฑโ€๐Ÿ‘ค
Usage -> .deletequeryserver index

Deletes the query server at the specified index from the list.

editqueryserver, eqs ๐Ÿฑโ€๐Ÿ‘ค
Usage -> .editqueryserver index attribute newValue

Edits the query server at the specified index in the list.

๐Ÿ“‘ Attributes ๐Ÿ“‘ name for editing name, address for editing address.

servers, server ๐Ÿ˜ธ
Usage -> .servers

Shows the list of query servers.

query, q ๐Ÿ˜ธ
Usage -> .query index or .query customAddress

There are 2 versions of this command, with index and with custom address.

  • If index is specified, it will query the query server's address at the specified index.
  • If custom address is specified, it will query that specific address.

ip ๐Ÿ˜ธ
Usage -> .ip index

Prints the address of the query server at the specified index in the list.

bbot's People

Contributors

taranvohra avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

bbot's Issues

.pugstats

Shows total number of pugs played at the server, list of each gametype and it's count and maybe a timestamp denoting when the first pug was played

Feature Request

hi man is possible to add some idle time when captains are picked we need something like type .here or be kicked in 30 seconds, its a big problem when admins are not arround plus this keeps the people more active when the pug fills up.

Forbid Captains

A list of players forbidden from becoming a captain (either manually or automatically). If for a certain pug, the forbidden list is greater than equal to the required percentage of players needed to form a captain pool then player(s) will be temporarily added to the captain pool in order for the algorithm to succeed.

How to install?

Hi guys!
I did exactly what the setup says, but when I write .register, nothing happens.
Any help?

.liast not working

I am having trouble using the discord bBot

when I want to view list and the last completed pug with .liast, it says "Command not found" / "invalid command" and nothing shows

"mix" gametype

When a "mix" gametype is filled, the first person in the list fields their own team and the remaining are against that team.

No picking needed, Number of teams can be replaced with the keyword mix

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.