Go to file
2024-04-30 11:20:25 +02:00
commands better typing 2024-04-29 10:30:39 +02:00
events simpler/universal bot-user-id access 2024-04-29 10:30:50 +02:00
models refactor: project wide renaming for accuracy 2024-04-04 08:59:37 +02:00
.env.example clean up: using unprotected sqlite database 2024-01-29 14:59:52 +01:00
.eslintignore ignore jsdoc output for prettier and eslint 2024-02-11 02:00:47 +01:00
.eslintrc.json configure eslint to use jsdoc 2024-02-11 02:00:30 +01:00
.gitignore ignore JSDoc output 2024-02-10 22:10:51 +01:00
.jsdoc.conf.json clean up: auto format 2024-02-11 01:59:57 +01:00
.prettierignore ignore jsdoc output for prettier and eslint 2024-02-11 02:00:47 +01:00
.prettierrc Initial commit 2024-01-26 13:28:02 +00:00
database.js refactor: project wide renaming for accuracy 2024-04-04 08:59:37 +02:00
deploy.js document code with jsdoc comments 2024-02-11 02:04:12 +01:00
index.js prepare messageCreate event 2024-04-05 13:51:58 +02:00
package-lock.json update packages 2024-04-04 08:09:13 +02:00
package.json version upgrade: alpha release 2024-03-23 22:57:12 +01:00
README.md added to TODO in readme 2024-04-30 11:20:25 +02:00
shared.js bugfix: add role to database like member_roles 2024-04-30 09:56:23 +02:00

Setup

Requirements

Download

Download the current source code here.

Or clone the repository manually:

git clone https://git.baipyr.us/Baipyrus/DiscordJS-Example.git

Installation

Install the required dependencies:

npm install

Running

Start the bot with:

npm run start

Usage

Discord utilizes different types of commands to interface with bots. The following explanations aim to explain these types.

Slash Commands

Simple text-based commands. Can be entered in any Text-Based-Channel.

Prefix message with a "Slash" (/) and begin typing the name of the command! This prefix and the styling as a code snippet will be used to highlight Slash Commands in this message.

For clarification, this will also highlight command options as "Slash Command only" by prefixing them with an underscore (_)

Context Menu Commands

"One click" commands. Listed under context (right click) menus, under the group "Apps".

Ideally, clicking on Users or Messages, you can apply any type of command with the press of a button. Comes with the downside of lacking further input capabilities.

Under the list of names of any given command, there may be a quoted string. These are meant to highlight context menu capabilities for the current command, by showcasing the commands name in the quote.

Reaction/Self Roles

Name

/self_roles

Description

Enables users to self assign roles by reacting to a message, utilizing a bot for automated tasks

Subcommands

create

Full names:

  • /self_roles create

Description:

The bot writes a message with the given contents in the current channel, and then registers said message for self roles

Options:

  • _text: String

register

Full names:

  • /self_roles register
  • "Register self roles"

Description:

Fetches any existing message and registers it for self roles directly

Options:

  • _id: Discord Message ID

remove

Full names:

  • /self_roles remove
  • "Remove self roles"

Description:

Fetches any existing message, looks if it is registered for self roles and then unregisters it

Options:

  • _id: Discord Message ID

add

Full names:

  • /self_roles add
  • "Add role emoji pair"

Description:

Adds a new Role-Emoji-Pair to a given message. Reacting to said message with the given emoji yields the given role

Options:

  • _id: Discord Message ID
  • role: Discord Role
  • emoji: Unicode [or if accessible, a custom] Emoji

Automated tasks

Registered Messages will automatically:

  • be unregistered during deletion
  • be edited in case the bot owns said message. It will explain the given Role-Emoji-Pairs every time a new pair is added.

Custom Voice Chat

Name

/custom_vc

Description

Enables users to create a custom, temporary voice chat with full control over it

Subcommands

create

Full names:

  • /custom_vc create

Description:

The bot creates a new voice channel with the given name and registers said channel for custom VC creation

Options:

  • _name: String

register

Full names:

  • /custom_vc register

Description:

Fetches any existing voice channel and registers it for custom VC creation directly

Options:

  • _channel: Discord Channel

remove

Full names:

  • /custom_vc remove

Description:

Fetches any voice channel, looks if it is registered for custom VC creation and then unregisters it

Options:

  • _channel: Discord Channel

Automated tasks

Registered Voice Channels will automatically:

  • be unregistered during deletion
  • be deleted once all users left said channel
  • grant full control over permissions, only within said channel, to the author

New member roles

Name

/member_roles

Description

Registers roles to be assigned to new members

Subcommands

add

Full names:

  • /member_roles add

Description:

Adds a new Role to be assigned to new members

Options:

  • role: Discord Role

remove

Full names:

  • /member_roles remove

Description:

Removes a Role from being assigned to new members

Options:

  • role: Discord Role

Automated tasks

Registered roles will automatically be assigned to new members

TO-DO List:

NOTE These lists can and will easily be appended to in the future. Any and all feedback is greatly appreciated!

Planned features

  • Automated alerts/reminders
  • Removing pairs on reaction/self roles
  • Autocomplete on ID input in slash commands

Quirks/Bugs

  • Custom VC not working in global space
  • Categories with Custom VC channel in them need explicit permissions

Changes

None