hackerspacemmu / hackerspace-bot

A hackerspace mmu discord bot
7 stars 4 forks source link

hackerspace-bot

Prerequisite

To run locally:

  1. Clone the repo
    git clone git@github.com:hackerspacemmu/hackerspace-bot.git
  2. Run
    $ cp .env.example .env
  3. Open .env file and replace the token gotten from the discord bot section.
  4. Run
    $ npm run start
  5. Your bot should be online now.

Development

To create a new command of command_name

$ ./program.sh <command_name>

Permission

  1. Add the following variables in .env file:
    ADMIN_ROLE_ID=<Admin's role ID>
    MEMBER_ROLE_ID=<Member's role ID>
  2. Get each role ID from the Discord server under Settings > Roles by right-clicking them. (Need to enable Developer Mode under User Settings > Appearance)
  3. Add import { role } from '../config.js' to the top of your command file.
  4. Add permission: [] property to the command object.

Example:

// This will allow users with admin or member role to access this command
permission: [role.admin, role.member]