/Gamba

A bot to create predictions based on Twitch Channel Points Predictions.

Primary LanguageJavaScriptMIT LicenseMIT

Gamba

Gamba

Gamba is a Discord bot to create predictions based on Twitch Channel Points Predictions.

Getting Started

You can invite Gamba to your Discord server. Or, you can download the source code and run the bot yourself.

Prerequisites

Use the latest package manager Node.js to install Gamba.

npm install npm@latest -g

Create or have an existing Discord account at Discord.

Installation

  1. Log in to the Discord Developer Portal.
  2. Click on the "New Application" button located at the top right.
  3. Give the application a name and click Create.
  4. Under Bot, copy the Token of the bot.
  5. Locate Privileged Gateway Intents, and enable Presence Intent and Server Members Intent.
  6. Under OAuth2 > General, copy the Client ID of the bot.
  7. Under OAuth2 > URL Generator, select bot and application.commands for scopes and Administrator for bot permissions. Copy the generated URL at the bottom of the page.
  8. Clone the repository:
    git clone git@github.com:tobyjzstay/Gamba.git
  9. Install NPM packages in the cloned repository:
    npm install
  10. Create a file named config.js at the root level and copy the following:
    {
        "clientId": "<Client ID>",
        "token": "<Token>",
        "path": {
            "points": "./data/points/",
            "predictionsActive": "./data/predictions/active/",
            "predictionsArchive": "./data/predictions/archive/"
        }
    }
  11. Run the bot:
    npm start
  12. Invite the bot to your Discord server with the generated URL.

Usage

Command Description
/gamba Lists all active predictions
/points [user] Get points
/leaderboard [role] [results] Show points leaderboard
/predict <id> <index> <amount> Predict with points
/prediction <id> Show a prediction
/create <name> <option1> <option2> [minutes] [hours] [days] Create a new prediction
/close <id> Close a prediction
/end <id> <index> End a prediction
/cancel <id> Cancel a prediction

License

MIT