Skip to content
This repository has been archived by the owner on Nov 11, 2024. It is now read-only.

Commit

Permalink
chore(release): version 2.4.0 (#745)
Browse files Browse the repository at this point in the history
* chore(deps-dev): de-bump typescript to 4.4.9 (#685)

* chore: change version

* feat(main): refactor some codes and fix some bugs

* feat: allow user to choose stream strategy (#690)

* chore(env): improve grammar (#699)

* improve grammar

* Update .env_example

* chore(deps): bump dotenv from 10.0.0 to 14.2.0 (#694)

Bumps [dotenv](https://github.com/motdotla/dotenv) from 10.0.0 to 14.2.0.
- [Release notes](https://github.com/motdotla/dotenv/releases)
- [Changelog](https://github.com/motdotla/dotenv/blob/master/CHANGELOG.md)
- [Commits](motdotla/dotenv@v10.0.0...v14.2.0)

---
updated-dependencies:
- dependency-name: dotenv
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): bump @typescript-eslint/parser from 5.9.0 to 5.10.0 (#695)

Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.9.0 to 5.10.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.10.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): bump @types/node from 17.0.8 to 17.0.10 (#698)

Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 17.0.8 to 17.0.10.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): bump typescript from 4.5.4 to 4.5.5 (#701)

Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.5.4 to 4.5.5.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](microsoft/TypeScript@v4.5.4...v4.5.5)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): bump @typescript-eslint/eslint-plugin (#696)

Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.9.0 to 5.10.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.10.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: mzrtamp <[email protected]>

* chore(deps): regenerate lockfile and also update follow-redirects to a non-vulnerable version

* chore(deps-dev): bump @zhycorp/eslint-config from 6.0.2 to 7.1.0 (#700)

* chore(deps-dev): bump @zhycorp/eslint-config from 6.0.2 to 7.1.0

Bumps [@zhycorp/eslint-config](https://github.com/zhycorp/eslint-config) from 6.0.2 to 7.1.0.
- [Release notes](https://github.com/zhycorp/eslint-config/releases)
- [Commits](https://github.com/zhycorp/eslint-config/commits/7.1.0)

---
updated-dependencies:
- dependency-name: "@zhycorp/eslint-config"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* chore(deps-dev): bump eslint from 8.6.0 to 8.7.0 (#693)

Bumps [eslint](https://github.com/eslint/eslint) from 8.6.0 to 8.7.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](eslint/eslint@v8.6.0...v8.7.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: mzrtamp <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: mzrtamp <[email protected]>

* chore(deps): upgrade lockfile

* fix(ci): resolve some eslint error

* chore(deps): bump i18n from 0.13.4 to 0.14.0 (#704)

Bumps [i18n](https://github.com/mashpie/i18n-node) from 0.13.4 to 0.14.0.
- [Release notes](https://github.com/mashpie/i18n-node/releases)
- [Changelog](https://github.com/mashpie/i18n-node/blob/master/CHANGELOG.md)
- [Commits](mashpie/i18n-node@0.13.4...0.14.0)

---
updated-dependencies:
- dependency-name: i18n
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(readme): add project maintainer field

* feat: fix bugs and linter errors (#706)

* chore(deps): bump dotenv from 10.0.0 to 14.3.0 (#711)

Bumps [dotenv](https://github.com/motdotla/dotenv) from 10.0.0 to 14.3.0.
- [Release notes](https://github.com/motdotla/dotenv/releases)
- [Changelog](https://github.com/motdotla/dotenv/blob/master/CHANGELOG.md)
- [Commits](motdotla/dotenv@v10.0.0...v14.3.0)

---
updated-dependencies:
- dependency-name: dotenv
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: mzrtamp <[email protected]>

* chore(deps): bump @discordjs/voice from 0.7.5 to 0.8.0 (#709)

Bumps [@discordjs/voice](https://github.com/discordjs/discord.js) from 0.7.5 to 0.8.0.
- [Release notes](https://github.com/discordjs/discord.js/releases)
- [Commits](https://github.com/discordjs/discord.js/compare/@discordjs/[email protected]...@discordjs/[email protected])

---
updated-dependencies:
- dependency-name: "@discordjs/voice"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): bump @typescript-eslint/parser from 5.9.0 to 5.10.1 (#708)

Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.9.0 to 5.10.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.10.1/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: mzrtamp <[email protected]>

* chore(deps-dev): bump @typescript-eslint/eslint-plugin (#707)

Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.9.0 to 5.10.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.10.1/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: mzrtamp <[email protected]>

* chore(deps): regenerate lockfile

* chore(deps): bump dotenv from 10.0.0 to 14.3.2 (#712)

Bumps [dotenv](https://github.com/motdotla/dotenv) from 10.0.0 to 14.3.2.
- [Release notes](https://github.com/motdotla/dotenv/releases)
- [Changelog](https://github.com/motdotla/dotenv/blob/master/CHANGELOG.md)
- [Commits](motdotla/dotenv@v10.0.0...v14.3.2)

---
updated-dependencies:
- dependency-name: dotenv
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: mzrtamp <[email protected]>

* chore(deps-dev): bump @types/node from 17.0.8 to 17.0.12 (#715)

Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 17.0.8 to 17.0.12.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: mzrtamp <[email protected]>

* chore(deps): bump follow-redirects from 1.14.6 to 1.14.7 (#718)

Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.6 to 1.14.7.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](follow-redirects/follow-redirects@v1.14.6...v1.14.7)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): bump @types/node from 17.0.8 to 17.0.13 (#719)

Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 17.0.8 to 17.0.13.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: mzrtamp <[email protected]>

* fix: disable `@typescript-eslint/no-extra-parens` rule

* feat(main): re-install modules only on glitch

* feat(utils): add createTable util

* refactor(AboutCommand): use createTable to create information table

* fix(GeneralUtil): fix youtu.be links not working

* feat(YTDLUtil): fix play-dl music not playing issue and sort import declarations

* chore: update CODEOWNERS

* chore: change version

* chore(env_example): add list of available stream strategy

* chore(app.json): synchronize 'env' values

* chore(readme): update content

* chore(deps-dev): bump eslint from 8.6.0 to 8.8.0 (#721)

Bumps [eslint](https://github.com/eslint/eslint) from 8.6.0 to 8.8.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](eslint/eslint@v8.6.0...v8.8.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: mzrtamp <[email protected]>

* chore(deps): bump i18n from 0.13.4 to 0.14.1 (#723)

Bumps [i18n](https://github.com/mashpie/i18n-node) from 0.13.4 to 0.14.1.
- [Release notes](https://github.com/mashpie/i18n-node/releases)
- [Changelog](https://github.com/mashpie/i18n-node/blob/master/CHANGELOG.md)
- [Commits](mashpie/i18n-node@0.13.4...0.14.1)

---
updated-dependencies:
- dependency-name: i18n
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: mzrtamp <[email protected]>

* chore(deps): bump dotenv from 10.0.0 to 16.0.0 (#728)

Bumps [dotenv](https://github.com/motdotla/dotenv) from 10.0.0 to 16.0.0.
- [Release notes](https://github.com/motdotla/dotenv/releases)
- [Changelog](https://github.com/motdotla/dotenv/blob/master/CHANGELOG.md)
- [Commits](motdotla/dotenv@v10.0.0...v16.0.0)

---
updated-dependencies:
- dependency-name: dotenv
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: mzrtamp <[email protected]>

* chore(deps-dev): bump @types/node from 17.0.8 to 17.0.15 (#729)

Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 17.0.8 to 17.0.15.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: mzrtamp <[email protected]>

* chore(deps): bump discord.js from 13.5.0 to 13.6.0 (#731)

Bumps [discord.js](https://github.com/discordjs/discord.js) from 13.5.0 to 13.6.0.
- [Release notes](https://github.com/discordjs/discord.js/releases)
- [Changelog](https://github.com/discordjs/discord.js/blob/13.6.0/CHANGELOG.md)
- [Commits](discordjs/discord.js@13.5.0...13.6.0)

---
updated-dependencies:
- dependency-name: discord.js
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: mzrtamp <[email protected]>

* chore(deps): update lockfile

* chore(deps-dev): bump @typescript-eslint/eslint-plugin and @typescript-eslint/parser

* chore(*): Rename (#736)

Disc 11 => Rawon
disc-11 => rawon

* chore(readme): put splash image on the center of x axis

* chore(deps): bump youtubei from 0.0.1-rc.27 to 0.0.1-rc.28 (#737)

Bumps [youtubei](https://github.com/SuspiciousLookingOwl/youtubei) from 0.0.1-rc.27 to 0.0.1-rc.28.
- [Release notes](https://github.com/SuspiciousLookingOwl/youtubei/releases)
- [Changelog](https://github.com/SuspiciousLookingOwl/youtubei/blob/main/CHANGELOG.md)
- [Commits](https://github.com/SuspiciousLookingOwl/youtubei/commits)

---
updated-dependencies:
- dependency-name: youtubei
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: mzrtamp <[email protected]>

* chore(glitch): update string

* chore(HelpCommand): respect eslint

* chore(release): version 2.4.0

Co-authored-by: Ahmad Yaqdhan <[email protected]>
Co-authored-by: KagChi <[email protected]>
Co-authored-by: 21Z <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: mzrtamp <[email protected]>
  • Loading branch information
6 people authored Feb 7, 2022
1 parent 041dad0 commit f5e60b5
Show file tree
Hide file tree
Showing 66 changed files with 998 additions and 984 deletions.
7 changes: 7 additions & 0 deletions .env_example
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ DEV_GUILD=[""]
# Default: production
NODE_ENV=""

#==============================================================================
# Which youtube downloader do you want to use? Note: if you use play-dl, it will support a few sites.
# Example: STREAM_STRATEGY="youtube-dl"
# Available: play-dl, youtube-dl
# Default: youtube-dl
STREAM_STRATEGY=""

#==============================================================================
# Do you want to enable slash command support?
# Example: ENABLE_SLASH_COMMAND="yes"
Expand Down
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Global
* @mzrtamp @Mednoob @ZenShibata
* @mzrtamp @Mednoob
4 changes: 2 additions & 2 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
patreon: zhycorp
custom: ["https://karyakarsa.com/zhycorp"]
patreon: mzrtamp
custom: ["https://karyakarsa.com/mozartrafi"]
4 changes: 0 additions & 4 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
blank_issues_enabled: true
contact_links:
- name: Discord Server
url: https://zhycorp.net/discord
about: Visit our Discord server for easier and faster respond.
Binary file removed .github/images/disc-11.png
Binary file not shown.
Binary file added .github/images/rawon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2021, Zhycorp
Copyright (c) 2022, RB Project
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
![Splash](https://repository-images.githubusercontent.com/236645319/1da444e8-04ad-48a7-aee2-325cb3c7f6a7)
<div align="center">
<img src="https://repository-images.githubusercontent.com/236645319/8a781f4e-6955-499a-9e88-380c5adccfa5" alt="Splash" />
</div>

# Disc 11 by Zhycorp
# Rawon

> A dedicated open-source Discord bot for Zhycorp based from [our Discord bot template](https://github.com/zhycorp/discord-bot-template) with more features. Easy to use, and with no coding required.
> A dedicated open-source music and moderation Discord bot. Easy to use, and with no coding required.
<a href="https://zhycorp.net/discord"><img src="https://img.shields.io/discord/332877090003091456?color=5865F2&logo=discord&logoColor=white" alt="Discord Server" /></a>
<a href="https://discord.com/oauth2/authorize?client_id=690736793682968576&permissions=53857345&scope=bot"><img src="https://img.shields.io/static/v1?label=Invite%20Me&message=Disc%2011%230606&plastic&color=5865F2&logo=discord"></a>
<a href="https://discord.com/oauth2/authorize?client_id=711712829031448637&permissions=53857345&scope=bot"><img src="https://img.shields.io/static/v1?label=Invite%20Me&message=Rawon%237022&plastic&color=5865F2&logo=discord"></a>
<img src="https://badgen.net/badge/icon/typescript?icon=typescript&label">
<a href="https://github.com/zhycorp/disc-11/actions?query=workflow%3A%22Lint+code+%26+compile+test%22"><img src="https://github.com/zhycorp/disc-11/workflows/Lint%20code%20&%20compile%20test/badge.svg" alt="CI Status" /></a>
<a href="https://github.com/mzrtamp/rawon/actions?query=workflow%3A%22Lint+code+%26+compile+test%22"><img src="https://github.com/mzrtamp/rawon/workflows/Lint%20code%20&%20compile%20test/badge.svg" alt="CI Status" /></a>

## Features
- Interaction support.
Expand Down Expand Up @@ -41,24 +42,23 @@ $ npm start
### Heroku
You can host this bot to make it stay online on Heroku.

<a href="https://heroku.com/deploy?template=https://github.com/zhycorp/disc-11"><img src="https://www.herokucdn.com/deploy/button.svg" alt="Deploy to Heroku"></a>
<a href="https://heroku.com/deploy?template=https://github.com/mzrtamp/rawon"><img src="https://www.herokucdn.com/deploy/button.svg" alt="Deploy to Heroku"></a>

### Glitch
You can use Glitch too for this project, featured with its code editor.

> Watch the tutorial video on YouTube!
>
> ▶️ **https://youtu.be/ILutlBl_Xyk**
1. Star and fork this project
2. Go to [glitch.com](https://glitch.com) and make an account
3. Click **New Project** then **Import from GitHub**, specify the pop-up field with `https://github.com/<your-name>/disc-11` (without `<>`)
3. Click **New Project** then **Import from GitHub**, specify the pop-up field with `https://github.com/<your-name>/rawon` (without `<>`)
4. Please wait for a while, this process takes some minutes
5. Find `.env` file and delete it, find `.env_example` file and rename it back to `.env`
6. After specifying `.env`, open **Tools** > **Terminal**
7. Type `refresh`, and track the process from **Logs**
8. To make the bot stay online, please watch [this video](https://youtu.be/K2nqthN1xKQ?t=551) carefully.

<a href="https://glitch.com/edit/#!/import/github/zhycorp/disc-11"><img src="https://cdn.glitch.com/2703baf2-b643-4da7-ab91-7ee2a2d00b5b%2Fremix-button.svg" alt="Remix on Glitch"></a>
<a href="https://glitch.com/edit/#!/import/github/mzrtamp/rawon"><img src="https://cdn.glitch.com/2703baf2-b643-4da7-ab91-7ee2a2d00b5b%2Fremix-button.svg" alt="Remix on Glitch"></a>

## Project Maintainer
- [@Mednoob](https://github.com/Mednoob)
- [@mzrtamp](https://github.com/mzrtamp)

> © 2021 Zhycorp Development
> © 2022 RB Project
15 changes: 10 additions & 5 deletions app.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Disc 11",
"description": "A dedicated open-source Discord bot for Zhycorp based on our Discord bot template with more features. Easy to use, and with no coding required.",
"logo": "https://raw.githubusercontent.com/zhycorp/disc-11/main/.github/images/disc-11.png",
"name": "Rawon",
"description": "A dedicated open-sourced Discord bot with many features of utilization. Easy to use, and with no coding required.",
"logo": "https://raw.githubusercontent.com/mzrtamp/rawon/main/.github/images/rawon.png",
"env": {
"DISCORD_TOKEN": {
"description": "What is your Discord bot's token? | Example: NTE5NjQ2MjIxNTU2Nzc2OTcw.XAcEQQ.0gjhNbGeWBsKP6FVuIyZWlG2cMd",
Expand Down Expand Up @@ -52,6 +52,11 @@
"required": false,
"value": "production"
},
"STREAM_STRATEGY": {
"description": "Which youtube downloader do you want to use? Note: if you use play-dl, it will support a few sites. | Example: \"play-dl\" | Available: \"play-dl\", \"youtube-dl\"",
"required": false,
"value": "youtube-dl"
},
"ENABLE_SLASH_COMMAND": {
"description": "Do you want to enable slash command support? | Example: yes",
"required": false,
Expand Down Expand Up @@ -93,8 +98,8 @@
"value": ""
}
},
"repository": "https://github.com/zhycorp/disc-11",
"website": "https://disc-11.zhycorp.net",
"repository": "https://github.com/mzrtamp/rawon",
"website": "https://rawon.tiramitzu.me",
"formation": {
"worker": {
"quantity": 1,
Expand Down
102 changes: 72 additions & 30 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,6 @@ const { existsSync, rmSync } = require("fs");
const { resolve } = require("path");
const { Server } = require("https");

try {
require("dotenv/config");
} catch (err) {
console.info("[INFO] It seems dotenv hasn't been installed, trying to re-install all modules...");
if (existsSync(resolve(process.cwd(), "node_modules"))) rmSync(resolve(process.cwd(), "node_modules"), { recursive: true });
execSync("npm i --only=prod dotenv");
console.info("[INFO] dotenv has been installed, trying to retrieve environment data...");
require("dotenv/config");
console.info("[INFO] Environment data has been retrieved.");
}

const isGlitch = (
process.env.PROJECT_DOMAIN !== undefined &&
process.env.PROJECT_INVITE_TOKEN !== undefined &&
Expand Down Expand Up @@ -57,55 +46,108 @@ const isGitHub = (
process.env.GITHUB_SERVER_URL !== undefined
)

function npmInstall(deleteDir = false, forceInstall = false, additionalArgs = []) {
if (deleteDir) {
const modulesPath = resolve(process.cwd(), "node_modules");

if (existsSync(modulesPath)) {
rmSync(modulesPath, { recursive: true });
}
}

execSync(`npm install${isGlitch ? " --only=prod" : ""}${forceInstall ? " --force" : ""} ${additionalArgs.join(" ")}`);
}

if (isGlitch) {
execSync("npm i --only=prod");
try {
console.info("[INFO] Trying to re-install modules...");
npmInstall();
console.info("[INFO] Modules successfully re-installed.");
} catch (err) {
console.info("[INFO] Failed to re-install modules, trying to delete node_modules and re-install...");
try {
npmInstall(true);
console.info("[INFO] Modules successfully re-installed.");
} catch {
console.info("[INFO] Failed to re-install modules, trying to delete node_modules and install modules forcefully...");
try {
npmInstall(true, true);
console.info("[INFO] Modules successfully re-installed.");
} catch {
console.warn("[WARN] Failed to re-install modules, please re-install manually.");
}
}
}
}

if (isReplit) {
console.warn("[WARN] We haven't added stable support for running this bot using Replit, bugs and errors may come up.");

if (Number(process.versions.node.split(".")[0]) < 16) {
console.info("[INFO] This Replit doesn't use Node.js v16 or newer, trying to install Node.js v16...");
execSync(`npm i --save-dev [email protected] && npm config set prefix=$(pwd)/node_modules/node && export PATH=$(pwd)/node_modules/node/bin:$PATH`);
console.info("[INFO] Node.js v16 has been installed, please restart the bot.");
process.exit(0);
}
}

if (isGitHub) {
console.warn("[WARN] Running this bot using GitHub is not recommended.");
}

if (isReplit && (Number(process.versions.node.split(".")[0]) < 16)) {
console.info("[INFO] This Replit doesn't use Node.js v16 or newer, trying to install Node.js v16...");
execSync(`npm i --save-dev [email protected] && npm config set prefix=$(pwd)/node_modules/node && export PATH=$(pwd)/node_modules/node/bin:$PATH`);
console.info("[INFO] Node.js v16 has been installed, please restart the bot.");
process.exit(0);
}

if (!isGlitch) {
console.info("[INFO] This bot is not running on Glitch, trying to install ffmpeg-static...");
execSync("npm i --no-save ffmpeg-static");
console.info("[INFO] ffmpeg-static has been installed.");
try {
require("ffmpeg-static");
} catch {
console.info("[INFO] This bot is not running on Glitch, trying to install ffmpeg-static...");
npmInstall(false, false, ["--no-save", "ffmpeg-static"]);
console.info("[INFO] ffmpeg-static has been installed.");
}
}

if (isGlitch || isReplit) {
new Server((req, res) => {
const now = new Date().toLocaleString("en-US");
res.end(`OK (200) - ${now}`);
}).listen(Number(process.env.PORT) || 3000);
}).listen(Number(process.env.PORT || 3000) || 3000);

console.info(`[INFO] ${isGlitch ? "Glitch" : "Replit"} environment detected, trying to compile...`);
execSync(`npm run compile`);
console.info("[INFO] Compiled.");
}

(async () => {
const streamStrategy = process.env.STREAM_STRATEGY;
const isUnix = ["aix", "android", "darwin", "freebsd", "linux", "openbsd", "sunos"].includes(process.platform.toLowerCase());
process.env.YOUTUBE_DL_HOST = "https://api.github.com/repos/yt-dlp/yt-dlp/releases?per_page=1";
process.env.YOUTUBE_DL_FILENAME = "yt-dlp";

const ytdlBinaryDir = resolve(__dirname, "node_modules", "youtube-dl-exec", "bin")
if (!existsSync(resolve(ytdlBinaryDir, isUnix ? "yt-dlp" : "yt-dlp.exe"))) {
console.info("[INFO] Yt-dlp couldn't be found, trying to download...");
if (existsSync(resolve(ytdlBinaryDir, isUnix ? "youtube-dl" : "youtube-dl.exe"))) rmSync(resolve(ytdlBinaryDir, isUnix ? "youtube-dl" : "youtube-dl.exe"));
await require("youtube-dl-exec/scripts/postinstall");
console.info("[INFO] Yt-dlp has been downloaded.");
}
if (streamStrategy !== "play-dl") {
try {
require("youtube-dl-exec");
} catch {
console.info("[INFO] Installing youtube-dl-exec...");
npmInstall(false, false, ["youtube-dl-exec"]);
console.info("[INFO] Youtube-dl-exec has been installed.");
}

const ytdlBinaryDir = resolve(__dirname, "node_modules", "youtube-dl-exec", "bin")
if (!existsSync(resolve(ytdlBinaryDir, isUnix ? "yt-dlp" : "yt-dlp.exe"))) {
console.info("[INFO] Yt-dlp couldn't be found, trying to download...");
if (existsSync(resolve(ytdlBinaryDir, isUnix ? "youtube-dl" : "youtube-dl.exe"))) rmSync(resolve(ytdlBinaryDir, isUnix ? "youtube-dl" : "youtube-dl.exe"));
await require("youtube-dl-exec/scripts/postinstall");
console.info("[INFO] Yt-dlp has been downloaded.");
}
}
if (streamStrategy === "play-dl") {
try {
require("play-dl");
} catch {
console.info("[INFO] Installing play-dl...");
npmInstall(false, false, ["play-dl"]);
console.info("[INFO] Play-dl has been installed.");
}
}
console.info("[INFO] Starting the bot...");
require("./dist/index.js");
})();
Loading

0 comments on commit f5e60b5

Please sign in to comment.