DiscordJS-Example/README.md

259 lines
4.6 KiB
Markdown
Raw Permalink Normal View History

2024-03-03 16:08:47 +00:00
# Setup
## Requirements
- NodeJS (LTS; including NPM): https://nodejs.org/en/download/
- Git: https://git-scm.com/downloads
## Download
Download the current source code [here](https://git.baipyr.us/Baipyrus/DiscordJS-Example/archive/main.zip).
Or clone the repository manually:
2024-03-23 21:47:24 +00:00
2024-03-03 16:08:47 +00:00
```bash
git clone https://git.baipyr.us/Baipyrus/DiscordJS-Example.git
```
## Installation
Install the required dependencies:
2024-03-23 21:47:24 +00:00
2024-03-03 16:08:47 +00:00
```bash
npm install
```
## Running
Start the bot with:
2024-03-23 21:47:24 +00:00
2024-03-03 16:08:47 +00:00
```bash
npm run start
```
# Usage
2024-02-09 20:32:56 +00:00
2024-02-09 20:23:40 +00:00
Discord utilizes different types of commands to interface with bots. The following explanations aim to explain these types.
2024-01-26 13:28:02 +00:00
2024-02-09 20:23:40 +00:00
## Slash Commands
2024-02-09 20:32:56 +00:00
2024-02-09 20:23:40 +00:00
Simple text-based commands. Can be entered in any Text-Based-Channel.
2024-02-09 20:32:56 +00:00
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.
2024-02-09 20:23:40 +00:00
2024-02-09 20:32:56 +00:00
For clarification, this will also highlight command options as "Slash Command only" by prefixing them with an underscore (`_`)
2024-02-09 20:23:40 +00:00
## Context Menu Commands
2024-02-09 20:32:56 +00:00
2024-02-09 20:23:40 +00:00
"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
2024-02-09 20:32:56 +00:00
2024-02-09 20:23:40 +00:00
## Name
2024-02-09 20:32:56 +00:00
`/self_roles`
2024-02-09 20:23:40 +00:00
## Description
2024-02-09 20:32:56 +00:00
2024-02-09 20:23:40 +00:00
Enables users to self assign roles by reacting to a message, utilizing a bot for automated tasks
## Subcommands
2024-02-09 20:32:56 +00:00
2024-02-09 20:23:40 +00:00
### create
2024-02-09 20:32:56 +00:00
2024-02-09 20:23:40 +00:00
Full names:
2024-02-09 20:32:56 +00:00
- `/self_roles create`
2024-02-09 20:23:40 +00:00
Description:
2024-02-09 20:36:44 +00:00
2024-02-09 20:23:40 +00:00
The bot writes a message with the given contents in the current channel, and then registers said message for self roles
Options:
2024-02-09 20:32:56 +00:00
- \_text: String
2024-02-09 20:23:40 +00:00
### register
2024-02-09 20:32:56 +00:00
2024-02-09 20:23:40 +00:00
Full names:
2024-02-09 20:32:56 +00:00
- `/self_roles register`
2024-02-09 20:23:40 +00:00
- "Register self roles"
Description:
2024-02-09 20:36:44 +00:00
2024-02-09 20:23:40 +00:00
Fetches any existing message and registers it for self roles directly
Options:
2024-02-09 20:32:56 +00:00
- \_id: Discord Message ID
2024-02-09 20:23:40 +00:00
### remove
2024-02-09 20:32:56 +00:00
2024-02-09 20:23:40 +00:00
Full names:
2024-02-09 20:32:56 +00:00
- `/self_roles remove`
2024-02-09 20:23:40 +00:00
- "Remove self roles"
Description:
2024-02-09 20:36:44 +00:00
2024-02-09 20:23:40 +00:00
Fetches any existing message, looks if it is registered for self roles and then unregisters it
Options:
2024-02-09 20:32:56 +00:00
- \_id: Discord Message ID
2024-02-09 20:23:40 +00:00
### add
2024-02-09 20:32:56 +00:00
2024-02-09 20:23:40 +00:00
Full names:
2024-02-09 20:32:56 +00:00
- `/self_roles add`
2024-02-09 20:23:40 +00:00
- "Add role emoji pair"
Description:
2024-02-09 20:36:44 +00:00
2024-02-09 20:23:40 +00:00
Adds a new Role-Emoji-Pair to a given message. Reacting to said message with the given emoji yields the given role
Options:
2024-02-09 20:32:56 +00:00
- \_id: Discord Message ID
2024-02-09 20:23:40 +00:00
- role: Discord Role
- emoji: Unicode [or if accessible, a custom] Emoji
## Automated tasks
2024-02-09 20:32:56 +00:00
2024-02-09 20:23:40 +00:00
Registered Messages will automatically:
2024-02-09 20:32:56 +00:00
2024-02-09 20:23:40 +00:00
- 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
2024-02-09 20:32:56 +00:00
2024-02-09 20:23:40 +00:00
## Name
2024-02-09 20:32:56 +00:00
`/custom_vc`
2024-02-09 20:23:40 +00:00
## Description
2024-02-09 20:32:56 +00:00
2024-02-09 20:23:40 +00:00
Enables users to create a custom, temporary voice chat with full control over it
## Subcommands
2024-02-09 20:32:56 +00:00
2024-02-09 20:23:40 +00:00
### create
2024-02-09 20:32:56 +00:00
2024-02-09 20:36:44 +00:00
Full names:
- `/custom_vc create`
2024-02-09 20:23:40 +00:00
Description:
2024-03-03 16:08:47 +00:00
2024-02-09 20:23:40 +00:00
The bot creates a new voice channel with the given name and registers said channel for custom VC creation
Options:
2024-02-09 20:32:56 +00:00
- \_name: String
2024-02-09 20:23:40 +00:00
### register
2024-02-09 20:32:56 +00:00
2024-02-09 20:23:40 +00:00
Full names:
2024-02-09 20:32:56 +00:00
- `/custom_vc register`
2024-02-09 20:23:40 +00:00
Description:
2024-03-03 16:08:47 +00:00
2024-02-09 20:23:40 +00:00
Fetches any existing voice channel and registers it for custom VC creation directly
Options:
2024-02-09 20:32:56 +00:00
2024-03-03 16:08:47 +00:00
- \_channel: Discord Channel
2024-02-09 20:23:40 +00:00
### remove
2024-02-09 20:32:56 +00:00
2024-02-09 20:23:40 +00:00
Full names:
2024-02-09 20:32:56 +00:00
- `/custom_vc remove`
2024-02-09 20:23:40 +00:00
Description:
2024-03-03 16:08:47 +00:00
2024-02-09 20:23:40 +00:00
Fetches any voice channel, looks if it is registered for custom VC creation and then unregisters it
Options:
2024-02-09 20:32:56 +00:00
2024-03-03 16:08:47 +00:00
- \_channel: Discord Channel
2024-02-09 20:23:40 +00:00
## Automated tasks
2024-02-09 20:32:56 +00:00
2024-02-09 20:23:40 +00:00
Registered Voice Channels will automatically:
2024-02-09 20:32:56 +00:00
2024-02-09 20:23:40 +00:00
- 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
2024-02-09 20:23:40 +00:00
# TO-DO List:
2024-02-09 20:32:56 +00:00
2024-02-09 20:39:19 +00:00
> **NOTE**
> These lists can and will easily be appended to in the future. Any and all feedback is greatly appreciated!
2024-02-09 20:23:40 +00:00
## Planned features
2024-02-09 20:32:56 +00:00
2024-02-09 20:23:40 +00:00
- Automated alerts/reminders
- Removing pairs on reaction/self roles
2024-04-30 09:20:25 +00:00
- Autocomplete on ID input in slash commands
2024-02-09 20:23:40 +00:00
## Quirks/Bugs
2024-02-09 20:32:56 +00:00
2024-04-29 08:29:05 +00:00
- Custom VC not working in global space
- Categories with Custom VC channel in them need explicit permissions
2024-02-09 20:23:40 +00:00
## Changes
2024-02-09 20:32:56 +00:00
2024-02-09 20:23:40 +00:00
None