Skip to content

Commit

Permalink
2.4.0
Browse files Browse the repository at this point in the history
Updated Distube to 4.1.0
Changed cookie loading.
MongoDB messages now are no longer localized.
Added YT cookie guide to README.md
  • Loading branch information
AlexInCube committed Aug 30, 2023
1 parent 21cfb50 commit ef2ed4e
Show file tree
Hide file tree
Showing 10 changed files with 223 additions and 130 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ RUN git clone https://github.com/AlexInCube/AlCoTest .
RUN pnpm install
RUN pnpm run build
COPY .env.production /bot
COPY yt-cookies.json /bot
CMD ["pnpm", "run", "production"]
26 changes: 19 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Cool audiobot for Discord created by <a href="https://vk.com/alexincube"><b>@AlexInCube</b></a></p>

## 🌟 Features
- Command /alcotest which show your alcohol count in blood
- Command /alcotest which shows your alcohol count in blood
- Audioplayer based on [Distube](https://github.com/skick1234/DisTube) with buttons ![image](https://i.imgur.com/zqQ6ViY.png)
- Support YouTube, Spotify, Soundcloud, any HTTP-stream and Discord Attachments (/playfile support MP3/WAV/OGG)
- Support Slash and Text commands (with customizable prefix per server using /setprefix)
Expand All @@ -23,9 +23,8 @@ You can use Docker image or install things from "Requirements" and source code l
But in both cases, you need to configure .env file.

- Create .env.production
- Fill all fields in .env.production. If field marked as (Optional), you can skip it.
- Fill all fields in .env.production. If the field is marked as (Optional), you can skip it.
- (Required) To get Discord Token, follow this [guide](https://discordjs.guide/preparations/setting-up-a-bot-application.html#creating-your-bot)
- (Optional) To get YouTube Cookie, follow this [guide](https://www.youtube.com/watch?v=iQnpef9LgVM)
- (Optional) To get Spotify Secret and ID, follow this [guide](https://stevesie.com/docs/pages/spotify-client-id-secret-developer-api)
- (Optional) To get Yandex Music token, follow this [guide](https://github.com/MarshalX/yandex-music-api/discussions/513)
```
Expand All @@ -41,17 +40,29 @@ BOT_DISCORD_TOKEN=<discord token> (Required)
BOT_DISCORD_CLIENT_ID=<discord bot id> (Required)
BOT_DISCORD_OVERPOWERED_ID=<your id in discord> (Required) This need to retrieve reports in direct message
BOT_YOUTUBE_COOKIE=<cookie> (Optional)
BOT_SPOTIFY_CLIENT_SECRET=<spotify secret> (Optional)
BOT_SPOTIFY_CLIENT_ID=<spotify id> (Optional)
BOT_YANDEXMUSIC_TOKEN=<yandexmusic token> (Optional)
```

### 🍪 Youtube Cookie
Also, it is preferable to provide cookies for YouTube.
This will allow you to play 18+ videos and bypass YouTube rate limiting error (429 Error).
I highly recommend that you create a new Google account from which you get the cookie.
You cannot watch videos in your browser from this account,
otherwise your cookie will be reset, and you will need to retrieve it again.

- Install an extension for extracting cookie, [EditThisCookie](https://www.editthiscookie.com/blog/2014/03/install-editthiscookie/)
- Go to [YouTube](https://www.youtube.com/)
- Log in to your account. (You should use a new account for this purpose)
- Click on the extension icon and click "Export" button.
- Create file yt-cookies.json and paste cookie in this file

### 🖥️ Run locally
- Install things from "Requirements" section
- Follow "Configure .env" section and put .env.production in folder with repository.
- Follow the "Configure .env" section and put .env.production in folder with repository.
- Follow the "YouTube Cookie" section and put yt-cookies.json in the folder with repository.
- Run commands below

```npm
Expand All @@ -62,5 +73,6 @@ npm run production

### 🐋 Run in Docker
- Copy docker-compose.yml, Dockerfile, runInDocker.bat (for Windows) or runInDocker.sh (for Linux) in empty folder
- Follow "Configure .env" section and put .env.production in folder with Dockerfile etc.
- Follow the "Configure .env" section and put .env.production in folder with Dockerfile etc.
- Follow the "YouTube Cookie" section and put yt-cookies.json in the folder with Dockerfile etc.
- Run "runInDocker" file
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aicbot",
"version": "2.3.4",
"version": "2.4.0",
"description": "",
"main": "build/main.js",
"scripts": {
Expand All @@ -19,28 +19,28 @@
"@distube/soundcloud": "^1.3.3",
"@distube/spotify": "^1.5.1",
"@distube/yt-dlp": "^1.1.3",
"@distube/ytdl-core": "^4.11.17",
"@distube/ytdl-core": "^4.12.1",
"cross-env": "7.0.3",
"discord.js": "^14.13.0",
"distube": "^4.0.6",
"distube": "^4.1.0",
"distube-yandex-music-plugin": "^0.2.1",
"dotenv": "^16.3.1",
"i18next": "^22.5.1",
"i18next-fs-backend": "^2.1.5",
"mongoose": "^7.4.4",
"mongoose": "^7.5.0",
"node-os-utils": "^1.3.7",
"prism-media": "^1.3.5",
"sodium-native": "^4.0.4",
"uuid": "^9.0.0",
"zod": "^3.22.2"
},
"devDependencies": {
"@types/node": "^20.5.6",
"@types/node": "^20.5.7",
"@types/node-os-utils": "^1.3.1",
"@types/uuid": "^9.0.2",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"eslint": "^8.47.0",
"eslint": "^8.48.0",
"typescript": "^5.2.2"
}
}
Loading

0 comments on commit ef2ed4e

Please sign in to comment.