Skip to content

Commit

Permalink
Clean up command descriptions and README
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusOtter committed Nov 13, 2021
1 parent 6a4fa8a commit 3fea6bc
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 62 deletions.
49 changes: 8 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Needle
Needle is a [discord](https://discord.com/) bot that helps you manage your [discord threads](https://support.discord.com/hc/en-us/articles/4403205878423-Threads-FAQ).
Needle is a [Discord](https://discord.com/) bot that helps you manage your [Discord threads](https://support.discord.com/hc/en-us/articles/4403205878423-Threads-FAQ).

## Features
- Automatically create new threads for every message in certain channels
- Let thread owners close the automatically created threads with `/close`
- Let thread owners change the title of the automatically created thread with `/title`
- More to come :wink: Check out open [issues](https://github.com/MarcusOtter/discord-needle/issues)!

## Running the bot
Expand All @@ -18,44 +20,9 @@ Needle is a [discord](https://discord.com/) bot that helps you manage your [disc
}
```
3. Run `npm install`
4. Make sure the bot has the required permissions in Discord. Depending on your [configuration](#configuration), these can be:
- `USE_PUBLIC_THREADS` (always required)
- `SEND_MESSAGES_IN_THREADS` (always required)
- `READ_MESSAGE_HISTORY` (always required)
- `EMBED_LINKS` (required if there are any [embeds](#embeds))
- `MANAGE_MESSAGES` (required if [shouldPin](#shouldpin) is `true`)
4. Make sure the bot has the required permissions in Discord. They are:
- `USE_PUBLIC_THREADS`
- `SEND_MESSAGES_IN_THREADS`
- `READ_MESSAGE_HISTORY`
5. Run `npm start`
5. Done! :tada:

## Configuration :construction: UNDER CONSTRUCTION, NOT WORKING YET :construction:
If you want to, you can (**IN THE FUTURE**) configure how the bot reacts by editing the `src/config.json`.
An explanation follows.

### threadArchiveDurationInMinutes
Determines the duration of inactivity that causes a thread to be automatically archived (by Discord). If your server's boost level is not high enough for the setting you choose, or if you leave it blank, it will default to `"MAX"`.

Allowed values:
- `60` (= 1hr)
- `1440` (= 1d)
- `4320` (= 3d) :warning: *only for servers with boost level 1 or higher*
- `10080` (= 1w) :warning: *only for servers with boost level 2 or higher*
- `"MAX"` (depends on the server's boost level)

### threadMessage
Settings regarding the message that is sent by the bot in the thread when it is created.

#### shouldSend
Whether or not to send a message. If you set this to `false`, the rest of these settings are ignored.

#### shouldPin
Whether or not to pin the message that was sent by the bot. If you set this to `false`, the bot does not need the `MANAGE_MESSAGES` permission.

#### content
The text content of the message that is sent. Available variables:
- `$$authorMention` - A mention of the author that sent the original message
- `$$channelMention` - A mention of the channel that the original message was sent in
- `$$relativeTimeSince` - A relative timestamp for when the original message was posted

#### embeds
An array of the embeds to attach to the message, with a maximum of 10. Available embeds:
- `$$messageEmbed` - A copy of the original message in embed format
6. Done! :tada:
2 changes: 1 addition & 1 deletion src/commands/close.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { NeedleCommand } from "../types/needleCommand";
export const command: NeedleCommand = {
name: "close",
shortHelpDescription: "Closes a thread by setting the auto-archive duration to 1 hour",
longHelpDescription: "The close command archives a thread by setting the auto-archive duration to 1 hour.\n\nIt does not instantly archive the thread, because that would mean only moderators could un-archive it. When using auto-archive, the thread will automatically be archived when there have been no new messages in the thread for one hour.",
longHelpDescription: "The close command lets thread owners set the auto-archive duration to 1 hour.\n\nWhen using auto-archive, the thread will automatically be archived when there have been no new messages in the thread for one hour. This can be undone by a server moderator by manually changing the auto-archive duration back to what it was previously, using Discord's own interface.",

async getSlashCommandBuilder() {
return new SlashCommandBuilder()
Expand Down
19 changes: 0 additions & 19 deletions src/commands/ping.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/commands/title.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { NeedleCommand } from "../types/needleCommand";
export const command: NeedleCommand = {
name: "title",
shortHelpDescription: "Sets the title of a thread to `value`",
longHelpDescription: "The title command lets thread creators and users with the \"Manage Threads\" permissions to change the name of a thread.",
longHelpDescription: "The title command lets thread owners to change the name of a thread.",

async getSlashCommandBuilder() {
return new SlashCommandBuilder()
Expand Down

0 comments on commit 3fea6bc

Please sign in to comment.