- Create an application at https://discord.com/developers/applications
- Create a bot and copy out the api key in the bot section from the menu on the left.
- Invite the bot to your own testing server.
- Clone the repo
git clone [email protected]:hackerspacemmu/hackerspace-bot.git
- Run
$ cp .env.example .env
- Open
.env
file and replace the token gotten from the discord bot section. - Run
$ npm run start
- Your bot should be online now.
To create a new command of command_name
$ ./program.sh <command_name>
- Add the following variables in
.env
file:ADMIN_ROLE_ID=<Admin's role ID> MEMBER_ROLE_ID=<Member's role ID>
- Get each role ID from the Discord server under
Settings > Roles
by right-clicking them. (Need to enable Developer Mode underUser Settings > Appearance
) - Add
import { role } from '../config.js'
to the top of your command file. - 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]