Giter VIP home page Giter VIP logo

core-bot's Introduction

core-bot

The corest of Discord bots

Commands

Quotes

  • !quotes: To get a dump of all available quotes, in JSON format.
  • !quotes add <text>: To add a new quote to the bot. You can enclose the input in double quotes if you prefer, but it is not necessary. This command will return the quote ID.
  • !quotes remove <id>: To remove an existing quote from the bot.

Triggers

  • !triggers: To get a dump of all current trigger words, in JSON format.
  • !triggers add <text>: To add a new trigger word to the bot. You can enclose the input in double quotes if you prefer, but it is not necessary. This command will return the trigger ID.
  • !triggers remove <id>: To remove an existing trigger from the bot.

Development

Prerequisites

  • NodeJS
  • Active Discord application with bot user capability, go here to register one
  • Either an Azure Cosmos DB account, or the Azure Cosmos DB emulator
  • Active Google Cloud account (for natural language APIs)
  • Any Discord server to invite the bot to, for testing purposes

Database

The bot uses Cosmos DB to manage its trigger words and messages. On startup, it creates a corebot database (if not created already) with two containers, quotes and triggers.

Environment

To debug the bot locally, you must set these environment variables:

  • BOT_TOKEN (you can grab it from the Discord developer portal, in the Bot section of your application)
  • COSMOS_ENDPOINT
  • COSMOS_KEY
  • NODE_TLS_REJECT_UNAUTHORIZED (only when using Azure Cosmos DB emulator; set to 0 if you have issues with the self-signed certificate from the emulator)
  • GOOGLE_APPLICATION_CREDENTIALS (must point to a local JSON file containing your service account key, more info here https://cloud.google.com/natural-language/docs/setup#auth)

Once configured, run:

$ npm i
$ npm start

You can invite the bot to your server with this link https://discord.com/oauth2/authorize?scope=bot&client_id=<BOT_ID>. The bot ID can be retrieved from the Discord developer portal, in the Application section (it's called Application ID).

core-bot's People

Contributors

etiennebolduc avatar

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.