Coder Social home page Coder Social logo

alpaca-work-bot's Introduction

Discord Test Bot

This is a simple Discord bot project already configured to work by just following some steps:

  1. Follow the instructions in Step 1 to create your own bot using your Discord accout and generate a Token
  2. Create an .env file and paste your token using the .env.dist variable name given BOT_TOKEN=YOUR_TOKEN.
  3. Invite the bot to your Discord channel and run it using npm run start or npm run dev.

To create new functions just replicate some of the files in the handlers folder and import it in index.js.


Using Firebase Admin SDK

In order to connect your project with Firebase you should first download your admin credentials in json format from Firebase Control Panel.

Update the environment variables in the same order as they are in env.dist but in your own .env file to connect with the firebase services you want to use.


Available Commands

  • !!help => Returns all available commands.
  • !!subjects => Returns all subjects some user has worked on.
  • !!latest => Returns the latest work session for this user.
  • !!me => Returns user id, username and discriminator.
  • !!ping => Returns the bot answer latency and a link to download your current user avatar.
  • !!start => Generates a new session document in Firebase with the current working session startTime and subject. Also appends the workingRole you configured in your server to the current user.
  • !!stop => End the previous session document in Firebase with the current working session endTime and timeSpent.

In case any user disconnects while having workingRole active, Alpaca Work Bot will automatically run the stop handler for that user.

Heroku commands:

  • Stop dyno: heroku ps:scale web=0
  • Start dyno: heroku ps:scale web=1

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.