Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ppodds/yuets
A TypeScript rewrite version of Discord bot Yue.
https://github.com/ppodds/yuets
discord discord-bot discord-js typescript
Last synced: 21 days ago
JSON representation
A TypeScript rewrite version of Discord bot Yue.
- Host: GitHub
- URL: https://github.com/ppodds/yuets
- Owner: ppodds
- License: mit
- Created: 2022-01-13T15:07:51.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2024-10-29T14:18:51.000Z (3 months ago)
- Last Synced: 2024-10-29T17:26:55.377Z (3 months ago)
- Topics: discord, discord-bot, discord-js, typescript
- Language: TypeScript
- Homepage:
- Size: 31 MB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 35
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# YueTS
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/7a9c92a6262142ea9711888e2e016d57)](https://www.codacy.com/gh/ppodds/YueTS/dashboard?utm_source=github.com&utm_medium=referral&utm_content=ppodds/YueTS&utm_campaign=Badge_Grade)
## About
This is a TypeScript rewrite version of my Discord bot Yue. Yue was used in NCU CSIE Discord Server and World of Warships guild PTT NiceBoat. It made so much fun. But the library used by Yue is no longer in-maintance([detail](https://gist.github.com/Rapptz/4a2f62751b9600a31a0d3c78100287f1)). In fact, the origin one which written by Python might not work properly in the near future, so I decide to write a new one with [discord.js](https://github.com/discordjs/discord.js/).
## Installation
### Clone The Repository
```shell
git clone https://github.com/ppodds/YueTS.git
```### Set Envirment variables
```shell
# copy the example env file
cp .env.example .env
# edit it
vim .env
```The environments will be parsed to a config object, and it also allow you to assign a list of string like this
```
BOT__STATUS_LIST__0=a
BOT__STATUS_LIST__1=list
BOT__STATUS_LIST__2=of
BOT__STATUS_LIST__3=status
```The parsed config object would be
```js
{
bot: {
statusList: ["a", "list", "of", "status"]
}
}
```#### Development
```shell
pnpm i
pnpm build
pnpm dev
```#### Deploy
```
docker build --pull --rm -t yuets:latest "."
docker run -d -v $PWD/logs:/var/log/yue --network host --name yuets yuets:latest
```## FAQ
### Privileged Intent Error
```
Privileged intent provided is not enabled or whitelisted.
```Try to enable options below
![Discord Bot Portal Intents](docs/intent.png)### Get an error when deploy commands
If you get the error below, check your `bot.json` set `clientId` and `token` properly.
```
DiscordAPIError[20012]: You are not authorized to perform this action on this application
at SequentialHandler.runRequest (/app/node_modules/@discordjs/rest/dist/lib/handlers/SequentialHandler.js:198:23)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async SequentialHandler.queueRequest (/app/node_modules/@discordjs/rest/dist/lib/handlers/SequentialHandler.js:99:20)
at async /app/deploy-commands.js:29:13 {
rawError: {
message: 'You are not authorized to perform this action on this application',
code: 20012
},
code: 20012,
status: 403,
method: 'put',
url: 'https://discord.com/api/v9/applications/??????????????????/commands'
}
```