1
0
mirror of https://github.com/musix-org/musix-oss synced 2025-07-06 19:00:50 +00:00

217 Commits
v3 ... v1

Author SHA1 Message Date
dd8546a7b5 Merge pull request #209 from musix-org/dependabot/npm_and_yarn/v1/discord.js-14.21.0
Bump discord.js from 14.20.0 to 14.21.0
2025-06-25 23:18:42 +00:00
c9c4c1b4f5 Bump discord.js from 14.20.0 to 14.21.0
Bumps [discord.js](https://github.com/discordjs/discord.js/tree/HEAD/packages/discord.js) from 14.20.0 to 14.21.0.
- [Release notes](https://github.com/discordjs/discord.js/releases)
- [Changelog](https://github.com/discordjs/discord.js/blob/14.21.0/packages/discord.js/CHANGELOG.md)
- [Commits](https://github.com/discordjs/discord.js/commits/14.21.0/packages/discord.js)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-25 23:18:32 +00:00
4b5fea03ee Merge pull request #206 from musix-org/dependabot/npm_and_yarn/v1/discord.js-14.20.0
Bump discord.js from 14.19.3 to 14.20.0
2025-06-17 01:28:40 +00:00
705e93757a Bump discord.js from 14.19.3 to 14.20.0
Bumps [discord.js](https://github.com/discordjs/discord.js/tree/HEAD/packages/discord.js) from 14.19.3 to 14.20.0.
- [Release notes](https://github.com/discordjs/discord.js/releases)
- [Changelog](https://github.com/discordjs/discord.js/blob/14.20.0/packages/discord.js/CHANGELOG.md)
- [Commits](https://github.com/discordjs/discord.js/commits/14.20.0/packages/discord.js)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-17 01:28:31 +00:00
93583d88f8 Merge pull request #187 from musix-org/dependabot/npm_and_yarn/v1/discord.js-14.19.3
Bump discord.js from 14.19.2 to 14.19.3
2025-05-02 23:16:16 +00:00
aeb235cd87 Bump discord.js from 14.19.2 to 14.19.3
Bumps [discord.js](https://github.com/discordjs/discord.js/tree/HEAD/packages/discord.js) from 14.19.2 to 14.19.3.
- [Release notes](https://github.com/discordjs/discord.js/releases)
- [Changelog](https://github.com/discordjs/discord.js/blob/14.19.3/packages/discord.js/CHANGELOG.md)
- [Commits](https://github.com/discordjs/discord.js/commits/14.19.3/packages/discord.js)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-02 23:16:07 +00:00
bc1477bdd8 Merge pull request #184 from musix-org/dependabot/npm_and_yarn/v1/discord.js-14.19.2
Bump discord.js from 14.18.0 to 14.19.2
2025-04-29 00:25:50 +00:00
d7f112c521 Bump discord.js from 14.18.0 to 14.19.2
Bumps [discord.js](https://github.com/discordjs/discord.js/tree/HEAD/packages/discord.js) from 14.18.0 to 14.19.2.
- [Release notes](https://github.com/discordjs/discord.js/releases)
- [Changelog](https://github.com/discordjs/discord.js/blob/14.19.2/packages/discord.js/CHANGELOG.md)
- [Commits](https://github.com/discordjs/discord.js/commits/14.19.2/packages/discord.js)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-29 00:25:41 +00:00
484ee0cbda Merge pull request #180 from musix-org/dependabot/npm_and_yarn/v1/nodemon-3.1.10
Bump nodemon from 3.1.9 to 3.1.10
2025-04-23 23:36:05 +00:00
04a2dd4cb0 Bump nodemon from 3.1.9 to 3.1.10
Bumps [nodemon](https://github.com/remy/nodemon) from 3.1.9 to 3.1.10.
- [Release notes](https://github.com/remy/nodemon/releases)
- [Commits](https://github.com/remy/nodemon/compare/v3.1.9...v3.1.10)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-23 23:35:53 +00:00
f1b31d05a3 Merge pull request #165 from musix-org/dependabot/npm_and_yarn/v1/discord.js-14.18.0
Bump discord.js from 14.17.3 to 14.18.0
2025-02-11 23:22:35 +00:00
0ed33d0062 Bump discord.js from 14.17.3 to 14.18.0
Bumps [discord.js](https://github.com/discordjs/discord.js/tree/HEAD/packages/discord.js) from 14.17.3 to 14.18.0.
- [Release notes](https://github.com/discordjs/discord.js/releases)
- [Changelog](https://github.com/discordjs/discord.js/blob/14.18.0/packages/discord.js/CHANGELOG.md)
- [Commits](https://github.com/discordjs/discord.js/commits/14.18.0/packages/discord.js)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-11 23:22:22 +00:00
e56e0b0506 Merge pull request #157 from musix-org/dependabot/npm_and_yarn/v1/discordjs/opus-0.10.0
Bump @discordjs/opus from 0.9.0 to 0.10.0
2025-01-29 00:06:48 +00:00
1f61e8e0c0 Bump @discordjs/opus from 0.9.0 to 0.10.0
Bumps [@discordjs/opus](https://github.com/discordjs/opus) from 0.9.0 to 0.10.0.
- [Release notes](https://github.com/discordjs/opus/releases)
- [Commits](https://github.com/discordjs/opus/compare/v0.9.0...v0.10.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-29 00:06:34 +00:00
66228e844a Merge pull request #150 from musix-org/dependabot/npm_and_yarn/v1/discord.js-14.17.3
Bump discord.js from 14.17.2 to 14.17.3
2025-01-08 23:25:40 +00:00
8a3f366fc5 Bump discord.js from 14.17.2 to 14.17.3
Bumps [discord.js](https://github.com/discordjs/discord.js/tree/HEAD/packages/discord.js) from 14.17.2 to 14.17.3.
- [Release notes](https://github.com/discordjs/discord.js/releases)
- [Changelog](https://github.com/discordjs/discord.js/blob/14.17.3/packages/discord.js/CHANGELOG.md)
- [Commits](https://github.com/discordjs/discord.js/commits/14.17.3/packages/discord.js)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-08 23:25:27 +00:00
3ba456c831 Merge pull request #149 from musix-org/dependabot/npm_and_yarn/v1/discord.js-14.17.2
Bump discord.js from 14.17.0 to 14.17.2
2025-01-02 23:55:06 +00:00
12930c874a Bump discord.js from 14.17.0 to 14.17.2
Bumps [discord.js](https://github.com/discordjs/discord.js/tree/HEAD/packages/discord.js) from 14.17.0 to 14.17.2.
- [Release notes](https://github.com/discordjs/discord.js/releases)
- [Changelog](https://github.com/discordjs/discord.js/blob/14.17.2/packages/discord.js/CHANGELOG.md)
- [Commits](https://github.com/discordjs/discord.js/commits/14.17.2/packages/discord.js)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-02 23:54:51 +00:00
15be34eaf4 Merge pull request #145 from musix-org/dependabot/npm_and_yarn/v1/discord.js-14.17.0
Bump discord.js from 14.16.3 to 14.17.0
2025-01-01 23:23:10 +00:00
67297de278 Bump discord.js from 14.16.3 to 14.17.0
Bumps [discord.js](https://github.com/discordjs/discord.js/tree/HEAD/packages/discord.js) from 14.16.3 to 14.17.0.
- [Release notes](https://github.com/discordjs/discord.js/releases)
- [Changelog](https://github.com/discordjs/discord.js/blob/14.17.0/packages/discord.js/CHANGELOG.md)
- [Commits](https://github.com/discordjs/discord.js/commits/14.17.0/packages/discord.js)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-01 23:22:58 +00:00
9c242c49ed Merge pull request #139 from musix-org/dependabot/npm_and_yarn/v1/nodemon-3.1.9
Bump nodemon from 3.1.7 to 3.1.9
2024-12-13 23:47:02 +00:00
0e223bcae3 Bump nodemon from 3.1.7 to 3.1.9
Bumps [nodemon](https://github.com/remy/nodemon) from 3.1.7 to 3.1.9.
- [Release notes](https://github.com/remy/nodemon/releases)
- [Commits](https://github.com/remy/nodemon/compare/v3.1.7...v3.1.9)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-13 23:46:51 +00:00
0eca2c9bcd Merge pull request #134 from musix-org/dependabot/npm_and_yarn/v1/ms-2.1.3
Bump ms from 2.1.2 to 2.1.3
2024-11-21 23:32:36 +00:00
d6bf153fa3 Bump ms from 2.1.2 to 2.1.3
Bumps [ms](https://github.com/vercel/ms) from 2.1.2 to 2.1.3.
- [Release notes](https://github.com/vercel/ms/releases)
- [Commits](https://github.com/vercel/ms/compare/2.1.2...2.1.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-21 23:32:23 +00:00
296d6e126a Merge pull request #129 from musix-org/dependabot/npm_and_yarn/v1/discordjs/voice-0.18.0
Bump @discordjs/voice from 0.17.0 to 0.18.0
2024-11-19 00:05:57 +00:00
e969bc438e Bump @discordjs/voice from 0.17.0 to 0.18.0
Bumps [@discordjs/voice](https://github.com/discordjs/discord.js/tree/HEAD/packages/voice) from 0.17.0 to 0.18.0.
- [Release notes](https://github.com/discordjs/discord.js/releases)
- [Changelog](https://github.com/discordjs/discord.js/blob/main/packages/voice/CHANGELOG.md)
- [Commits](https://github.com/discordjs/discord.js/commits/@discordjs/voice@0.18.0/packages/voice)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-19 00:05:44 +00:00
a02ba028e1 Merge pull request #113 from musix-org/dependabot/npm_and_yarn/v1/discord.js-14.16.3
Bump discord.js from 14.16.2 to 14.16.3
2024-09-30 23:34:23 +00:00
62c306ab4e Bump discord.js from 14.16.2 to 14.16.3
Bumps [discord.js](https://github.com/discordjs/discord.js/tree/HEAD/packages/discord.js) from 14.16.2 to 14.16.3.
- [Release notes](https://github.com/discordjs/discord.js/releases)
- [Changelog](https://github.com/discordjs/discord.js/blob/main/packages/discord.js/CHANGELOG.md)
- [Commits](https://github.com/discordjs/discord.js/commits/14.16.3/packages/discord.js)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-30 23:34:13 +00:00
89fbaca14e Merge pull request #108 from musix-org/dependabot/npm_and_yarn/v1/nodemon-3.1.7
Bump nodemon from 3.1.6 to 3.1.7
2024-09-20 23:36:23 +00:00
13936662f5 Bump nodemon from 3.1.6 to 3.1.7
Bumps [nodemon](https://github.com/remy/nodemon) from 3.1.6 to 3.1.7.
- [Release notes](https://github.com/remy/nodemon/releases)
- [Commits](https://github.com/remy/nodemon/compare/v3.1.6...v3.1.7)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-20 23:36:10 +00:00
672c693a17 Merge pull request #104 from musix-org/dependabot/npm_and_yarn/v1/nodemon-3.1.6
Bump nodemon from 3.1.5 to 3.1.6
2024-09-19 23:10:44 +00:00
2cdaabfe00 Bump nodemon from 3.1.5 to 3.1.6
Bumps [nodemon](https://github.com/remy/nodemon) from 3.1.5 to 3.1.6.
- [Release notes](https://github.com/remy/nodemon/releases)
- [Commits](https://github.com/remy/nodemon/compare/v3.1.5...v3.1.6)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-19 23:10:32 +00:00
54945b65fd Merge pull request #99 from musix-org/dependabot/npm_and_yarn/v1/nodemon-3.1.5
Bump nodemon from 3.1.4 to 3.1.5
2024-09-17 23:20:04 +00:00
1b074a3f0e Bump nodemon from 3.1.4 to 3.1.5
Bumps [nodemon](https://github.com/remy/nodemon) from 3.1.4 to 3.1.5.
- [Release notes](https://github.com/remy/nodemon/releases)
- [Commits](https://github.com/remy/nodemon/compare/v3.1.4...v3.1.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-17 23:19:53 +00:00
95ce5b3e57 Merge pull request #96 from musix-org/dependabot/npm_and_yarn/v1/discord.js-14.16.2
Bump discord.js from 14.16.1 to 14.16.2
2024-09-12 23:28:26 +00:00
60dd4aee38 Bump discord.js from 14.16.1 to 14.16.2
Bumps [discord.js](https://github.com/discordjs/discord.js/tree/HEAD/packages/discord.js) from 14.16.1 to 14.16.2.
- [Release notes](https://github.com/discordjs/discord.js/releases)
- [Changelog](https://github.com/discordjs/discord.js/blob/main/packages/discord.js/CHANGELOG.md)
- [Commits](https://github.com/discordjs/discord.js/commits/14.16.2/packages/discord.js)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-12 23:28:12 +00:00
4e15848715 Merge pull request #93 from musix-org/dependabot/npm_and_yarn/v1/discord.js-14.16.1
Bump discord.js from 14.15.3 to 14.16.1
2024-09-03 00:04:33 +00:00
efcaac75c5 Bump discord.js from 14.15.3 to 14.16.1
Bumps [discord.js](https://github.com/discordjs/discord.js/tree/HEAD/packages/discord.js) from 14.15.3 to 14.16.1.
- [Release notes](https://github.com/discordjs/discord.js/releases)
- [Changelog](https://github.com/discordjs/discord.js/blob/main/packages/discord.js/CHANGELOG.md)
- [Commits](https://github.com/discordjs/discord.js/commits/14.16.1/packages/discord.js)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-03 00:04:23 +00:00
6c2ea285b7 Merge pull request #72 from musix-org/dependabot/npm_and_yarn/v1/nodemon-3.1.4
Bump nodemon from 3.1.3 to 3.1.4
2024-06-20 23:51:49 +00:00
48b9f68848 Bump nodemon from 3.1.3 to 3.1.4
Bumps [nodemon](https://github.com/remy/nodemon) from 3.1.3 to 3.1.4.
- [Release notes](https://github.com/remy/nodemon/releases)
- [Commits](https://github.com/remy/nodemon/compare/v3.1.3...v3.1.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-20 23:51:38 +00:00
f1f5a81feb Merge pull request #69 from musix-org/dependabot/npm_and_yarn/v1/nodemon-3.1.3
Bump nodemon from 3.1.2 to 3.1.3
2024-06-03 23:40:44 +00:00
d2fc8552f1 Merge pull request #68 from musix-org/dependabot/npm_and_yarn/v1/discord.js-14.15.3
Bump discord.js from 14.15.2 to 14.15.3
2024-06-03 23:40:38 +00:00
5c2f5fdb73 Bump nodemon from 3.1.2 to 3.1.3
Bumps [nodemon](https://github.com/remy/nodemon) from 3.1.2 to 3.1.3.
- [Release notes](https://github.com/remy/nodemon/releases)
- [Commits](https://github.com/remy/nodemon/compare/v3.1.2...v3.1.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-03 23:40:32 +00:00
68c7c7874c Bump discord.js from 14.15.2 to 14.15.3
Bumps [discord.js](https://github.com/discordjs/discord.js/tree/HEAD/packages/discord.js) from 14.15.2 to 14.15.3.
- [Release notes](https://github.com/discordjs/discord.js/releases)
- [Changelog](https://github.com/discordjs/discord.js/blob/main/packages/discord.js/CHANGELOG.md)
- [Commits](https://github.com/discordjs/discord.js/commits/14.15.3/packages/discord.js)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-03 23:40:27 +00:00
3f44d06776 Merge pull request #63 from musix-org/dependabot/npm_and_yarn/v1/nodemon-3.1.2
Bump nodemon from 3.1.1 to 3.1.2
2024-05-30 00:00:21 +00:00
d2bad4ee78 Bump nodemon from 3.1.1 to 3.1.2
Bumps [nodemon](https://github.com/remy/nodemon) from 3.1.1 to 3.1.2.
- [Release notes](https://github.com/remy/nodemon/releases)
- [Commits](https://github.com/remy/nodemon/compare/v3.1.1...v3.1.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-30 00:00:08 +00:00
83d0aa5a8c Merge pull request #60 from musix-org/dependabot/npm_and_yarn/v1/nodemon-3.1.1
Bump nodemon from 3.1.0 to 3.1.1
2024-05-28 00:02:31 +00:00
6d5bcb0608 Bump nodemon from 3.1.0 to 3.1.1
Bumps [nodemon](https://github.com/remy/nodemon) from 3.1.0 to 3.1.1.
- [Release notes](https://github.com/remy/nodemon/releases)
- [Commits](https://github.com/remy/nodemon/compare/v3.1.0...v3.1.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-28 00:02:17 +00:00
def022897b Merge pull request #46 from musix-org/dependabot/npm_and_yarn/v1/discordjs/voice-0.17.0
Bump @discordjs/voice from 0.16.1 to 0.17.0
2024-05-22 23:40:27 +00:00
38fc626039 Bump @discordjs/voice from 0.16.1 to 0.17.0
Bumps [@discordjs/voice](https://github.com/discordjs/discord.js/tree/HEAD/packages/voice) from 0.16.1 to 0.17.0.
- [Release notes](https://github.com/discordjs/discord.js/releases)
- [Changelog](https://github.com/discordjs/discord.js/blob/main/packages/voice/CHANGELOG.md)
- [Commits](https://github.com/discordjs/discord.js/commits/@discordjs/voice@0.17.0/packages/voice)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-22 23:40:16 +00:00
04d6855bc8 Merge pull request #45 from musix-org/dependabot/npm_and_yarn/v1/discord.js-14.15.2
Bump discord.js from 14.14.1 to 14.15.2
2024-05-22 23:39:53 +00:00
34b3545a24 Bump discord.js from 14.14.1 to 14.15.2
Bumps [discord.js](https://github.com/discordjs/discord.js/tree/HEAD/packages/discord.js) from 14.14.1 to 14.15.2.
- [Release notes](https://github.com/discordjs/discord.js/releases)
- [Changelog](https://github.com/discordjs/discord.js/blob/main/packages/discord.js/CHANGELOG.md)
- [Commits](https://github.com/discordjs/discord.js/commits/14.15.2/packages/discord.js)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-22 23:39:42 +00:00
b1598f5f28 Merge branch 'master' into v1 2024-05-23 02:35:11 +03:00
806a3db028 Merge pull request #29 from musix-org/dependabot/npm_and_yarn/v1/nodemon-3.1.0
Bump nodemon from 3.0.3 to 3.1.0
2024-02-24 19:01:19 +02:00
44401d666c Bump nodemon from 3.0.3 to 3.1.0
Bumps [nodemon](https://github.com/remy/nodemon) from 3.0.3 to 3.1.0.
- [Release notes](https://github.com/remy/nodemon/releases)
- [Commits](https://github.com/remy/nodemon/compare/v3.0.3...v3.1.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-23 00:03:30 +00:00
bb6e1d28b9 Bumb Version 2024-02-09 08:04:20 +02:00
3dd931282e Merge branch 'master' into v1 2024-02-09 07:56:25 +02:00
ea19532261 Update README.md 2024-02-09 07:40:04 +02:00
c424c93330 Replace forgotten older prefix 2024-02-09 07:25:29 +02:00
a527f84c29 Fix code to work on this decade 2024-02-09 07:22:35 +02:00
cd0fc2beff Use nodemon in development 2024-02-09 01:03:02 +02:00
53241c9062 Package Name Update 2024-02-09 00:15:48 +02:00
bd1042f2ee Licensing Changes 2024-02-09 00:15:25 +02:00
dffe362648 Dependencies Update 2024-02-09 00:13:58 +02:00
d33ffc042a Merge branch 'master' into v1 2024-02-09 00:09:19 +02:00
35739461ba Merge branch 'master' into v1 2024-02-09 00:06:27 +02:00
440c7fe99e Merge pull request #1 from musix-org/dependabot/npm_and_yarn/v1/discord.js-14.14.1
Bump discord.js from 11.6.4 to 14.14.1
2024-02-09 00:02:54 +02:00
e75e6b4785 Bump discord.js from 11.6.4 to 14.14.1
Bumps [discord.js](https://github.com/discordjs/discord.js/tree/HEAD/packages/discord.js) from 11.6.4 to 14.14.1.
- [Release notes](https://github.com/discordjs/discord.js/releases)
- [Changelog](https://github.com/discordjs/discord.js/blob/main/packages/discord.js/CHANGELOG.md)
- [Commits](https://github.com/discordjs/discord.js/commits/14.14.1/packages/discord.js)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-08 22:02:47 +00:00
5479359f9a Merge pull request #2 from musix-org/dependabot/npm_and_yarn/v1/opusscript-0.1.1
Bump opusscript from 0.0.6 to 0.1.1
2024-02-09 00:01:49 +02:00
8a959de014 Merge pull request #4 from musix-org/dependabot/npm_and_yarn/v1/ytdl-core-4.11.5
Bump ytdl-core from 0.29.7 to 4.11.5
2024-02-09 00:01:40 +02:00
26841615a0 Bump opusscript from 0.0.6 to 0.1.1
Bumps [opusscript](https://github.com/abalabahaha/opusscript) from 0.0.6 to 0.1.1.
- [Release notes](https://github.com/abalabahaha/opusscript/releases)
- [Commits](https://github.com/abalabahaha/opusscript/compare/0.0.6...0.1.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-08 21:54:19 +00:00
3889c69eb3 Merge pull request #3 from musix-org/dependabot/npm_and_yarn/v1/ms-2.1.3
Bump ms from 2.1.2 to 2.1.3
2024-02-08 23:53:17 +02:00
5a87b39d09 Bump ytdl-core from 0.29.7 to 4.11.5
Bumps [ytdl-core](https://github.com/fent/node-ytdl-core) from 0.29.7 to 4.11.5.
- [Release notes](https://github.com/fent/node-ytdl-core/releases)
- [Commits](https://github.com/fent/node-ytdl-core/compare/v0.29.7...v4.11.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-08 21:52:19 +00:00
57aa500ee7 Bump ms from 2.1.2 to 2.1.3
Bumps [ms](https://github.com/vercel/ms) from 2.1.2 to 2.1.3.
- [Release notes](https://github.com/vercel/ms/releases)
- [Commits](https://github.com/vercel/ms/compare/2.1.2...2.1.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-08 21:52:12 +00:00
f23f819a3c Merge branch 'master' into v1 2024-02-08 23:28:12 +02:00
a58152a896 Merge remote-tracking branch 'musix-v1/master' into v1 2024-02-08 17:14:41 +02:00
2042a72b39 Merge pull request #3 from Musix-Development/dependabot/npm_and_yarn/ws-6.2.2
Bump ws from 6.2.1 to 6.2.2
2021-07-01 02:35:18 +03:00
b2fd69a6bd Bump ws from 6.2.1 to 6.2.2
Bumps [ws](https://github.com/websockets/ws) from 6.2.1 to 6.2.2.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/commits)

---
updated-dependencies:
- dependency-name: ws
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-06 16:26:57 +00:00
66332da136 Merge pull request #2 from Musix-Development/dependabot/npm_and_yarn/node-fetch-2.6.1
Bump node-fetch from 2.6.0 to 2.6.1
2021-03-28 18:34:16 +03:00
0d1c00fd53 Bump node-fetch from 2.6.0 to 2.6.1
Bumps [node-fetch](https://github.com/bitinn/node-fetch) from 2.6.0 to 2.6.1.
- [Release notes](https://github.com/bitinn/node-fetch/releases)
- [Changelog](https://github.com/node-fetch/node-fetch/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/bitinn/node-fetch/compare/v2.6.0...v2.6.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-27 12:41:31 +00:00
2b6db0e070 Update README.md 2020-07-19 13:34:37 +03:00
6b49a56f71 Update README.md 2020-07-19 13:31:33 +03:00
1c74df8e4e Fixes and updates after 9 months. 2020-04-29 11:59:31 +03:00
c5d5b049f3 Removed node_modules 2020-04-29 11:54:39 +03:00
47cd3e1539 Update index.js 2019-07-31 17:36:48 +03:00
4abc7ff3df Update index.js 2019-07-31 17:22:36 +03:00
e039afb074 Update index.js 2019-07-31 15:03:33 +03:00
fac41faf9e Update index.js 2019-07-31 10:04:41 +03:00
1d36a9d285 Update index.js 2019-07-31 09:57:34 +03:00
c0651f1ba1 Update index.js 2019-07-31 09:55:31 +03:00
53f9b2bb72 Update index.js 2019-07-30 17:36:15 +03:00
b31669bd9f Update index.js 2019-07-30 17:18:37 +03:00
aac527787e Update index.js 2019-07-30 17:14:23 +03:00
3c8e6ae403 Update index.js 2019-07-30 16:48:27 +03:00
4fb86fade4 Update index.js 2019-07-30 16:46:35 +03:00
ed5702c964 Update index.js 2019-07-30 16:44:41 +03:00
493df7e240 Update index.js 2019-07-30 16:34:58 +03:00
91098e2973 Update index.js 2019-07-30 16:31:28 +03:00
ee5a55de50 Update index.js 2019-07-30 16:29:36 +03:00
8af2a345d0 Update index.js 2019-07-30 16:25:51 +03:00
b30d497658 Update index.js 2019-07-30 16:20:00 +03:00
07534038d3 Update index.js 2019-07-30 16:18:23 +03:00
0e0d90c859 Update index.js 2019-07-30 16:16:04 +03:00
5bde5f2a02 Update index.js 2019-07-30 16:15:33 +03:00
668b6de332 Update index.js 2019-07-30 16:10:29 +03:00
d65d5aae9e Update index.js 2019-07-30 16:02:25 +03:00
f64f5dba92 Update index.js 2019-07-30 15:55:28 +03:00
d9e7d8d3ad Update index.js 2019-07-30 10:13:04 +03:00
47548f66d0 Update index.js 2019-07-30 08:12:37 +03:00
13b1a320ff Update index.js 2019-07-30 08:01:29 +03:00
0e39d7f210 Update index.js 2019-07-29 17:56:30 +03:00
2ee9414b90 Update index.js 2019-07-25 16:58:02 +03:00
c5ca2ec569 Update index.js 2019-07-25 16:47:22 +03:00
b4818b6ca4 Update index.js 2019-07-25 16:43:47 +03:00
b55e4f25ce Update index.js 2019-07-23 18:06:48 +03:00
cb10d308a0 Update index.js 2019-07-23 09:30:56 +03:00
f7d19118e9 Update index.js 2019-07-22 20:47:41 +03:00
1eded156f7 Update index.js 2019-07-19 12:20:22 +03:00
337bfe3a87 Update index.js 2019-07-19 11:09:38 +03:00
77b1c5fcd3 Update index.js 2019-07-19 10:42:38 +03:00
c0daa44536 Update index.js 2019-07-19 10:19:00 +03:00
8b821c5bb1 Update index.js 2019-07-18 20:33:04 +03:00
02e69b9398 Update index.js 2019-07-18 20:32:20 +03:00
e3b3178a5f Update index.js 2019-07-18 20:29:54 +03:00
41dc95cf1b Update index.js 2019-07-18 20:28:56 +03:00
c43698aa17 Update index.js 2019-07-18 20:23:19 +03:00
397ad03821 Update index.js 2019-07-18 20:19:28 +03:00
477707c341 Update index.js 2019-07-18 20:16:43 +03:00
de81037f05 Update index.js 2019-07-18 19:36:36 +03:00
9a6941aedf Update index.js 2019-07-12 09:52:00 +03:00
85b5a1b26c Update index.js 2019-07-12 09:47:28 +03:00
dd4e240925 Update index.js 2019-07-12 09:35:00 +03:00
730ce0dc1c Update index.js 2019-07-11 13:16:19 +03:00
1d224327bf Update index.js 2019-07-10 14:18:20 +03:00
4680497b0e Update index.js 2019-07-10 14:17:13 +03:00
adb964cef0 Update index.js 2019-07-10 14:05:38 +03:00
49d9b04d05 Update index.js 2019-07-10 14:03:02 +03:00
ac55c4ec9f Update index.js 2019-07-10 13:13:24 +03:00
ad3a5c751d Update index.js 2019-07-10 13:11:50 +03:00
6a1d049938 Update index.js 2019-07-10 13:01:42 +03:00
3dea69bfec Update index.js 2019-07-09 12:17:33 +03:00
c6a15eb1a0 Update index.js 2019-07-09 12:16:11 +03:00
ca99bb7f9c Update index.js 2019-06-20 07:26:09 -07:00
5400f0d14f Update index.js 2019-06-18 20:58:36 +03:00
02d6d42173 Update index.js 2019-06-18 18:24:11 +03:00
fdb012be2d Update index.js 2019-06-18 18:23:45 +03:00
4c013f2df7 Update index.js 2019-06-18 18:23:20 +03:00
1b36d9b7f5 Update index.js 2019-06-18 18:22:29 +03:00
33d3907512 Update index.js 2019-06-18 18:03:01 +03:00
2e2f7c2e9a Update index.js 2019-06-18 17:59:58 +03:00
04662353f2 Update index.js 2019-06-18 10:54:46 +03:00
6646f7c118 Update index.js 2019-06-18 10:53:04 +03:00
ed6710eacb Update index.js 2019-06-18 10:25:11 +03:00
41b8199958 Update index.js 2019-06-18 10:19:05 +03:00
43a2f99cb0 Update index.js 2019-06-18 10:15:56 +03:00
e37beacaf3 Update index.js 2019-06-16 21:00:04 +03:00
0f2a622a84 Update index.js 2019-06-16 17:57:55 +03:00
fd30344bd8 Update index.js 2019-06-16 17:08:35 +03:00
b966010a37 Update index.js 2019-06-16 17:04:37 +03:00
20938dd9b9 Update index.js 2019-06-16 16:28:54 +03:00
728ea82a7d Update index.js 2019-06-16 16:25:12 +03:00
99e5c6903d Update index.js 2019-06-16 16:05:38 +03:00
2a0d3aab24 Update index.js 2019-06-16 16:03:14 +03:00
b8dc88ed85 Update index.js 2019-06-13 10:43:06 +03:00
4a85a7e842 Update index.js 2019-06-13 10:41:53 +03:00
ee4829ca28 Update index.js 2019-06-13 10:38:45 +03:00
1b2a6fd7e3 Update index.js 2019-06-13 10:36:34 +03:00
36e1ea30bd Update index.js 2019-06-12 13:21:36 +03:00
a40248bc4a Ytdl-core update 2019-06-12 12:26:54 +03:00
2a308321ae Update index.js 2019-06-10 21:24:21 +03:00
38197d8ce9 Update index.js 2019-06-10 21:22:50 +03:00
1e645020cc Update index.js 2019-06-10 08:38:23 +03:00
2771302154 Update index.js 2019-06-10 08:37:21 +03:00
c065136b8a Update index.js 2019-06-10 08:32:29 +03:00
735dec1949 Update index.js 2019-06-10 08:29:29 +03:00
eb8774b289 Update index.js 2019-06-09 22:49:44 +03:00
b66a3b73d7 Update index.js 2019-06-09 22:42:05 +03:00
81eda3780d Update index.js 2019-06-09 22:37:54 +03:00
fc9d955a68 Update index.js 2019-06-09 22:33:55 +03:00
54a8d3174d Update index.js 2019-06-09 22:31:08 +03:00
1f0180cf13 Update index.js 2019-06-06 07:50:21 +03:00
6af5b45823 Update index.js 2019-06-06 07:46:44 +03:00
b0eac04971 Update index.js 2019-06-06 07:43:43 +03:00
bfb105808d Update index.js 2019-06-06 07:42:53 +03:00
a33fcd9c40 Update index.js 2019-06-06 07:38:59 +03:00
6b70f6599d Update index.js 2019-06-05 20:10:54 +03:00
ca15b1361e Update index.js 2019-06-05 20:07:54 +03:00
33e87d8774 Update index.js 2019-06-05 16:39:01 +03:00
eb039662f1 Update index.js 2019-06-05 16:32:20 +03:00
9e7d75927b Update index.js 2019-06-05 16:29:58 +03:00
7e6a6a03ef Update index.js 2019-06-03 16:21:23 +03:00
04314762cc Update index.js 2019-06-01 09:23:23 +03:00
b8416bac27 Update index.js 2019-05-31 21:43:07 +03:00
bd3008c072 Update index.js 2019-05-31 21:38:53 +03:00
43b71ddb69 Update index.js 2019-05-31 21:34:54 +03:00
936befb259 Update index.js 2019-05-31 21:32:55 +03:00
551007caee Update index.js 2019-05-31 21:32:05 +03:00
23f5cdfce3 Update index.js 2019-05-31 16:05:35 +03:00
eb40a640d2 Update index.js 2019-05-31 16:05:05 +03:00
f7274b1ce9 Update index.js 2019-05-31 16:01:59 +03:00
c703f244a1 Update index.js 2019-05-31 15:59:26 +03:00
9aa5dc7769 Update index.js 2019-05-31 15:57:17 +03:00
60db516870 Update index.js 2019-05-30 21:14:31 +03:00
e5df70d320 Update index.js 2019-05-30 21:05:16 +03:00
bc636ce416 Update index.js 2019-05-30 20:24:40 +03:00
e24b4f0899 Update index.js 2019-05-30 16:58:34 +03:00
aef0d98225 Update index.js 2019-05-30 16:55:40 +03:00
97ee60c9a2 Update index.js 2019-05-30 16:50:56 +03:00
46ca9b4f25 Update index.js 2019-05-30 16:46:31 +03:00
61de1c2041 Update index.js 2019-05-30 14:08:30 +03:00
7ebcec8eed Update index.js 2019-05-30 14:05:47 +03:00
3bf7adf902 Update index.js 2019-05-30 14:04:07 +03:00
13ba629479 Update index.js 2019-05-30 13:22:58 +03:00
2aaf8ba525 Update index.js 2019-05-30 13:21:56 +03:00
c525181752 fix 2019-05-30 12:10:19 +03:00
5eb0264906 fix 2019-05-30 12:06:47 +03:00
cbdffcf19c Start 2019-05-30 12:01:25 +03:00
70 changed files with 550 additions and 4782 deletions

3
.env_example Normal file
View File

@ -0,0 +1,3 @@
DISCORD_API_TOKEN=
BOT_PREFIX=
YOUTUBE_API_KEY=

3
.gitignore vendored
View File

@ -1,4 +1 @@
node_modules
.env
.vscode
serviceAccount.json

View File

@ -3,6 +3,9 @@ FROM docker.io/node:20-alpine
#Dependencies
RUN apk add --virtual .build-deps python3 make g++ gcc git
#Code Dependencies
RUN apk add --virtual .code-deps ffmpeg
WORKDIR /usr/src/app
COPY / /usr/src/app/

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2020-2024 Musix Org
Copyright (c) 2019-2024 Musix Org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

1
Procfile Normal file
View File

@ -0,0 +1 @@
worker: node index.js

View File

@ -1 +1 @@
# Musix OSS - V3
# Musix OSS - V1

417
index.js
View File

@ -1,31 +1,400 @@
const { ShardingManager} = require("discord.js");
const config = require("./src/config/config.js");
const DiscordWebhook = require("discord-webhook-node");
const { AudioPlayerStatus, createAudioPlayer, createAudioResource, getVoiceConnection, joinVoiceChannel, NoSubscriberBehavior } = require('@discordjs/voice');
const { Client, ActivityType, PermissionFlagsBits } = require('discord.js');
const Discord = require('discord.js');
const YouTube = require('simple-youtube-api')
const ytdl = require('ytdl-core');
const PREFIX = (process.env.BOT_PREFIX ?? "mx>");
const client = new Client({
intents: [
"Guilds",
"GuildMessages",
"GuildVoiceStates",
"MessageContent"
],
disableMentions: 'everyone'
});
const youtube = new YouTube(process.env.YOUTUBE_API_KEY);
const queue = new Map();
client.login(process.env.DISCORD_API_TOKEN);
client.on('ready', () => {
client.user.setActivity(`${PREFIX}help`, { type: ActivityType.Listening })
client.user.setStatus('online');
});
client.on('messageCreate', async msg => {
if (!msg.guild || msg.author.bot) return;
if (msg.content.startsWith(`${PREFIX}`)) {
if (msg.content === `${PREFIX}ping`) {
msg.channel.send(`My current Ping: **${Math.floor(client.ws.ping * 10) / 10} ms**.`);
return;
}
if (msg.content === `${PREFIX}help`) {
const embed = new Discord.EmbedBuilder()
.setTitle('Commands for ' + client.user.username + '!')
.addFields(
{ name: '```' + `${PREFIX}` + 'play | ' + `${PREFIX}` + 'p```', value: 'Play a song.', inline: true },
{ name: '```' + `${PREFIX}` + 'queue | ' + `${PREFIX}` + 'q```', value: 'Display the queue.', inline: true },
{ name: '```' + `${PREFIX}` + 'nowplaying | ' + `${PREFIX}` + 'np```', value: 'Display whats currently playing.', inline: true },
{ name: '```' + `${PREFIX}` + 'volume```', value: 'Change or check the volume.', inline: true },
{ name: '```' + `${PREFIX}` + 'pause```', value: 'Pause the music.', inline: true },
{ name: '```' + `${PREFIX}` + 'resume```', value: 'Resume the music.', inline: true },
{ name: '```' + `${PREFIX}` + 'stop```', value: 'Stop the music, Clear the queue and leave the current voice channel.', inline: true },
{ name: '```' + `${PREFIX}` + 'skip | ' + `${PREFIX}` + 's```', value: 'Skip a song.', inline: true },
{ name: '```' + `${PREFIX}` + 'invite```', value: 'Invite ' + client.user.username + '.', inline: true },
{ name: '```' + `${PREFIX}` + 'ping```', value: 'See the current ping for ' + client.user.username, inline: true },
{ name: '```' + `${PREFIX}` + 'info```', value: 'Display info and instructions.', inline: true },
{ name: '```' + `${PREFIX}` + 'help```', value: 'Display the help.', inline: true }
)
.setAuthor({ name: client.user.username, iconURL: client.user.avatarURL() })
.setColor('#b50002');
msg.channel.send({ embeds: [embed] });
return undefined;
}
if (msg.content === `${PREFIX}info`) {
var line = '**>-----------------------------------------------------------------------<**';
var dj = msg.guild.roles.cache.find(x => x.name === 'DJ') ? true : false;
const embed = new Discord.EmbedBuilder()
.setTitle('**' + client.user.username + ' instructions and info**:')
.addFields(
{ name: 'If your current guild has a role called \'DJ\' you will need it to use music commands! If your current guild doesn\'t have a role called \'DJ\' everyone can use music commands!', value:'DJ role existance: ' + dj, inline: true },
{ name: 'If you encounter any errors with ' + client.user.username + ' please report about them on the offical ' + client.user.username + ' support server!', value: 'https://discord.gg/rvHuJtB', inline: true },
{ name: `On errors you can do ${PREFIX}stop to reset the queue and try again!`, value: line, inline: true },
{ name: 'Current Ping in milliseconds', value: `${Math.floor(client.ws.ping * 10) / 10} ms`, inline: true },
{ name: 'Be careful with the Volume command! Volume is not recommended to be put over 3 with user volume at 100%!', value: 'Volume will reset to 1 always when a new song begins!', inline: true }
)
.setAuthor({ name: client.user.username, iconURL: client.user.avatarURL() })
.setColor('#b50002');
msg.channel.send({ embeds: [embed] });
return undefined;
}
if (msg.content === `${PREFIX}invite`) {
msg.channel.send('Invite me with:' + '\n' + 'https://discord.com/oauth2/authorize?client_id=' + client.user.id + '&permissions=2184465408&scope=applications.commands+bot');
return undefined;
}
if (msg.member.guild.roles.cache.find(x => x.name === 'DJ')) {
if (msg.member.roles.cache.find(x => x.name === 'DJ')) {
const args = msg.content.split(' ');
const searchString = args.slice(1).join(' ');
const url = args[1] ? args[1].replace(/<(.+)>/g, '$1') : '';
const serverQueue = queue.get(msg.guild.id);
if (config.devMode) {
console.log("- dev mode- ");
config.shards = 1;
let command = msg.content.toLowerCase().split(' ')[0];
command = command.slice(PREFIX.length);
if (command === 'play' || command === 'p') {
if (!args[1]) return msg.channel.send(':x: I\'m sorry but you didn\'t specify a song');
const voiceChannel = msg.member.voice.channel;
if (!voiceChannel) return msg.channel.send(':x: I\'m sorry but you need to be in a voice channel to play music!');
const permissions = voiceChannel.permissionsFor(msg.client.user);
if (!permissions.has(PermissionFlagsBits.Connect)) {
return msg.channel.send(':x: I cannot connect to your voice channel, make sure I have the proper permissions!');
}
if (!permissions.has(PermissionFlagsBits.Speak)) {
return msg.channel.send(':x: I cannot speak in this voice channel, make sure I have the proper permissions!');
}
if (url.match(/^https?:\/\/(www.youtube.com|youtube.com)\/playlist(.*)$/)) {
const playlist = await youtube.getPlaylist(url);
const videos = await playlist.getVideos();
for (const video of Object.values(videos)) {
const video2 = await youtube.getVideoByID(video.id);
await handleVideo(video2, msg, voiceChannel, true);
}
return msg.channel.send(`:white_check_mark: Playlist: **${playlist.title}** has been added to the queue!`);
} else {
try {
var video = await youtube.getVideo(url);
} catch (error) {
try {
var videos = await youtube.searchVideos(searchString, 10);
let index = 0;
msg.channel.send(`
__**Song selection:**__
${videos.map(video2 => `**${++index} -** ${video2.title}`).join('\n')}
Please provide a value to select one of the search results ranging from 1-10.
`);
try {
var response = await msg.channel.awaitMessages({
filter: msg2 => msg2.content > 0 && msg2.content < 11,
max: 1,
time: 10000,
errors: ['time']
});
} catch (err) {
return msg.channel.send(':x: Cancelling song selection.');
}
const videoIndex = parseInt(response.first().content);
var video = await youtube.getVideoByID(videos[videoIndex - 1].id);
} catch (err) {
return msg.channel.send(':x: I could not obtain any search results.');
}
}
return handleVideo(video, msg, voiceChannel);
}
} else if (command === 'skip' || command === 's') {
if (!msg.member.voice.channel) return msg.channel.send(':x: You are not in a voice channel!');
if (!serverQueue) return msg.channel.send(':x: There is nothing playing that I could skip for you.');
if (!serverQueue.songs[1]) return msg.channel.send(':x: Theres nothing to skip to!')
serverQueue.audioPlayer.stop();
return;
} else if (command === 'stop') {
if (!msg.member.voice.channel) return msg.channel.send(':x: You are not in a voice channel!');
if (!serverQueue) return msg.channel.send(':x: There is nothing playing that I could stop for you.');
serverQueue.songs = [];
serverQueue.audioPlayer.stop();
return;
} else if (command === 'volume') {
if (!msg.member.voice.channel) return msg.channel.send(':x: You are not in a voice channel!');
if (!serverQueue) return msg.channel.send(':x: There is nothing playing.');
if (!args[1]) return msg.channel.send(`The current volume is: **${serverQueue.volume}** :speaker:`);
if (isNaN(args[1])) {
return msg.channel.send(':x: I\'m sorry, But you need to enter a valid __number__.')
}
serverQueue.volume = args[1];
serverQueue.audioResource.volume.setVolume(args[1] / 100);
return msg.channel.send(`I set the volume to: **${args[1]}** 🔊`);
} else if (command === 'np' || command === 'nowplaying') {
if (!serverQueue) return msg.channel.send(':x: There is nothing playing.');
return msg.channel.send(`:musical_note: Now playing: **${serverQueue.songs[0].title}**`);
} else if (command === "queue" || command === 'q') {
if (!serverQueue)
return msg.channel.send(":x: There is nothing in the queue.");
var queuemessage = `__**Song queue:**__
${serverQueue.songs.map(song => `**-** ${song.title}`).join("\n")}
**Now playing:** ${serverQueue.songs[0].title} :musical_note: `;
if (queuemessage.length > 2000) {
return msg.channel.send(":x: The queue has too many songs in it to show all in this channel. Try again after a few songs.");
}
return msg.channel.send(queuemessage);
} else if (command === 'pause') {
if (serverQueue && serverQueue.playing) {
serverQueue.playing = false;
serverQueue.audioPlayer.pause();
return msg.channel.send(':pause_button: Paused the music for you!');
}
return msg.channel.send(':x: There is nothing playing.');
} else if (command === 'resume') {
if (serverQueue && !serverQueue.playing) {
serverQueue.playing = true;
serverQueue.audioPlayer.unpause();
return msg.channel.send(':play_pause: Resumed the music for you!');
}
return msg.channel.send(':x: There is nothing playing.');
}
if (msg.content === `${PREFIX}`) return;
msg.channel.send(`:x: Unknown command! Type ${PREFIX}help for the list of commands!`)
return;
}
if (msg.content === `${PREFIX}`) return;
var coms = [`${PREFIX}play`, `${PREFIX}queue`, `${PREFIX}np`, `${PREFIX}volume`, `${PREFIX}pause`, `${PREFIX}resume`, `${PREFIX}stop`, `${PREFIX}skip`, `${PREFIX}ping`, `${PREFIX}q`, `${PREFIX}nowplaying`, `${PREFIX}p`, `${PREFIX}s`];
for (var i = 0; i < coms.length; i++) {
if (msg.content.includes(coms[i])) {
if (!msg.member.roles.cache.find(x => x.name === 'DJ')) {
msg.channel.send(':x: i\'m sorry but you need to have the \'DJ\' role to use music commands!')
return;
}
}
}
msg.channel.send(`:x: Unknown command! Type ${PREFIX}help for the list of commands!`)
return;
} else {
const args = msg.content.split(' ');
const searchString = args.slice(1).join(' ');
const url = args[1] ? args[1].replace(/<(.+)>/g, '$1') : '';
const serverQueue = queue.get(msg.guild.id);
let command = msg.content.toLowerCase().split(' ')[0];
command = command.slice(PREFIX.length)
if (command === 'play' || command === 'p') {
if (!args[1]) return msg.channel.send(':x: I think you forgot what you wanted to play!');
const voiceChannel = msg.member.voice.channel;
if (!voiceChannel) return msg.channel.send(':x: I\'m sorry but you need to be in a voice channel to play music!');
const permissions = voiceChannel.permissionsFor(msg.client.user);
if (!permissions.has(PermissionFlagsBits.Connect)) {
return msg.channel.send(':x: I cannot connect to your voice channel, make sure I have the proper permissions!');
}
if (!permissions.has(PermissionFlagsBits.Speak)) {
return msg.channel.send(':x: I cannot speak in this voice channel, make sure I have the proper permissions!');
}
const manager = new ShardingManager("./src/bot.js", {
token: config.token,
respawn: config.respawn,
totalShards: config.shards,
if (url.match(/^https?:\/\/(www.youtube.com|youtube.com)\/playlist(.*)$/)) {
const playlist = await youtube.getPlaylist(url);
const videos = await playlist.getVideos();
for (const video of Object.values(videos)) {
const video2 = await youtube.getVideoByID(video.id); // eslint-disable-line no-await-in-loop
await handleVideo(video2, msg, voiceChannel, true); // eslint-disable-line no-await-in-loop
}
return msg.channel.send(`:white_check_mark: Playlist: **${playlist.title}** has been added to the queue!`);
} else {
try {
var video = await youtube.getVideo(url);
} catch (error) {
try {
var videos = await youtube.searchVideos(searchString, 10);
let index = 0;
msg.channel.send(`
__**Song selection:**__
${videos.map(video2 => `**${++index} -** ${video2.title}`).join('\n')}
Please provide a value to select one of the search results ranging from 1-10.
`);
// eslint-disable-next-line max-depth
try {
var response = await msg.channel.awaitMessages(msg2 => msg2.content > 0 && msg2.content < 11, {
maxMatches: 1,
time: 10000,
errors: ['time']
});
} catch (err) {
return msg.channel.send(':x: No or invalid value entered, cancelling video selection.');
}
const videoIndex = parseInt(response.first().content);
var video = await youtube.getVideoByID(videos[videoIndex - 1].id);
} catch (err) {
console.error(err);
return msg.channel.send(':x: I could not obtain any search results.');
}
}
return handleVideo(video, msg, voiceChannel);
}
} else if (command === 'skip' || command === 's') {
if (!msg.member.voice.channel) return msg.channel.send(':x: You are not in a voice channel!');
if (!serverQueue) return msg.channel.send(':x: There is nothing playing that I could skip for you.');
msg.channel.send('Skipped :thumbsup:')
serverQueue.audioPlayer.stop();
return undefined;
} else if (command === 'stop') {
if (!msg.member.voice.channel) return msg.channel.send(':x: You are not in a voice channel!');
if (!serverQueue) return msg.channel.send(':x: There is nothing playing that I could stop for you.');
msg.channel.send('Stopped the music! :stop_button:')
serverQueue.songs = [];
serverQueue.audioPlayer.stop();
return undefined;
} else if (command === 'volume') {
if (!msg.member.voice.channel) return msg.channel.send(':x: You are not in a voice channel!');
if (!serverQueue) return msg.channel.send(':x: There is nothing playing.');
if (!args[1]) return msg.channel.send(`The current volume is: **${serverQueue.volume}** :speaker:`);
if (isNaN(args[1])) {
return msg.channel.send(':x: I\'m sorry, But you need to enter a valid __number__.')
}
serverQueue.volume = args[1];
serverQueue.audioResource.volume.setVolume(args[1] / 100);
return msg.channel.send(`I set the volume to: **${args[1]}** 🔊`);
} else if (command === 'np' || command === 'nowplaying') {
if (!serverQueue) return msg.channel.send(':x: There is nothing playing.');
return msg.channel.send(`:musical_note: Now playing: **${serverQueue.songs[0].title}**`);
} else if (command === "queue" || command === 'q') {
if (!serverQueue)
return msg.channel.send(":x: There is nothing in the queue.");
var queuemessage = `__**Song queue:**__
${serverQueue.songs.map(song => `**-** ${song.title}`).join("\n")}
**Now playing:** ${serverQueue.songs[0].title} :musical_note: `;
if (queuemessage.length < 2000) {
return msg.channel.send(":x: The queue has too many songs in it to show all in this channel. Try again after a few songs");
}
return msg.channel.send(queuemessage);
} else if (command === 'pause') {
if (serverQueue && serverQueue.playing) {
serverQueue.playing = false;
serverQueue.audioPlayer.pause();
return msg.channel.send(':pause_button: Paused the music for you!');
}
return msg.channel.send(':x: There is nothing playing.');
} else if (command === 'resume') {
if (serverQueue && !serverQueue.playing) {
serverQueue.playing = true;
serverQueue.audioPlayer.unpause();
return msg.channel.send(':play_pause: Resumed the music for you!');
}
return msg.channel.send(':x: There is nothing playing.');
}
}
if (msg.content === `${PREFIX}`) {
return;
}
msg.channel.send(`:x: Unknown command! Type ${PREFIX}help for the list of commands!`)
return;
}
});
console.log("- Launching shards -");
manager.spawn(config.shards, config.shardDelay, config.shardTimeout);
manager.on("shardCreate", (shard) =>
console.log(`- Launched shard ${shard.id} -`)
);
const oldConsole = {};
oldConsole.log = console.log;
console.log = function (arg) {
oldConsole.log(arg);
async function handleVideo(video, msg, voiceChannel, playlist = false) {
const serverQueue = queue.get(msg.guild.id);
const song = {
id: video.id,
title: video.title,
url: `https://www.youtube.com/watch?v=${video.id}`
};
if (!serverQueue) {
const queueConstruct = {
textChannel: msg.channel,
voiceChannel: voiceChannel,
connection: null,
audioPlayer: createAudioPlayer({
behaviors: {
noSubscriber: NoSubscriberBehavior.Play,
}
}),
audioResource: null,
songs: [],
volume: 50,
playing: true
};
oldConsole.error = console.error;
console.error = function (arg) {
oldConsole.error(arg);
};
queue.set(msg.guild.id, queueConstruct);
queueConstruct.songs.push(song);
try {
const connection =
getVoiceConnection(voiceChannel.guild.id) ??
joinVoiceChannel({
channelId: voiceChannel.id,
guildId: voiceChannel.guild.id,
adapterCreator: voiceChannel.guild.voiceAdapterCreator
});
queueConstruct.connection = connection;
play(msg.guild, queueConstruct.songs[0]);
} catch (error) {
console.error(`I could not join the voice channel: ${error}`);
queue.delete(msg.guild.id);
return msg.channel.send(`:x: I could not join the voice channel: ${error}`);
}
} else {
serverQueue.songs.push(song);
if (playlist) return undefined;
else return msg.channel.send(`:white_check_mark: **${song.title}** has been added to the queue!`);
}
return undefined;
}
function play(guild, song) {
const serverQueue = queue.get(guild.id);
if (!song) {
serverQueue.connection.destroy();
queue.delete(guild.id);
return;
}
serverQueue.audioPlayer
.on(AudioPlayerStatus.Idle, () => {
serverQueue.songs.shift();
serverQueue.audioPlayer.removeAllListeners();
play(guild, serverQueue.songs[0]);
})
.on('error', (error) => {
console.error(error)
});
const audioResource = createAudioResource(ytdl(song.url, { quality: `highestaudio`, filter: 'audioonly' }),{
inlineVolume: true
});
audioResource.volume.setVolume(serverQueue.volume / 100);
serverQueue.audioPlayer.play(audioResource);
serverQueue.audioResource = audioResource;
serverQueue.connection.subscribe(serverQueue.audioPlayer);
serverQueue.textChannel.send(`:musical_note: Start playing: **${song.title}**`);
}

2352
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,37 +1,24 @@
{
"name": "musix-oss",
"version": "3.11.0",
"description": "V3 for Musix the discord music bot",
"main": "./index.js",
"version": "1.3.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "node --max-old-space-size=3072 index.js",
"start:dev": "nodemon"
"start": "node index.js",
"start:dev": "nodemon",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/musix-org/musix-oss.git"
},
"author": "Musix Org",
"keywords": [],
"author": "",
"license": "MIT",
"bugs": {
"url": "https://github.com/musix-org/musix-oss/issues",
"support": "https://discord.gg/rvHuJtB"
},
"homepage": "https://musix-org.github.io/",
"dependencies": {
"@discordjs/opus": "^0.10.0",
"discord-webhook-node": "^1.1.8",
"discord.js": "^14.21.0",
"dotenv": "^17.0.1",
"firebase": "^11.10.0",
"firebase-admin": "^13.4.0",
"he": "^1.2.0",
"prism-media": "^1.3.5",
"@discordjs/voice": "^0.18.0",
"@discordjs/opus": "^0.10.0",
"ms": "^2.1.3",
"request": "^2.88.2",
"simple-youtube-api": "^5.2.1",
"spotify-web-api-node": "^5.0.2",
"ytdl-core": "^4.11.5",
"ytsr": "^3.8.4"
"ytdl-core": "^4.11.5"
},
"devDependencies": {
"nodemon": "^3.1.10"

View File

@ -1,14 +0,0 @@
const MusicClient = require("./client.js");
const DiscordWebhook = require("discord-webhook-node");
const client = new MusicClient({});
const oldConsole = {};
oldConsole.log = console.log;
console.log = function (arg) {
oldConsole.log(arg);
};
oldConsole.error = console.error;
console.error = function (arg) {
oldConsole.error(arg);
};

View File

@ -1,82 +0,0 @@
const {
Client,
Collection,
Intents
} = require("discord.js");
const admin = require("firebase-admin");
const serviceAccount = require("./config/serviceAccount.json");
const fs = require("fs");
const path = require("path");
const SpotifyApi = require("spotify-web-api-node");
const YouTube = require("simple-youtube-api");
const config = require("./config/config");
const GatewayIntents = new Intents();
GatewayIntents.add(
1 << 0, // GUILDS
1 << 7, // GUILD_VOICE_STATES
1 << 9, // GUILD_MESSAGES,
1 << 15 // MESSAGE_CONTENT
);
module.exports = class extends Client {
constructor() {
super({
disableMentions: "everyone",
disabledEvents: ["TYPING_START"],
ws: {
intents: GatewayIntents
}
});
admin.initializeApp({
credential: admin.credential.cert(serviceAccount),
});
this.commands = new Collection();
this.settingCmd = new Collection();
this.queue = new Map();
this.spotify = new SpotifyApi({
id: config.spotify_client_id,
secret: config.spotify_client_secret,
});
this.youtube = new YouTube(config.youtube_api_key);
this.config = config;
this.funcs = {};
this.dispatcher = {};
this.messages = require("./config/messages.js");
this.db = admin.firestore();
this.db.FieldValue = require("firebase-admin").firestore.FieldValue;
this.global = {
db: {
guilds: {},
}
};
this.logs = [];
fs.readdirSync(path.join(__dirname, "funcs")).forEach((filename) => {
this.funcs[filename.slice(0, -3)] = require(`./funcs/${filename}`);
});
const commandFiles = fs
.readdirSync(path.join(path.dirname(__dirname), "commands"))
.filter((f) => f.endsWith(".js"));
for (const file of commandFiles) {
const command = require(`../commands/${file}`);
command.uses = 0;
this.commands.set(command.name, command);
}
const settingFiles = fs
.readdirSync(path.join(path.dirname(__dirname), "commands/settings"))
.filter((f) => f.endsWith(".js"));
for (const file of settingFiles) {
const option = require(`../commands/settings/${file}`);
this.settingCmd.set(option.name, option);
}
require("./events/clientEvents/handler.js")(this);
this.login(this.config.discord_api_token).catch((err) =>
console.log("Failed to login: " + err)
);
}
};

View File

@ -1,33 +0,0 @@
module.exports = {
name: "bass",
description: "Boost the bass in your music!",
alias: ["none"],
usage: "<bass>",
permission: "MANAGE_MESSAGES",
category: "audio modifiers",
execute(msg, args, client, command) {
const queue = client.queue.get(msg.guild.id);
if (!args[1] && queue)
return msg.channel.send(
`${client.messages.currentBass}**${queue.bass}**`
);
const bass = parseFloat(args[1]);
if (client.funcs.check(client, msg, command)) {
if (queue.nightCore)
return msg.channel.send(client.messages.disableNightCore);
if (isNaN(bass)) return msg.channel.send(client.messages.validNumber);
if (bass > 10) return msg.channel.send(client.messages.maxBass);
if (bass < 0) return msg.channel.send(client.messages.positiveBass);
queue.bass = bass;
client.funcs.end(
client,
msg,
(queue.connection.dispatcher.streamTime + queue.time) / 1000,
command
);
let message;
message = client.messages.bassApplied.replace("%BASS%", bass);
return msg.channel.send(message);
}
},
};

View File

@ -1,39 +0,0 @@
const { EmbedBuilder } = require("discord.js");
module.exports = {
name: 'help',
alias: ["h"],
usage: '<command(opt)>',
description: 'See the help for Musix.',
permission: 'none',
category: 'info',
execute(msg, args, client, command) {
if (args[1]) {
if (!client.commands.has(args[1]) || (client.commands.has(args[1]) && client.commands.get(args[1]).omitFromHelp === true && msg.guild.id !== '489083836240494593')) return msg.channel.send('That command does not exist');
const command = client.commands.get(args[1]);
const embed = new EmbedBuilder()
.setTitle(`${client.global.db.guilds[msg.guild.id].prefix}${command.name} ${command.usage}`)
.setDescription(command.description)
.setFooter({ text:`${client.messages.helpCmdFooter} \`${command.alias.map(a => `${a}, `)}\`` })
.setColor(client.config.embedColor)
msg.channel.send(embed);
} else {
const categories = [];
for (let i = 0; i < client.commands.size; i++) {
if (!categories.includes(client.commands.array()[i].category)) categories.push(client.commands.array()[i].category);
}
let commands = '';
for (let i = 0; i < categories.length; i++) {
commands += `**» ${categories[i].toUpperCase()}**\n${client.commands.filter(x => x.category === categories[i] && !x.omitFromHelp).map(x => `\`${x.name}\``).join(', ')}\n`;
}
let message;
message = client.messages.helpFooter.replace("%PREFIX%", client.global.db.guilds[msg.guild.id].prefix);
const embed = new EmbedBuilder()
.setTitle(`${client.user.username} ${client.messages.helpTitle}`)
.setDescription(commands)
.setFooter({ text: message })
.setColor(client.config.embedColor)
msg.channel.send(embed);
}
}
};

View File

@ -1,17 +0,0 @@
const { EmbedBuilder } = require("discord.js");
module.exports = {
name: 'invite',
alias: ["i"],
usage: '',
description: 'Invite Musix.',
permission: 'none',
category: 'info',
execute(msg, args, client, command) {
const embed = new EmbedBuilder()
.setTitle(client.messages.inviteTitle)
.setURL(client.config.invite)
.setColor(client.config.embedColor)
msg.channel.send(embed);
}
};

View File

@ -1,20 +0,0 @@
module.exports = {
name: 'loop',
alias: [],
usage: '',
description: 'loop the queue.',
permission: 'MANAGE_MESSAGES',
category: 'music control',
async execute(msg, args, client, command) {
const queue = client.queue.get(msg.guild.id);
if (client.funcs.check(client, msg, command)) {
if (!queue.looping) {
queue.looping = true;
msg.channel.send(client.messages.looping);
} else {
queue.looping = false;
msg.channel.send(client.messages.noLooping);
}
}
}
};

View File

@ -1,22 +0,0 @@
module.exports = {
name: 'loopsong',
alias: ["none"],
usage: '',
description: 'loop the currently playing song.',
permission: 'MANAGE_MESSAGES',
category: 'music control',
async execute(msg, args, client, command) {
const queue = client.queue.get(msg.guild.id);
if (client.funcs.check(client, msg, command)) {
if (!queue.songLooping) {
queue.songLooping = true;
let message;
message = client.messages.loopingSong.replace("%TITLE%", queue.songs[0].title);
msg.channel.send(message);
} else {
queue.songLooping = false;
msg.channel.send(client.messages.noLoopingSong);
}
}
}
};

View File

@ -1,37 +0,0 @@
const { EmbedBuilder } = require("discord.js");
const { getLyrics } = require("genius-lyrics-api");
module.exports = {
name: "lyrics",
alias: ["l"],
usage: "<song>",
description: "see the lyrics for a song",
permission: "none",
category: "util",
async execute(msg, args, client, prefix, command) {
const searchString = args.slice(1).join(" ");
const options = {
apiKey: client.config.genius_api_key,
title: searchString,
artist: "",
optimizeQuery: true,
};
const queue = client.queue.get(msg.guild.id);
if (queue && !args[1]) options.title = queue.songs[0].title;
if (!queue && !args[1])
return msg.channel.send(client.messages.lyricsUsage);
getLyrics(options).then((lyrics) => {
if (lyrics === null)
return msg.channel.send(client.messages.noResultsLyrics);
for (let i = 0; i < lyrics.length; i += 2000) {
let toi = "";
toi = lyrics.substring(i, Math.min(lyrics.length, i + 2000));
const embed = new EmbedBuilder()
.setTitle(client.messages.lyricsTitle)
.setDescription(toi)
.setColor(client.config.embedColor);
msg.channel.send(embed);
}
});
},
};

View File

@ -1,25 +0,0 @@
module.exports = {
name: "nightcore",
alias: ["nc"],
usage: "<true/false>",
description: "Change nightcore audio modifier on/off",
permission: "MANAGE_MESSAGES",
category: "audio modifiers",
async execute(msg, args, client, command) {
const queue = client.queue.get(msg.guild.id);
if (!args[1] && queue)
return msg.channel.send(
`${client.messages.currentNightCore}**${queue.nightCore}**`
);
if (client.funcs.check(client, msg, command)) {
if (args[1] === "true") {
queue.nightCore = true;
} else if (args[1] === "false") {
queue.nightCore = false;
} else return msg.channel.send(client.messages.boolean);
let message;
message = client.messages.nightCoreApplied.replace("%BOOLEAN%", args[1]);
return msg.channel.send(message);
}
},
};

View File

@ -1,48 +0,0 @@
const { EmbedBuilder } = require("discord.js");
module.exports = {
name: "nowplaying",
alias: ["np", "playing"],
usage: "",
description: "See the currently playing song position and length.",
permission: "none",
category: "info",
async execute(msg, args, client, command) {
const queue = client.queue.get(msg.guild.id);
if (!queue || !queue.songs[0] || !queue.connection || !queue.connection.dispatcher) return msg.channel.send(client.messages.noServerQueue);
let songTime = (queue.songs[0].info.lengthSeconds * 1000).toFixed(0);
let completed = (
queue.connection.dispatcher.streamTime + queue.time
).toFixed(0);
let barlength = 30;
let completedpercent = ((completed / songTime) * barlength).toFixed(0);
let array = [];
for (let i = 0; i < completedpercent - 1; i++) {
array.push("⎯");
}
array.push("🔘");
for (let i = 0; i < barlength - completedpercent - 1; i++) {
array.push("⎯");
}
const thumbnail = queue.songs[0].info.thumbnail.thumbnails[4] || queue.songs[0].info.thumbnail.thumbnails[3] || queue.songs[0].info.thumbnail.thumbnails[2] || queue.songs[0].info.thumbnail.thumbnails[1] || queue.songs[0].info.thumbnail.thumbnails[0];
const embed = new EmbedBuilder()
.setTitle(client.messages.nowPlaying)
.setDescription(
`${client.messages.nowPlayingDesc} ${
queue.songs[0].title
}\n\`${array.join("")}\`\n\`${client.funcs.msToTime(
completed,
"hh:mm:ss"
)} / ${client.funcs.msToTime(songTime, "hh:mm:ss")}\`\nchannel: \`${queue.songs[0].info.author.name}\``
)
.setFooter({ text: `Queued by ${queue.songs[0].author.tag}`})
.setURL(queue.songs[0].url)
.setThumbnail(thumbnail.url)
.setColor(client.config.embedColor);
if (queue.nightCore)
embed.setDescription(
`${client.messages.nowPlayingDesc} ${queue.songs[0].title} \nchannel: \`${queue.songs[0].info.author.name}\``
);
return msg.channel.send(embed);
},
};

View File

@ -1,17 +0,0 @@
module.exports = {
name: 'pause',
alias: ["none"],
usage: '',
description: 'Pause the currently playing music.',
permission: 'MANAGE_MESSAGES',
category: 'music control',
execute(msg, args, client, command) {
const queue = client.queue.get(msg.guild.id);
if (client.funcs.check(client, msg, command)) {
if (queue.paused) return msg.channel.send(client.messages.alreadyPaused);
queue.paused = true;
queue.connection.dispatcher.pause(true);
return msg.channel.send(client.messages.paused);
}
}
};

View File

@ -1,401 +0,0 @@
const ytdl = require("ytdl-core");
const ytsr = require("ytsr");
module.exports = {
name: "play",
alias: ["p", "music"],
usage: "<song name>",
description: "Play some music.",
permission: "none",
category: "play",
async execute(msg, args, client, command) {
const searchString = args.slice(1).join(" ");
const url = args[1] ? args[1].replace(/<(.+)>/g, "$1") : "";
const queue = client.queue.get(msg.guild.id);
const voiceChannel = msg.member.voice.channel;
if (
client.global.db.guilds[msg.guild.id].blacklist.includes(
msg.member.voice.channelID
)
)
return msg.channel.send(client.messages.blackListedVC);
if (!queue) {
if (!msg.member.voice.channel)
return msg.channel.send(client.messages.noVoiceChannel);
} else {
if (voiceChannel !== queue.voiceChannel)
return msg.channel.send(client.messages.wrongVoiceChannel);
}
if (!args[1]) return msg.channel.send(client.messages.noQuery);
if (voiceChannel.full) return msg.channel.send(client.messages.channelFull);
if (!voiceChannel.joinable)
return msg.channel.send(client.messages.noPermsConnect);
if (!voiceChannel.speakable)
return msg.channel.send(client.messages.noPermsSpeak);
if (ytdl.validateURL(url)) {
client.funcs.handleVideo(url, msg, voiceChannel, client, false, "ytdl");
} else if (url.match(/^https?:\/\/(open.spotify.com|spotify.com)(.*)$/)) {
if (url.includes("playlist")) {
const playlistId = url.split("/playlist/")[1].split("?")[0];
client.spotify.getPlaylist(playlistId).then(
async function (data) {
searchPlaylist(data, client, msg, voiceChannel);
},
function (err) {
console.log(err);
msg.channel.send(client.messages.noResultsSpotify);
}
);
} else if (url.includes("album")) {
const albumId = url.split("/album/")[1].split("?")[0];
client.spotify.getAlbumTracks(albumId).then(
async function (data) {
searchAlbum(data, client, msg, voiceChannel);
},
function (err) {
console.log(err);
msg.channel.send(client.messages.noResultsSpotify);
}
);
} else if (url.includes("track")) {
return msg.channel.send(client.messages.disabledSpotifySongs);
/*const trackId = url.split("/track/")[1].split("?")[0];
spotify.searchTracks(trackId)
.then(function (data) {
console.log(data.body)
}, function (err) {
console.log('Something went wrong!', err);
});*/
} else msg.channel.send(client.messages.invalidSpotifyUrl);
} else if (
url.match(/^https?:\/\/(www.youtube.com|youtube.com)\/playlist(.*)$/)
) {
const lmsg = await msg.channel.send(client.messages.loadingSongs);
const playlist = await client.youtube.getPlaylist(url).catch((err) => {
console.log("err1");
});
const videos = await playlist.getVideos().catch((err) => {
console.log("err2");
});
for (const video of Object.values(videos)) {
const video2 = await client.youtube.getVideoByID(video.id).catch((err) => {
console.log("err3");
});
client.spotify.searchTracks(`track:${video2.name}`).then(
function (data) {
client.funcs.handleVideo(
video2.url,
msg,
voiceChannel,
client,
true,
"ytdl",
data.body.tracks.items[0]
);
},
function (err) {
console.log("Something went wrong!", err);
}
);
}
const message = client.messages.playlistAdded.replace(
"%TITLE%",
playlist.title
);
return lmsg.edit(message);
} else {
ytsr(
searchString, {
limit: 5,
},
function (err, res) {
if (err) console.log(err);
if (!res.items[0]) return msg.channel.send(client.messages.noResults);
const videoResults = res.items.filter(
(item) => item.type === "video"
);
client.spotify.searchTracks(`track:${searchString}`).then(
function (data) {
client.funcs.handleVideo(
videoResults[0].link,
msg,
voiceChannel,
client,
false,
"ytdl",
data.body.tracks.items[0]
);
},
function (err) {
console.log(err);
}
);
}
);
}
},
};
async function searchPlaylist(data, client, msg, voiceChannel) {
const lmsg = await msg.channel.send(client.messages.loadingSongs);
let failed = 0;
for (let i = 0; data.body.tracks.items.length > i; i++) {
const track = await data.body.tracks.items[i].track;
await client.funcs.sleep(250);
ytsr(
`${track.artists[0].name} ${track.name} audio`, {
limit: 5,
},
async function (err, res) {
if (err) return console.log(err);
if (!res.items[0]) {
ytsr(
`${track.artists[0].name} ${track.name} lyrics`, {
limit: 5,
},
async function (err, res) {
if (err) return console.log(err);
if (!res.items[0]) {
ytsr(
`${track.artists[0].name} ${track.name}`, {
limit: 5,
},
async function (err, res) {
if (err) console.log(err);
if (!res.items[0]) {
failed++;
}
const videoResults = res.items.filter(
(item) => item.type === "video"
);
client.funcs.handleVideo(
videoResults[0].link,
msg,
voiceChannel,
client,
false,
"spotify",
track
);
}
);
return;
}
const videoResults = res.items.filter(
(item) => item.type === "video"
);
await client.funcs.handleVideo(
videoResults[0].link,
msg,
voiceChannel,
client,
true,
"spotify",
track
);
}
);
failed++;
return;
}
const videoResults = res.items.filter((item) => item.type === "video");
await client.funcs.handleVideo(
videoResults[0].link,
msg,
voiceChannel,
client,
true,
"spotify",
track
);
}
);
}
let message;
if (failed === 0) {
message = client.messages.playlistAdded.replace("%TITLE%", data.body.name);
} else {
message = `${client.messages.playlistAdded.replace(
"%TITLE%",
data.body.name
)}\n${client.messages.failedToLoad + failed}`;
}
lmsg.edit(message);
}
async function searchAlbum(data, client, msg, voiceChannel) {
const lmsg = await msg.channel.send(client.messages.loadingSongs);
let failed = 0;
for (let i = 0; data.body.items.length > i; i++) {
const track = await data.body.items[i];
await client.funcs.sleep(250);
ytsr(
`${track.artists[0].name} ${track.name} audio`, {
limit: 5,
},
async function (err, res) {
if (err) return console.log(err);
if (!res.items[0]) {
ytsr(
`${track.artists[0].name} ${track.name} lyrics`, {
limit: 5,
},
async function (err, res) {
if (err) return console.log(err);
if (!res.items[0]) {
ytsr(
`${track.artists[0].name} ${track.name}`, {
limit: 5,
},
async function (err, res) {
if (err) console.log(err);
if (!res.items[0]) {
failed++;
}
const videoResults = res.items.filter(
(item) => item.type === "video"
);
client.funcs.handleVideo(
videoResults[0].link,
msg,
voiceChannel,
client,
false,
"spotify",
track
);
}
);
return;
}
const videoResults = res.items.filter(
(item) => item.type === "video"
);
await client.funcs.handleVideo(
videoResults[0].link,
msg,
voiceChannel,
client,
true,
"spotify",
track
);
}
);
failed++;
return;
}
const videoResults = res.items.filter((item) => item.type === "video");
await client.funcs.handleVideo(
videoResults[0].link,
msg,
voiceChannel,
client,
true,
"spotify",
track
);
}
);
}
let message;
if (failed === 0) {
message = client.messages.albumAdded.replace(
"%TITLE%",
"yes taht palylist"
);
} else {
message = `${client.messages.albumAdded.replace(
"%TITLE%",
"yes taht palylist"
)}\n${client.messages.failedToLoad + failed}`;
}
lmsg.edit(message);
}
async function searchSong(data, client, msg, voiceChannel) {
const lmsg = await msg.channel.send(client.messages.loadingSongs);
let failed = 0;
for (let i = 0; data.body.tracks.items.length > i; i++) {
const track = await data.body.tracks.items[i].track;
await client.funcs.sleep(250);
ytsr(
`${track.artists[0].name} ${track.name} audio`, {
limit: 5,
},
async function (err, res) {
if (err) return console.log(err);
if (!res.items[0]) {
ytsr(
`${track.artists[0].name} ${track.name} lyrics`, {
limit: 5,
},
async function (err, res) {
if (err) return console.log(err);
if (!res.items[0]) {
ytsr(
`${track.artists[0].name} ${track.name}`, {
limit: 5,
},
async function (err, res) {
if (err) console.log(err);
if (!res.items[0]) {
failed++;
}
const videoResults = res.items.filter(
(item) => item.type === "video"
);
client.funcs.handleVideo(
videoResults[0].link,
msg,
voiceChannel,
client,
false,
"spotify",
track
);
}
);
return;
}
const videoResults = res.items.filter(
(item) => item.type === "video"
);
await client.funcs.handleVideo(
videoResults[0].link,
msg,
voiceChannel,
client,
true,
"spotify",
track
);
}
);
failed++;
return;
}
const videoResults = res.items.filter((item) => item.type === "video");
await client.funcs.handleVideo(
videoResults[0].link,
msg,
voiceChannel,
client,
true,
"spotify",
track
);
}
);
}
let message;
if (failed === 0) {
message = client.messages.playlistAdded.replace("%TITLE%", data.body.name);
} else {
message = `${client.messages.playlistAdded.replace(
"%TITLE%",
data.body.name
)}\n${client.messages.failedToLoad + failed}`;
}
lmsg.edit(message);
}

View File

@ -1,17 +0,0 @@
module.exports = {
name: 'previous',
alias: ["prev", "return", "back"],
usage: '',
description: 'Play the previous song.',
permission: 'MANAGE_MESSAGES',
category: 'music control',
async execute(msg, args, client, command) {
const queue = client.queue.get(msg.guild.id)
if (client.funcs.check(client, msg, command)) {
if (queue.prevSongs.length < 1) return msg.channel.send(client.messages.noPreviousSongs);
queue.endReason = "previous";
queue.connection.dispatcher.end()
msg.channel.send(client.messages.previousSong)
}
}
};

View File

@ -1,29 +0,0 @@
const { EmbedBuilder } = require("discord.js");
module.exports = {
name: 'queue',
alias: ["q", "list", "ls", "songs"],
usage: '',
description: 'See the queue.',
permission: 'none',
category: 'info',
async execute(msg, args, client, command) {
const queue = client.queue.get(msg.guild.id);
if (!queue) return msg.channel.send(client.messages.noServerQueue);
const page = 1;
let queuesongs = queue.songs.slice((page - 1) * 20 + 1, page * 20 + 1);
let queuemessage = `${queuesongs.map(song => `**#** ${song.title}`).join('\n')}`
const hashs = queuemessage.split('**#**').length;
for (let i = 0; i < hashs; i++) {
queuemessage = queuemessage.replace('**#**', `**${i + 1}**`);
}
let message;
message = client.messages.queueDesc.replace("%SONG%", queue.songs[0].title);
const embed = new EmbedBuilder()
.setTitle(client.messages.queueTitle)
.setDescription(`${message}\n${queuemessage}`)
.setFooter({ text: `${queue.songs.length - 1} ${client.messages.queueFooter}`})
.setColor(client.config.embedColor)
return msg.channel.send(embed);
}
};

View File

@ -1,31 +0,0 @@
module.exports = {
name: "remove",
alias: ["rm", "delete", "del"],
usage: "<song pos>",
description: "Remove a song from the queue",
permission: "MANAGE_MESSAGES",
category: "music control",
execute(msg, args, client, command) {
const queue = client.queue.get(msg.guild.id);
if (client.funcs.check(client, msg, command)) {
if (!args[1]) return msg.channel.send(client.messages.provideASong);
const pos = parseInt(args[1]);
if (isNaN(pos)) return msg.channel.send(client.messages.validNumber);
if (pos < 1) return msg.channel.send(client.messages.noSongs);
let message1;
let message2;
message1 = client.messages.queueLength.replace(
"%SONGS%",
queue.songs.length - 1
);
if (pos < 0) return msg.channel.send(client.messages.noSongsInQueue);
if (pos >= queue.songs.length) return msg.channel.send(message1);
message2 = client.messages.removed.replace(
"%SONG%",
queue.songs[pos].title
);
msg.channel.send(message2);
return queue.songs.splice(pos, 1);
}
},
};

View File

@ -1,15 +0,0 @@
module.exports = {
name: 'replay',
alias: ["rp"],
usage: '',
description: 'Replay the currently playing song.',
permission: 'MANAGE_MESSAGES',
category: 'play',
async execute(msg, args, client, command) {
const queue = client.queue.get(msg.guild.id);
if (client.funcs.check(client, msg, command)) {
queue.endReason = "replay";
queue.connection.dispatcher.end()
}
}
};

View File

@ -1,17 +0,0 @@
module.exports = {
name: 'resume',
alias: ["continue"],
usage: '',
description: 'Resume the paused music.',
permission: 'MANAGE_MESSAGES',
category: 'music control',
execute(msg, args, client, command) {
const queue = client.queue.get(msg.guild.id);
if (client.funcs.check(client, msg, command)) {
if (!queue.paused) return msg.channel.send(client.messages.notPaused);
queue.paused = false;
queue.connection.dispatcher.resume();
return msg.channel.send(client.messages.resumed);
}
}
};

View File

@ -1,61 +0,0 @@
const ytsr = require('ytsr');
const he = require('he');
const { EmbedBuilder } = require('discord.js');
module.exports = {
name: 'search',
alias: ["sr", "find"],
usage: '<search word(s)>',
description: 'Search the top 10 queryes and choose one.',
permission: 'none',
category: 'play',
async execute(msg, args, client, command) {
const searchString = args.slice(1).join(" ");
const queue = client.queue.get(msg.guild.id);
const voiceChannel = msg.member.voice.channel;
if (!queue) {
if (!msg.member.voice.channel) return msg.channel.send(client.messages.noVoiceChannel);
} else {
if (voiceChannel !== queue.voiceChannel) return msg.channel.send(client.messages.wrongVoiceChannel);
}
if (!args[1]) return msg.channel.send(client.messages.noQuery);
if (voiceChannel.full) return msg.channel.send(client.messages.channelFull);
if (!voiceChannel.joinable) return msg.channel.send(client.messages.noPermsConnect);
if (!voiceChannel.speakable) return msg.channel.send(client.messages.noPermsSpeak);
ytsr(searchString, {
limit: 20,
}, async function (err, res) {
if (err) return console.log(err);
if (!res.items[0]) return msg.channel.send(client.messages.noResults);
const videoResults = res.items.filter(item => item.type === "video");
const videos = videoResults.slice(0, 10);
let index = 0;
const embed = new EmbedBuilder()
.setTitle(client.messages.songSelection)
.setDescription(`${videos.map(video2 => `**${++index}** ${he.decode(video2.title)} `).join('\n')}`)
.setFooter({ text: client.messages.provideANumber })
.setColor(client.config.embedColor)
msg.channel.send(embed);
try {
var response = await msg.channel.awaitMessages(message2 => message2.content > 0 && message2.content < 11 && message2.author === msg.author, {
max: 1,
time: 10000,
errors: ['time']
});
} catch (err) {
console.error(err);
return msg.channel.send(client.messages.cancellingVideoSelection);
}
const videoIndex = parseInt(response.first().content) - 1;
client.spotify.searchTracks(`track:${videos[videoIndex].title}`)
.then(function (data) {
client.funcs.handleVideo(
videos[videoIndex].link, msg, voiceChannel, client, false, "ytdl",
data.body.tracks.items[0]
);
}, function (err) {
console.log('Something went wrong!', err);
});
})
}
};

View File

@ -1,36 +0,0 @@
module.exports = {
name: "seek",
alias: ["none"],
usage: "<point in song (seconds)>",
description: "Seek to a specific point in the currently playing song.",
permission: "MANAGE_MESSAGES",
category: "music control",
async execute(msg, args, client, command) {
const queue = client.queue.get(msg.guild.id);
if (client.funcs.check(client, msg, command)) {
if (queue.nightCore)
return msg.channel.send(client.messages.disableNightCore);
if (!args[1])
return msg.channel.send(
`${client.messages.correctUsage}\`${
client.global.db.guilds[msg.guild.id].prefix
}seek ${command.usage}\``
);
const pos = parseInt(args[1]);
if (isNaN(pos)) return msg.channel.send(client.messages.validNumber);
if (pos < 0)
return msg.channel.send(client.messages.seekingPointPositive);
const totalLength = parseInt(queue.songs[0].info.lengthSeconds);
let message;
if (pos > totalLength) {
message = client.messages.seekMax.replace(
"%LENGTH%",
queue.songs[0].info.lengthSeconds
);
return msg.channel.send(message);
}
client.funcs.end(client, msg, pos, command);
}
},
};

View File

@ -1,55 +0,0 @@
const { EmbedBuilder } = require("discord.js");
module.exports = {
name: "settings",
alias: ["options", "ops", "preferences"],
usage: "<setting> <value(opt)>",
description: "Change the server settings for Musix.",
permission: "MANAGE_GUILD",
category: "util",
async execute(msg, args, client, command) {
let footer;
footer = client.messages.settingsFooter.replace(
"%PREFIX%",
client.global.db.guilds[msg.guild.id].prefix
);
const embed = new EmbedBuilder()
.setTitle(client.messages.settingsTitle)
.addFields(
{ name: client.messages.settingsPrefix, value: client.messages.settingsPrefixDesc, inline: true },
{ name: client.messages.settingsVolume, value: client.messages.settingsVolumeDesc, inline: true },
{ name: client.messages.settingsBlacklist, value: client.messages.settingsBlacklistDesc, inline: true },
{ name: client.messages.settingsPermissions, value: client.messages.settingsPermissionsDesc, inline: true },
{ name: client.messages.settingsSetDj, value: client.messages.settingsSetDjDesc, inline: true },
{ name: client.messages.settingsAnnounceSongs, value: client.messages.settingsAnnounceSongsDesc },
{ name: client.messages.settingsBass, value: client.messages.settingsBassDesc, inline: true },
{ name: client.messages.settingsAutoPlay, value: client.messages.settingsAutoPlayDesc, inline: true }
)
.setFooter({ text: footer })
.setAuthor({ name: client.user.username, iconURL: client.user.avatarURL() })
.setColor(client.config.embedColor);
const permissions = msg.channel.permissionsFor(msg.author);
if (msg.author.id !== client.config.devId) {
if (!permissions.has(command.permission))
return msg.channel.send(client.messages.noPermsManageSettings);
}
if (args[1]) {
const optionName = args[1].toLowerCase();
const option =
client.settingCmd.get(optionName) ||
client.settingCmd.find(
(cmd) => cmd.aliases && cmd.aliases.includes(optionName)
);
if (!option) return msg.channel.send(embed);
try {
option.execute(msg, args, client);
} catch (error) {
msg.reply(client.messages.errorExeOpt);
console.log(error.toString());
console.log(error.stack.replace(/at /g, "**at **"));
}
} else {
return msg.channel.send(embed);
}
},
};

View File

@ -1,17 +0,0 @@
module.exports = {
name: 'announcesongs',
async execute(msg, args, client) {
if (!args[2]) return msg.channel.send(`${client.messages.announceSongs} \`${client.global.db.guilds[msg.guild.id].announceSongs}\``);
if (args[2] === 'true') {
if (!client.global.db.guilds[msg.guild.id].announceSongs) {
client.global.db.guilds[msg.guild.id].announceSongs = true;
msg.channel.send(client.messages.announceSongsTrue);
} else return msg.channel.send(client.messages.announceSongsTrue);
} else if (args[2] === 'false') {
if (client.global.db.guilds[msg.guild.id].announceSongs) {
client.global.db.guilds[msg.guild.id].announceSongs = false;
msg.channel.send(client.messages.announceSongsFalse);
} else return msg.channel.send(client.messages.announceSongsFalse);
} else return msg.channel.send(client.messages.boolean);
}
};

View File

@ -1,17 +0,0 @@
module.exports = {
name: 'autoplay',
async execute(msg, args, client) {
if (!args[2]) return msg.channel.send(`${client.messages.autoPlay} \`${client.global.db.guilds[msg.guild.id].autoPlay}\``);
if (args[2] === 'true') {
if (!client.global.db.guilds[msg.guild.id].autoPlay) {
client.global.db.guilds[msg.guild.id].autoPlay = true;
msg.channel.send(client.messages.autoPlayTrue);
} else return msg.channel.send(client.messages.autoPlayTrue);
} else if (args[2] === 'false') {
if (client.global.db.guilds[msg.guild.id].autoPlay) {
client.global.db.guilds[msg.guild.id].autoPlay = false;
msg.channel.send(client.messages.autoPlayFalse);
} else return msg.channel.send(client.messages.autoPlayFalse);
} else return msg.channel.send(client.messages.boolean);
}
};

View File

@ -1,14 +0,0 @@
module.exports = {
name: 'bass',
async execute(msg, args, client) {
if (!args[2]) return msg.channel.send(client.messages.currentDefaultBass + client.global.db.guilds[msg.guild.id].bass);
if (args[2] === "false") {
client.global.db.guilds[msg.guild.id].bass = false;
return msg.channel.send(client.messages.bassFalse);
}
const level = parseInt(args[2]);
if (isNaN(level)) return msg.channel.send(client.messages.validNumber);
client.global.db.guilds[msg.guild.id].bass = level;
msg.channel.send(`${client.messages.bassLevel} ${level}!`);
}
};

View File

@ -1,115 +0,0 @@
const { EmbedBuilder } = require("discord.js");
module.exports = {
name: "blacklist",
async execute(msg, args, client) {
let embed;
switch (args[2]) {
case "add":
if (msg.mentions.channels.first()) {
if (
client.global.db.guilds[msg.guild.id].blacklist.includes(
msg.mentions.channels.first().id
)
)
return msg.channel.send(client.messages.channelAlreadyBlackListed);
} else if (
client.global.db.guilds[msg.guild.id].blacklist.includes(args[3])
)
return msg.channel.send(client.messages.channelAlreadyBlackListed);
if (
!msg.guild.channels.cache.get(args[3]) &&
!msg.mentions.channels.first()
)
return msg.channel.send(client.messages.idOrMentionChannel);
if (msg.mentions.channels.first()) {
client.global.db.guilds[msg.guild.id].blacklist.push(
msg.mentions.channels.first().id
);
let message;
message = client.messages.channelAdded.replace(
"%CHANNEL%",
msg.mentions.channels.first().name
);
msg.channel.send(message);
} else {
client.global.db.guilds[msg.guild.id].blacklist.push(args[3]);
let message;
message = client.messages.channelAdded.replace(
"%CHANNEL%",
msg.guild.channels.cache.get(args[3]).name
);
msg.channel.send(message);
}
break;
case "remove":
if (msg.mentions.channels.first()) {
if (
!client.global.db.guilds[msg.guild.id].blacklist.includes(
msg.mentions.channels.first().id
)
)
return msg.channel.send(client.messages.channelNotBlackListed);
if (
client.global.db.guilds[msg.guild.id].blacklist.indexOf(
msg.mentions.channels.first().id
) !== -1
) {
client.global.db.guilds[msg.guild.id].blacklist.splice(
client.global.db.guilds[msg.guild.id].blacklist.indexOf(
msg.mentions.channels.first().id
),
1
);
let message;
message = client.messages.channelRemoved.replace(
"%CHANNEL%",
msg.mentions.channels.first().name
);
msg.channel.send(message);
}
} else {
if (!client.global.db.guilds[msg.guild.id].blacklist.includes(args[3]))
return msg.channel.send(client.messages.channelNotBlackListed);
if (
client.global.db.guilds[msg.guild.id].blacklist.indexOf(args[3]) !==
-1
) {
client.global.db.guilds[msg.guild.id].blacklist.splice(
client.global.db.guilds[msg.guild.id].blacklist.indexOf(args[3]),
1
);
let message;
message = client.messages.channelRemoved.replace(
"%CHANNEL%",
msg.guild.channels.cache.get(args[3]).name
);
msg.channel.send(message);
}
}
break;
case "list":
embed = new EmbedBuilder()
.setTitle(client.messages.blacklistTitle)
.setDescription(
`${client.global.db.guilds[msg.guild.id].blacklist
.map((c) => `**-** <#${c}>`)
.join("\n")}`
)
.setColor(client.config.embedColor);
msg.channel.send(embed);
break;
case undefined:
embed = new EmbedBuilder()
.setTitle(client.messages.blacklistTitle)
.addFields(
{ name: "add", value: "Add a channel to the blacklist. (ID or mention)" },
{ name: "remove", value: "Remove a channel from the blacklist. (ID or mention)" },
{ name: "list", value: "List the currently blacklisted channels." }
)
.setColor(client.config.embedColor);
msg.channel.send(embed);
break;
}
},
};

View File

@ -1,17 +0,0 @@
module.exports = {
name: 'permissions',
async execute(msg, args, client) {
if (!args[2]) return msg.channel.send(`${client.messages.permission} \`${client.global.db.guilds[msg.guild.id].permissions}\``);
if (args[2] === 'true') {
if (!client.global.db.guilds[msg.guild.id].permissions) {
client.global.db.guilds[msg.guild.id].permissions = true;
msg.channel.send(client.messages.permissionsSetTrue);
} else return msg.channel.send(client.messages.permissionsTrue);
} else if (args[2] === 'false') {
if (client.global.db.guilds[msg.guild.id].permissions) {
client.global.db.guilds[msg.guild.id].permissions = false;
msg.channel.send(client.messages.permissionsSetFalse);
} else return msg.channel.send(client.messages.permissionsFalse);
} else return msg.channel.send(client.messages.boolean);
}
};

View File

@ -1,9 +0,0 @@
module.exports = {
name: 'prefix',
async execute(msg, args, client) {
if (!args[2]) return msg.channel.send(`${client.messages.currentPrefix} \`${client.global.db.guilds[msg.guild.id].prefix}\``);
if (args[2].length > 5) return msg.channel.send(client.messages.prefixMaxLength);
client.global.db.guilds[msg.guild.id].prefix = args[2];
msg.channel.send(`${client.messages.prefixSet} \`${args[2]}\``);
}
};

View File

@ -1,27 +0,0 @@
module.exports = {
name: "premium",
async execute(msg, args, client) {
if (!args[2])
return msg.channel.send(
client.messages.premiumState +
client.global.db.guilds[msg.guild.id].premium
);
if (client.global.db.guilds[args[2]].premium === false) {
client.global.db.guilds[args[2]].premium = true;
let message;
message = client.messages.nowPremium.replace(
"%GUILD%",
client.guilds.cache.get(args[2]).name
);
msg.channel.send(message);
} else if (client.global.db.guilds[args[2]].premium === true) {
client.global.db.guilds[args[2]].premium = false;
let message;
message = client.messages.noMorePremium.replace(
"%GUILD%",
client.guilds.cache.get(args[2]).name
);
msg.channel.send(message);
}
},
};

View File

@ -1,18 +0,0 @@
module.exports = {
name: 'reset',
async execute(msg, args, client) {
client.global.db.guilds[msg.guild.id] = {
prefix: client.config.prefix,
defaultVolume: client.config.defaultVolume,
permissions: client.config.permissions,
dj: client.config.dj,
djrole: client.config.djrole,
startPlaying: client.config.startPlaying,
bass: client.config.bass,
blacklist: [],
premium: false,
autoPlay: client.config.autoPlay,
};
msg.channel.send(client.messages.reset);
}
};

View File

@ -1,30 +0,0 @@
module.exports = {
name: 'setdj',
async execute(msg, args, client) {
if (!client.global.db.guilds[msg.guild.id].dj) {
if (!client.global.db.guilds[msg.guild.id].permissions) {
client.global.db.guilds[msg.guild.id].permissions = true;
}
if (msg.guild.roles.cache.find(x => x.name === "DJ")) {
client.global.db.guilds[msg.guild.id].djrole = msg.guild.roles.cache.find(x => x.name === "DJ").id;
msg.channel.send(client.messages.djRoleFound);
client.global.db.guilds[msg.guild.id].dj = true;
} else {
const permissions = msg.channel.permissionsFor(msg.client.user);
if (!permissions.has('MANAGE_ROLES')) return msg.channel.send(client.messages.noPermsManageRoles);
msg.guild.createRole({
name: 'DJ',
})
.then(role => client.global.db.guilds[msg.guild.id].djrole = role.id)
.catch((error) => {
console.log(error);
})
client.global.db.guilds[msg.guild.id].dj = true;
msg.channel.send(client.messages.djRoleCreated);
}
} else {
client.global.db.guilds[msg.guild.id].dj = false;
msg.channel.send(client.messages.djFalse);
}
}
};

View File

@ -1,10 +0,0 @@
module.exports = {
name: 'volume',
async execute(msg, args, client) {
if (!args[2]) return msg.channel.send(`${client.messages.currentDefaultVolume} \`${client.global.db.guilds[msg.guild.id].defaultVolume}\``);
if (isNaN(args[2])) return msg.channel.send(client.messages.defaultVolumeNumber);
if (args[2].length > 2) return msg.channel.send(client.messages.defaultVolumeMax);
client.global.db.guilds[msg.guild.id].defaultVolume = args[2];
msg.channel.send(`${client.messages.defaultVolumeSet} \`${args[2]}\``);
}
};

View File

@ -1,15 +0,0 @@
module.exports = {
name: 'shuffle',
alias: ["none"],
usage: '',
description: 'Shuffle the queue.',
permission: 'MANAGE_MESSAGES',
category: 'music control',
execute(msg, args, client, command) {
const queue = client.queue.get(msg.guild.id);
if (client.funcs.check(client, msg, command)) {
client.funcs.shuffle(queue.songs);
msg.channel.send(client.messages.shuffled);
}
}
};

View File

@ -1,63 +0,0 @@
module.exports = {
name: "skip",
alias: ["s", "next"],
usage: "",
description: "Skip the currently playing song.",
permission: "MANAGE_MESSAGES",
category: "music control",
execute(msg, args, client, command) {
const queue = client.queue.get(msg.guild.id);
const permissions = msg.channel.permissionsFor(msg.author);
if (!queue || !queue.playing)
return msg.channel.send(client.messages.noServerQueue);
if (msg.author.id !== client.config.devId) {
if (msg.member.voice.channel !== queue.voiceChannel)
return msg.channel.send(client.messages.wrongVoiceChannel);
if (client.global.db.guilds[msg.guild.id].permissions) {
if (
!msg.member.roles.cache.has(
client.global.db.guilds[msg.guild.id].djrole
) ||
!permissions.has(command.permission)
) {
return vote(queue, msg, client);
} else {
return skipSong(queue, msg, client);
}
} else {
return skipSong(queue, msg, client);
}
} else {
return skipSong(queue, msg, client);
}
},
};
function skipSong(queue, msg, client) {
msg.channel.send(client.messages.skipped);
queue.endReason = "skip";
queue.time = 0;
queue.connection.dispatcher.end();
}
function vote(queue, msg, client) {
queue.votesNeeded = Math.floor(queue.voiceChannel.members.size / 2);
queue.votesNeeded.toFixed();
if (queue.voiceChannel.members.size > 2) {
if (queue.voters.includes(msg.member.id))
return msg.channel.send(client.messages.alreadyVoted);
queue.votes++;
queue.voters.push(msg.member.id);
if (queue.votes >= queue.votesNeeded) {
queue.voters = [];
queue.votes = 0;
queue.votesNeeded = null;
return skipSong(queue, msg, client);
} else
return msg.channel.send(
`${client.messages.notEnoughVotes} ${queue.votes} / ${queue.votesNeeded}!`
);
} else {
return skipSong(queue, msg, client);
}
}

View File

@ -1,30 +0,0 @@
module.exports = {
name: "skipto",
alias: ["st"],
usage: "<point in queue>",
description: "Skip to a point in the queue",
permission: "MANAGE_MESSAGES",
category: "music control",
async execute(msg, args, client, command) {
const queue = client.queue.get(msg.guild.id);
if (client.funcs.check(client, msg, command)) {
if (!args[1])
return msg.channel.send(
`${client.messages.correctUsage}\`${command.usage}\``
);
let point = parseInt(args[1]);
point = point - 1;
if (isNaN(point)) return msg.channel.send(client.messages.validNumber);
if (point > queue.songs.length - 1)
return msg.channel.send(client.messages.noSongs);
if (point < 0) return msg.channel.send(client.messages.cantSkipToCurrent);
for (let i = 0; i < point; i++) {
queue.prevSongs.push(queue.songs.shift());
}
msg.channel.send(client.messages.skipped);
queue.endReason = "skipto";
queue.time = 0;
queue.connection.dispatcher.end();
}
},
};

View File

@ -1,29 +0,0 @@
const { EmbedBuilder } = require("discord.js");
module.exports = {
name: 'status',
alias: ["stats", "info"],
usage: '',
description: 'See the current status for Musix.',
permission: 'none',
category: 'info',
execute(msg, args, client, command) {
const uptime = client.funcs.msToTime(client.uptime, "dd:hh:mm:ss");
msg.channel.send(client.messages.pinging).then(m => {
const latency = m.createdTimestamp - msg.createdTimestamp;
const embed = new EmbedBuilder()
.setTitle(client.messages.statusTitle)
.addFields(
{ name: client.messages.statusField1, value: client.ws.ping, inline: true },
{ name: client.messages.statusField2, value: latency, inline: true },
{ name: client.messages.statusField3, value: uptime, inline: true },
{ name: client.messages.statusField4, value: client.shard.ids },
)
.setAuthor({ name: client.user.username, iconURL: client.user.avatarURL() })
.setColor(client.config.embedColor)
m.delete();
return msg.channel.send(embed);
});
}
};

View File

@ -1,30 +0,0 @@
module.exports = {
name: 'stop',
description: 'Stop the music and clear the queue.',
alias: ["none"],
usage: '',
permission: 'MANAGE_CHANNELS',
category: 'music control',
execute(msg, args, client, command) {
const queue = client.queue.get(msg.guild.id);
if (client.funcs.check(client, msg, command)) {
if (msg.content.includes("-force")) {
if (queue) {
queue.voiceChannel.leave();
queue.exists = false;
}
if (msg.guild.voice.channel) msg.guild.voice.channel.leave();
client.queue.delete(msg.guild.id);
return msg.channel.send(client.messages.stop);
}
if (!queue || !queue.playing) {
return msg.channel.send(client.messages.noServerQueue);
}
queue.songs = [];
queue.looping = false;
queue.endReason = "stop";
queue.connection.dispatcher.end();
msg.channel.send(client.messages.stop);
}
}
};

View File

@ -1,22 +0,0 @@
module.exports = {
name: 'volume',
description: 'Volume command.',
alias: ["none"],
usage: '<volume>',
cooldown: 5,
permission: 'MANAGE_MESSAGES',
category: 'music control',
execute(msg, args, client, command) {
const queue = client.queue.get(msg.guild.id);
if (!args[1] && queue) return msg.channel.send(`${client.messages.currentVolume}**${queue.volume}**`);
const volume = parseFloat(args[1]);
if (client.funcs.check(client, msg, command)) {
if (isNaN(volume)) return msg.channel.send(client.messages.validNumber);
if (volume > 100) return msg.channel.send(client.messages.maxVolume);
if (volume < 0) return msg.channel.send(client.messages.positiveVolume);
queue.volume = volume;
queue.connection.dispatcher.setVolume(volume / 100);
return msg.channel.send(`${client.messages.setVolume}**${volume}**`);
}
}
};

View File

@ -1,99 +0,0 @@
require("dotenv/config");
module.exports = {
discord_api_token: process.env.DISCORD_API_TOKEN,
bodKey: process.env.BODKEY,
youtube_api_key: process.env.YOUTUBE_API_KEY,
genius_api_key: process.env.GENIUS_API_KEY,
soundcloud_api_key: process.env.SOUNDCLOUD_API_KEY,
spotify_access_key: process.env.SPOTIFY_ACCESS_KEY,
spotify_client_secret: process.env.SPOTIFY_CLIENT_SECRET,
spotify_client_id: process.env.SPOTIFY_CLIENT_ID,
spotify_refresh_token: process.env.SPOTIFY_REFRESH_TOKEN,
lastfm_api_key: process.env.LASTFM_API_KEY,
lastfm_secret: process.env.LASTFM_SECRET,
port: 8888,
redirectUri: "http://localhost:8888/callback/",
testServer: "489111553321336832",
primary_test_channel: "617633098296721409",
secondary_test_channel: "570531724002328577",
devId: "360363051792203779",
embedColor: "#b50002",
invite: "https://musix-web.herokuapp.com/releases",
supportServer: "https://musix-web.herokuapp.com/discord",
devMode: false,
api: false,
saveDB: true,
respawn: true,
shards: 10,
shardDelay: 10000,
spawnTimeout: 60000,
respawnDelay: 1000,
prefix: ">",
devPrefix: "-",
defaultVolume: 50,
permissions: false,
dj: false,
djrole: null,
startPlaying: true,
bass: 1,
autoPlay: false,
};
module.exports.streamConfig = {
ytdlOptions: {
filter: "audio",
highWaterMark: 1 << 25,
volume: false,
requestOptions: {
maxRedirects: 4,
},
},
options: {
seek: null,
bitrate: 1024,
volume: 1,
type: "converted",
},
};
module.exports.queueConfig = {
textChannel: null,
voiceChannel: null,
connection: null,
songs: [],
volume: null,
bass: null,
nightCore: false,
playing: false,
paused: false,
looping: false,
songLooping: false,
votes: 0,
voters: [],
votesNeeded: null,
time: 0,
endReason: null,
};
module.exports.emojis = {
garbage: "🗑️ ",
green_check_mark: "<:green_check_mark:674265384777416705> ",
loading: "<a:loading:674284196700618783> ",
loudSound: ":loud_sound: ",
megaPhone: "📣 ",
notes: "<a:aNotes:674602408105476106>",
pause: "<:pause:674685548610322462> ",
previous: "<:reverse:705012312142119012> ",
redx: "<:redx:674263474704220182> ",
repeat: "<:repeat1:674685561377914892> ",
repeatSong: "<:repeatsong:674685573419761716> ",
resume: "<:resume:674685585478254603> ",
shuffle: "<:shuffle:674685595980791871> ",
signal: ":signal_strength: ",
skip: "<:skip:674685614221688832> ",
speaker: ":speaker: ",
stop: "<:stop:674685626108477519> ",
stopWatch: ":stopwatch: ",
volumeHigh: "<:volumehigh:674685637626167307> ",
};

View File

@ -1,197 +0,0 @@
const {
emojis
} = require("./config.js");
module.exports = {
emojis: emojis,
albumAdded: emojis.green_check_mark +
"Album has been added to the queue!",
alreadyPaused: emojis.redx + "The music is already paused!",
alreadyVoted: emojis.redx + "You have already voted to skip!",
announceSongs: emojis.megaPhone + "Current setting:",
announceSongsFalse: emojis.green_check_mark + "announcesongs now set to `false`!",
announceSongsTrue: emojis.green_check_mark + "announcesongs now set to `true`!",
autoPlay: "Current setting:",
autoPlayFalse: emojis.green_check_mark + "autoplay now set to `false`!",
autoPlayTrue: emojis.green_check_mark + "autoplay now set to `true`!",
bassApplied: emojis.volumeHigh + "The bass level **%BASS%** has been applied!",
bassFalse: emojis.green_check_mark + "Bass is now false!",
bassLevel: emojis.green_check_mark + "Bass level is now",
blacklistTitle: "Currently blacklisted channels:",
blackListedVC: emojis.redx +
"Your voiceChannel is blacklisted! Please choose another channel!",
boolean: emojis.redx + "Please define a boolean! (true/false)",
cancellingVideoSelection: emojis.redx + "Cancelling video selection",
cantSkipToCurrent: emojis.redx + "You can't skip to the song currently playing!",
channelAdded: emojis.green_check_mark + "Channel %CHANNEL% added to the blacklist!",
channelAlreadyBlackListed: emojis.redx + "That channel is already blacklisted!",
channelFull: emojis.redx + "Your voice channel is full!",
channelNotBlackListed: emojis.redx + "That channel is not blacklisted or does not exist!",
channelRemoved: emojis.green_check_mark +
"Channel %CHANNEL% has been removed from the blacklist!",
cmdUsesFooter: "These statistics are from the current uptime.",
cmdUsesTitle: "Musix Command Usage During Current Uptime",
correctUsage: emojis.redx + "correct usage: ",
currentBass: emojis.loudSound + "The current bass is: ",
currentDefaultBass: emojis.speaker + "Currect default bass level: ",
currentDefaultVolume: emojis.speaker + "Current default volume is:",
currentNightCore: emojis.speaker + "Currect Nightcore setting: ",
currentPrefix: "Current prefix:",
currentVolume: emojis.loudSound + "The current volume is: ",
dbSaved: emojis.green_check_mark + "DB Saved!",
defaultVolumeMax: emojis.redx +
"The default volume must be below `100` for quality and safety resons.",
defaultVolumeNumber: emojis.redx +
"I'm sorry, But the default volume needs to be a valid __number__.",
defaultVolumeSet: emojis.green_check_mark + "Default volume set to:",
devMode: emojis.redx +
"Dev mode has been turned on! Commands are only available to developer(s)!",
disabledSpotifySongs: emojis.redx + "Spotify songs cannot be played currently!",
disableNightCore: emojis.redx + "Please disable nightCore in order to use this command!",
dispatcherError: "Error with the dispatcher: ",
djFalse: emojis.green_check_mark + "`DJ` now set to `false`",
djRoleCreated: emojis.green_check_mark +
"I did not find a role `DJ` so i have created one for you!",
djRoleFound: emojis.green_check_mark +
"I found a `DJ` role from this guild! This role is now the DJ role.",
error: emojis.redx + "An error occured!.\nError: ",
errorConnecting: "Error with connecting to voice channel: ",
errorDetected: "Error detected: ",
errorDispatcher: emojis.redx +
"An error has occured while playing music! The queue has been deleted.\nError: ",
errorExe: emojis.redx + "there was an error trying to execute that command!",
errorExeOpt: emojis.redx + "there was an error trying to execute that option!",
evalTitle: "Evaluation Command",
failedToLoad: emojis.redx + "Songs failed to load: ",
helpCmdFooter: "Command Alias:",
helpFooter: '"%PREFIX%help <command>" to see more information about a command.',
helpTitle: "help",
idOrMentionChannel: emojis.redx + "Please provide a channel id or mention a channel!",
invalidGuild: emojis.redx + "Invalid guild id!",
invalidSpotifyUrl: emojis.redx + "That url cannot be played! If you believe this is a mistake please contact support!",
inviteTitle: "Invite a release of Musix to your discord server!",
joined: emojis.green_check_mark + "Joined",
joinSupport: "Join the musix support server: ",
keySet: emojis.green_check_mark + "Key set!",
leftAlone: "I have left the channel as i was left alone.",
loadingSongs: emojis.loading + "Loading song(s)",
looping: emojis.repeat + "Looping the queue now!",
loopingSong: emojis.repeatSong + "Looping **%TITLE%** now!",
lyricsTitle: "Lyrics",
lyricsUsage: emojis.redx + "Provide a song to search for!",
maxBass: emojis.redx + "The max bass is `10`!",
maxVolume: emojis.redx + "The max volume is `100`!",
mentionChannel: emojis.redx + "Please mention a channel!",
musicCommandsDisabled: emojis.redx +
"This channels has been blacklisted! Music commands cannot be used here!",
nightCoreApplied: emojis.green_check_mark +
"NightCore is now **%BOOLEAN%** this will be applied when the next song starts playing!",
noDj: emojis.redx + "You need the `DJ` role to use this command!",
noLooping: emojis.repeat + "No longer looping the queue!",
noLoopingSong: emojis.repeatSong + "No longer looping the song!",
noMorePremium: ":cry: Guild %GUILD% is no longer premium!",
noPerms: emojis.redx + `You need the %PERMS% permission to use this command!`,
noPermsConnect: emojis.redx +
"I cannot connect to your voice channel, make sure I have the proper permissions!",
noPermsEmbed: emojis.redx +
"I cannot send embeds (Embed links), make sure I have the proper permissions!",
noPermsManageRoles: emojis.redx +
"I cannot create roles (Manage roles), make sure I have the proper permissions! I will need this permission to create a `DJ` role since i did not find one!",
noPermsManageSettings: emojis.redx +
"You need the `MANAGE_SERVER` permission to change the settings!",
noPermsSpeak: emojis.redx +
"I cannot speak in your voice channel, make sure I have the proper permissions!",
noPermsUseExternalEmojis: emojis.redx +
"I cannot use external emojis, make sure I have the proper permissions!",
noPreviousSongs: emojis.redx + "No previous songs!",
noQuery: emojis.redx + "you need to use a link or search for a song!",
noResults: emojis.redx + "I could not obtain any search results!",
noResultsLyrics: emojis.redx + "I could not obtain any results!",
noResultsSpotify: emojis.redx +
"I could not obtain any results!",
noServerQueue: emojis.redx + "There is nothing playing!",
noSimilarResults: emojis.redx + "No similar songs found!",
noSongs: emojis.redx + "That song does not exist!",
noSongsInQueue: emojis.redx + "There are no songs in the queue!",
notPremium: emojis.redx + "This is not a premium guild!",
nowPlayingDesc: emojis.notes + "**Now playing:**",
notAllowed: emojis.redx + "You are not allowed to do that!",
notEnoughVotes: emojis.redx + "Not enough votes!",
notPaused: emojis.redx + "The music in not paused!",
noVoiceChannel: emojis.redx +
"I'm sorry but you need to be in a voice channel to play music!",
nowPlaying: "__Now playing__",
nowPremium: ":tada: Guild %GUILD% is now premium!",
paused: emojis.pause + "Paused the music!",
permission: "🔒 Permission requirement:",
permissionsFalse: emojis.redx + "That value is already `false`!",
permissionsSetFalse: emojis.green_check_mark + "Permissions requirement now set to: `false`",
permissionsSetTrue: emojis.green_check_mark + "Permissions requirement now set to: `true`",
permissionsTrue: emojis.redx + "That value is already `true`!",
pinging: emojis.loading + "Pinging...",
playlistAdded: emojis.green_check_mark +
"Playlist: **%TITLE%** has been added to the queue!",
positiveBass: emojis.redx + "The bass needs to be a positive number!",
positiveVolume: emojis.redx + "The volume needs to be a positive number!",
prefixHere: "My prefix here is: ",
prefixMaxLength: "The prefix must be shorter or equal to 5 letters!",
prefixSet: emojis.green_check_mark + "New prefix set to:",
premiumState: "Premium status: ",
previousSong: emojis.previous + "Previous",
provideANumber: "Please provide a number ranging from 1-10 to select one of the search results.",
provideASong: emojis.redx + "Please provide a song position in queue for me to remove!",
queueDeleted: "Queue deleted!",
queueDesc: "**Now playing:** %SONG%<a:aNotes:674602408105476106>\n:arrow_down: Next in queue :arrow_down:",
queueFooter: "songs in the queue!",
queueLength: emojis.redx + "There are only %SONGS% song(s) in the queue!",
queueTitle: "__Song queue__",
quotaReached: emojis.redx +
"Quota reached please try again after midnight Pacific Time (PT)!",
reloaded: "All files reloaded!",
removed: emojis.garbage + "removed `%SONG%` from the queue!",
reset: emojis.green_check_mark + "Reset __all__ guild settings!",
restart: "restarting all shards...",
resumed: emojis.resume + "Resumed the music!",
searchSimilarUsage: emojis.redx + "Correct usage: %USAGE%",
seekingPointPositive: emojis.redx + "The seeking point needs to be a positive number!",
seekMax: emojis.redx +
"The lenght of this song is %LENGTH% seconds! You can't seek further than that!",
settingsAnnounceSongs: "announcesongs",
settingsAnnounceSongsDesc: "Whether to announce songs that start playing or not.",
settingsAutoPlay: "autoplay",
settingsAutoPlayDesc: "When the queue ends similar songs will be played.",
settingsBass: "bass",
settingsBassDesc: "Change the default bass level.",
settingsBlacklist: "blacklist",
settingsBlacklistDesc: "Blacklist channels that you wan't to block music commands to be executed on or block the bot from joining certain voiceChannels.",
settingsFooter: "how to use: %PREFIX%settings <Setting name> <value>",
settingsPermissions: "permissions",
settingsPermissionsDesc: "Change whether to require permissions to use eg `skip, stop, pause, loop, etc...`",
settingsPrefix: "prefix",
settingsPrefixDesc: "Change the guild specific prefix. (string)",
settingsSetDj: "setdj",
settingsSetDjDesc: "Set a DJ role. This will allow chosen users to freely use all Musix commands. This will automatically set the `permissions` settings to true in order for the `DJ` role to have effect!",
settingsTitle: "Guild settings for Musix",
settingsVolume: "volume",
settingsVolumeDesc: "Change the default volume that the bot will start playing at. (number)",
setVolume: emojis.volumeHigh + "I set the volume to: ",
shuffled: emojis.shuffle + "Queue suffled!",
skipped: emojis.skip + "Skipped the song!",
songAdded: emojis.green_check_mark + "**%TITLE%** has been added to the queue!",
songBlockedWMG: emojis.redx +
"This song had been blocked by WMG (Warner Music Groud).\n<:skip:674685614221688832> Skipped to next song.",
songsAdded: emojis.green_check_mark + "%AMOUNT% songs added to the queue!",
songSelection: "__Song Selection__",
startPlaying: emojis.notes + "Start playing: ",
statusField1: emojis.signal + "Ping",
statusField2: "Latency",
statusField3: emojis.stopWatch + "Uptime",
statusField4: "Shard: ",
statusTitle: "Status for Musix",
stop: emojis.stop + "Stopped the music!",
tookTooLong: emojis.redx + "Something took too long! Please try again!",
validNumber: emojis.redx + "I'm sorry, But you need to enter a valid __number__.",
videoUnavailable: emojis.redx + "That video is unavaiable! Please try again.",
wrongVoiceChannel: emojis.redx +
"I'm sorry but you need to be in the same voice channel as Musix to use this command!",
};

View File

@ -1,29 +0,0 @@
module.exports = {
name: "guildcreate",
async execute(client, guild) {
client.db.collection("guilds").doc(guild.id).set({
prefix: client.config.prefix,
defaultVolume: client.config.defaultVolume,
permissions: client.config.permissions,
dj: client.config.dj,
djrole: client.config.djrole,
startPlaying: client.config.startPlaying,
bass: client.config.bass,
blacklist: [],
premium: false,
autoPlay: client.config.autoPlay,
});
client.global.db.guilds[guild.id] = {
prefix: client.config.prefix,
defaultVolume: client.config.defaultVolume,
permissions: client.config.permissions,
dj: client.config.dj,
djrole: client.config.djrole,
startPlaying: client.config.startPlaying,
bass: client.config.bass,
blacklist: [],
premium: false,
autoPlay: client.config.autoPlay,
};
},
};

View File

@ -1,6 +0,0 @@
module.exports = {
name: "guildcreate",
async execute(client, guild) {
delete client.global.db.guilds[guild.id];
},
};

View File

@ -1,36 +0,0 @@
module.exports = function (client) {
client.on('ready', () => {
require(`./ready.js`).execute(client);
}).on('message', (msg) => {
require(`./msg.js`).execute(client, msg);
}).on('guildCreate', (guild) => {
require(`./guildCreate.js`).execute(client, guild);
})
.on('guildDelete', (guild) => {
require(`./guildDelete.js`).execute(client, guild);
}).on('voiceStateUpdate', (oldState, newState) => {
require(`./voiceStateUpdate.js`).execute(client, oldState, newState);
}).on('error', (error) => {
console.log(error);
}).on('debug', (info) => {
if (client.config.devMode) console.log(info);
}).on('invalidated', () => {
console.log("Client session invalidated! Exiting the process!")
process.exit(1);
}).on('rateLimit', (rateLimitInfo) => {
}).on('shardDisconnect', (event, id) => {
client.logs.push(`Shard ${id} disconnected event ${event}`);
}).on('shardError', (error, shardId) => {
client.logs.push(`Shard ${shardId} error ${error}`);
}).on('shardReady', (id, unavailableGuilds) => {
client.logs.push(`Shard ${id} ready. Unavailable guilds: ${unavailableGuilds || 0}`);
}).on('shardReconnecting', (id) => {
client.logs.push(`shard ${id} reconnecting.`);
}).on('shardResume', (id, replayedEvents) => {
client.logs.push(`shard ${id} resume events ${replayedEvents}`);
}).on("warn", (info) => {
client.logs.push(`Warn! info: ${info}`);
console.log(`Warn! info: ${info}`);
});
}

View File

@ -1,41 +0,0 @@
module.exports = {
name: "message",
async execute(client, msg, Discord) {
if (msg.author.bot || !msg.guild) return;
if (!client.global.db.guilds[msg.guild.id]) client.funcs.checkDB(client);
let prefix = client.global.db.guilds[msg.guild.id].prefix || client.config.prefix;
const args = msg.content.slice(prefix.length).split(" ");
if (client.config.devMode) prefix = client.config.devPrefix;
const permission = msg.channel.permissionsFor(client.user);
if (!permission.has("SEND_MESSAGES")) return;
if (msg.mentions.users.first()) {
if (msg.mentions.users.first().id === client.user.id) {
if (!args[1] || args[0] !== `@!${client.user.id}>`) return;
if (args[1] === "prefix") {
if (!args[2])
return msg.channel.send(
`${client.messages.prefixHere}\`${prefix}\`.`
);
if (args[2] === "=" && args[3]) return (prefix = args[3]);
}
args.shift();
getCommand(client, args, msg, Discord);
}
}
if (!msg.content.startsWith(prefix)) return;
getCommand(client, args, msg, Discord);
},
};
function getCommand(client, args, msg) {
if (!args[0]) return;
const commandName = args[0].toLowerCase();
if (commandName === "none") return;
const command =
client.commands.get(commandName) ||
client.commands.find(
(cmd) => cmd.alias && cmd.alias.includes(commandName)
);
if (!command) return;
client.funcs.exe(msg, args, client, command);
}

View File

@ -1,45 +0,0 @@
module.exports = {
name: "ready",
async execute(client, Discord) {
const remoteMusixGuildsData = await client.funcs.dbget(
"guilds",
null,
client
);
remoteMusixGuildsData.forEach((guildData) => {
client.global.db.guilds[guildData.id] = guildData.d;
});
if (client.config.devMode) {
client.guilds.cache.forEach((guild) => {
client.global.db.guilds[guild.id] = {
prefix: client.config.devPrefix,
defaultVolume: client.config.defaultVolume,
permissions: client.config.permissions,
dj: client.config.dj,
djrole: client.config.djrole,
startPlaying: client.config.startPlaying,
bass: client.config.bass,
blacklist: [],
premium: true,
autoPlay: client.config.autoPlay,
};
});
}
console.log(`- DB Set - Shard: ${client.shard.ids} -`);
client.user.setActivity(`@${client.user.username} help | 🎶`, {
type: "LISTENING",
});
client.user.setStatus("online");
client.funcs.getSpotifyKey(client);
console.log(`- Activated - Shard: ${client.shard.ids} -`);
setInterval(() => {
if (!client.config.devMode) client.funcs.checkDB(client);
}, 60000);
setInterval(async () => {
client.funcs.saveDB(client);
}, 1800000);
setInterval(() => {
client.funcs.getSpotifyKey(client);
}, 3600000);
},
};

View File

@ -1,34 +0,0 @@
module.exports = {
name: 'voiceStateUpdate',
async execute(client, oldState, newState) {
if (oldState.channel === null) return newState.setSelfDeaf(true);
let change = false;
const queue = client.queue.get(newState.guild.id);
if (!queue) return;
if (newState.member.id === client.user.id && oldState.member.id === client.user.id) {
if (newState.member.voice.channel === null) {
queue.songs = [];
queue.looping = false;
queue.endReason = "manual disconnect";
return client.queue.delete(newState.guild.id);
}
if (newState.member.voice.channel !== queue.voiceChannel) {
change = true;
queue.voiceChannel = newState.member.voice.channel;
queue.connection = newState.connection;
}
}
if (oldState.channel.members.size === 1 && oldState.channel === queue.voiceChannel || change) {
setTimeout(() => {
if (!queue || !queue.connection.dispatcher || queue.connection.dispatcher === null) return;
if (queue.voiceChannel.members.size === 1) {
queue.textChannel.send(client.messages.leftAlone);
queue.songs = [];
queue.looping = false;
queue.endReason = "Timeout";
queue.connection.dispatcher.end();
}
}, 120000);
}
}
}

View File

@ -1,21 +0,0 @@
module.exports = function (client, connection) {
connection.on("authenticated", () => {
if (client.config.devMode) console.log("Voice connection initiated.");
}).on("debug", (message) => {
if (client.config.devMode) console.log(message);
}).on("disconnect", () => {
if (client.config.devMode) console.log("Voice connection disconnected.");
}).on("error", (error) => {
console.log(error);
}).on("failed", (error) => {
if (client.config.devMode) console.log(error);
}).on("newSession", () => {
if (client.config.devMode) console.log("New voice session id received!");
}).on("ready", () => {
if (client.config.devMode) console.log("Voice connection ready.");
}).on("reconnecting", () => {
if (client.config.devMode) console.log("Voice connection reconnecting.");
}).on("warn", (warning) => {
console.log(`Voice connection warning: ${warning}`);
})
}

View File

@ -1,14 +0,0 @@
module.exports = {
async execute(client, error, guild) {
const queue = client.queue.get(guild.id);
console.log(error);
/*if (error = "Error: input stream: This video contains content from WMG, who has blocked it on copyright grounds.") {
queue.endReason = "skip";
queue.connection.dispatcher.end();
return queue.textChannel.send(client.messages.songBlockedWMG);
}*/
queue.voiceChannel.leave();
client.queue.delete(guild.id);
return queue.textChannel.send(client.messages.errorDispatcher + `\`${error}\``);
},
};

View File

@ -1,95 +0,0 @@
const similarSongs = require("similar-songs");
const ytdl = require("ytdl-core");
module.exports = {
async execute(client, guild) {
const queue = client.queue.get(guild.id);
queue.playing = false;
if (queue.endReason === "seek") {
return (queue.playing = true);
}
if (!queue.songLooping) {
if (queue.looping) {
queue.songs.push(queue.songs[0]);
}
queue.time = 0;
queue.votes = 0;
queue.voters = [];
if (queue.endReason !== "replay") {
if (queue.endReason === "previous")
queue.songs.unshift(queue.prevSongs.pop());
if (queue.endReason !== "previous")
queue.prevSongs.push(queue.songs.shift());
if (
client.global.db.guilds[guild.id].autoPlay &&
!queue.songs[0] &&
queue.endReason !== "stop"
) {
if (queue.prevSongs.length > 0)
return findSimilar(client, queue, queue.prevSongs, guild);
}
}
}
client.funcs.play(guild, queue.songs[0], client, 0, true);
},
};
function findSimilar(client, queue, prevSongs, guild) {
let retries = 0;
const query =
prevSongs[Math.floor(Math.random() * Math.floor(prevSongs.length))];
if (!query || !query.track) return findSimilar(client, queue, prevSongs, guild);
similarSongs.find({
title: query.track.name,
artist: query.track.artists[0].name,
limit: 10,
lastfmAPIKey: client.config.lastfm_api_key,
lastfmAPISecret: client.config.lastfm_secret,
youtubeAPIKey: client.config.youtube_api_key,
},
async function (err, songs) {
if (err) {
if (
err.message ==
'The request cannot be completed because you have exceeded your <a href="/youtube/v3/getting-started#quota">quota</a>.'
) {
queue.voiceChannel.leave();
queue.exists = false;
client.queue.delete(guild.id);
queue.textChannel.send(client.messages.quotaReached);
return;
}
console.log(err.message);
queue.voiceChannel.leave();
queue.exists = false;
client.queue.delete(guild.id);
return queue.textChannel.send(client.messages.error);
}
if (songs[0]) {
const random = Math.floor(Math.random() * Math.floor(songs.length));
const songInfo = await ytdl.getInfo(
`https://www.youtube.com/watch?v=${songs[random].youtubeId}`
);
queue.songs.push({
title: songInfo.videoDetails.title,
url: `https://www.youtube.com/watch?v=${songs[random].youtubeId}`,
author: client.user,
type: "ytdl",
info: songInfo.videoDetails,
track: query.track,
});
client.funcs.play(guild, queue.songs[0], client, 0, true);
} else {
if (prevSongs.length > 4 && retries < 6) {
findSimilar(client, queue, prevSongs, guild);
retries++;
return;
}
queue.textChannel.send(client.messages.noSimilarResults);
client.funcs.play(guild, queue.songs[0], client, 0, true);
}
}
);
}

View File

@ -1,16 +0,0 @@
module.exports = function (client, dispatcher, queue, guild) {
dispatcher.on("finish", () => {
if (client.config.devMode) console.log("Dispatcher finish.");
require("./finish").execute(client, guild);
})
.on("start", () => {
if (client.config.devMode) console.log("Dispatcher start.");
queue.endReason = null;
dispatcher.player.streamingData.pausedTime = 0;
})
.on("error", (error) => {
require("./error").execute(client, error, guild);
}).on("debug", (info) => {
if (client.config.devMode) console.log(info);
})
}

View File

@ -1,34 +0,0 @@
module.exports = function (client, msg, command) {
const queue = client.queue.get(msg.guild.id);
const permissions = msg.channel.permissionsFor(msg.author);
if (!queue || !queue.playing && command.name !== "stop") {
msg.channel.send(client.messages.noServerQueue);
return false;
}
if (msg.author.id !== client.config.devId) {
if (msg.member.voice.channel !== queue.voiceChannel) {
msg.channel.send(client.messages.wrongVoiceChannel);
return false;
}
if (client.global.db.guilds[msg.guild.id].permissions === true) {
if (client.global.db.guilds[msg.guild.id].dj) {
if (
!msg.member.roles.cache.has(
client.global.db.guilds[msg.guild.id].djrole
)
) {
msg.channel.send(client.messages.noDj);
return false;
} else return true;
} else if (!permissions.has(command.permission)) {
let message;
message = client.messages.noPerms.replace(
"%PERMS%",
command.permissions
);
msg.channel.send(message);
return false;
} else return true;
} else return true;
} else return true;
};

View File

@ -1,52 +0,0 @@
module.exports = async function (client) {
client.guilds.cache.forEach((guild) => {
if (!client.global.db.guilds[guild.id]) {
client.db.collection("guilds").doc(guild.id).set({
prefix: client.config.prefix,
defaultVolume: client.config.defaultVolume,
permissions: client.config.permissions,
dj: client.config.dj,
djrole: client.config.djrole,
startPlaying: client.config.startPlaying,
bass: client.config.bass,
blacklist: [],
premium: false,
autoPlay: client.config.autoPlay,
});
client.global.db.guilds[guild.id] = {
prefix: client.config.prefix,
defaultVolume: client.config.defaultVolume,
permissions: client.config.permissions,
dj: client.config.dj,
djrole: client.config.djrole,
startPlaying: client.config.startPlaying,
bass: client.config.bass,
blacklist: [],
premium: false,
autoPlay: client.config.autoPlay,
};
return;
}
if (!client.global.db.guilds[guild.id].prefix)
client.global.db.guilds[guild.id].prefix = client.config.prefix;
if (!client.global.db.guilds[guild.id].defaultVolume)
client.global.db.guilds[guild.id].defaultVolume =
client.config.defaultVolume;
if (!client.global.db.guilds[guild.id].permissions)
client.global.db.guilds[guild.id].permissions = client.config.permissions;
if (!client.global.db.guilds[guild.id].dj)
client.global.db.guilds[guild.id].dj = client.config.dj;
if (!client.global.db.guilds[guild.id].djrole)
client.global.db.guilds[guild.id].djrole = client.config.djrole;
if (!client.global.db.guilds[guild.id].startPlaying)
client.global.db.guilds[guild.id].startPlaying =
client.config.startPlaying;
if (!client.global.db.guilds[guild.id].bass)
client.global.db.guilds[guild.id].bass = client.config.bass;
if (!client.global.db.guilds[guild.id].blacklist)
client.global.db.guilds[guild.id].blacklist = [];
if (!client.global.db.guilds[guild.id].premium)
client.global.db.guilds[guild.id].premium = false;
if (!client.global.db.guilds[guild.id].autoPlay) client.global.db.guilds[guild.id].autoPlay = client.config.autoPlay
});
};

View File

@ -1,22 +0,0 @@
module.exports = async function (collection, doc, client) {
if (doc) {
let d = await client.db.collection(collection).doc(doc).get().catch(err => {
console.log('Error getting document', err);
return 'error';
});
return d.data();
} else {
let d = await client.db.collection(collection).get().catch(err => {
console.log('Error getting document', err);
return 'error';
});
let finalD = [];
d.forEach(doc => {
finalD.push({
id: doc.id,
d: doc.data(),
});
});
return finalD;
}
};

View File

@ -1,12 +0,0 @@
module.exports = async function (client, msg, pos, command) {
const seek = parseInt(pos);
const queue = client.queue.get(msg.guild.id);
if (command.name === "seek") {
queue.time = seek * 1000;
} else {
queue.time = queue.connection.dispatcher.streamTime + queue.time;
}
queue.connection.dispatcher.end();
queue.endReason = "seek";
client.funcs.play(msg.guild, queue.songs[0], client, seek, false);
};

View File

@ -1,20 +0,0 @@
module.exports = function (msg, args, client, command) {
const permissions = msg.channel.permissionsFor(client.user);
if (!permissions.has("EMBED_LINKS"))
return msg.channel.send(client.messages.noPermsEmbed);
if (!permissions.has("USE_EXTERNAL_EMOJIS"))
return msg.channel.send(client.messages.noPermsUseExternalEmojis);
if (
command.category === "music" &&
client.global.db.guilds[msg.guild.id].blacklist.includes(msg.channel.id)
)
return msg.channel.send(client.messages.musicCommandsDisabled);
try {
command.uses++;
command.execute(msg, args, client, command);
} catch (error) {
msg.reply(client.messages.errorExe);
console.log(error.toString());
console.log(error.stack.replace(/at /g, "**at **"));
}
};

View File

@ -1,28 +0,0 @@
module.exports = async function (client) {
const request = require("request");
const refresh_token = client.config.spotify_refresh_token;
const authOptions = {
url: "https://accounts.spotify.com/api/token",
headers: {
Authorization: "Basic " +
new Buffer(client.config.spotify_client_id + ":" + client.config.spotify_client_secret).toString("base64"),
},
form: {
grant_type: "refresh_token",
refresh_token: refresh_token,
},
json: true,
};
request.post(authOptions, function (error, response, body) {
if (!error && response.statusCode === 200) {
client.spotify.setAccessToken(body.access_token);
client.config.spotify_access_key = body.access_token
if (client.config.devMode) console.log("- Spotify access token set -");
} else {
console.log("An error occured whilst getting spotify access key");
}
});
};

View File

@ -1,69 +0,0 @@
const ytdl = require("ytdl-core");
module.exports = async function (
resource,
msg,
voiceChannel,
client,
playlist,
type,
spotifyTrackData
) {
const songInfo = await ytdl.getInfo(resource).catch(err => console.log(err));
const song = {
title: songInfo.videoDetails.title,
url: resource,
author: msg.author,
type: type,
info: songInfo.videoDetails,
track: spotifyTrackData
};
const queue = client.queue.get(msg.guild.id);
if (queue) {
queue.songs.push(song);
queue.textChannel = msg.channel;
if (playlist) return;
let message;
message = client.messages.songAdded.replace("%TITLE%", song.title);
return msg.channel.send(message);
}
const construct = {
textChannel: msg.channel,
voiceChannel: voiceChannel,
connection: null,
songs: [],
prevSongs: [],
volume: client.global.db.guilds[msg.guild.id].defaultVolume,
bass: client.global.db.guilds[msg.guild.id].bass,
nightCore: false,
playing: false,
paused: false,
looping: false,
songLooping: false,
votes: 0,
voters: [],
votesNeeded: null,
time: 0,
endReason: null,
exists: true
};
construct.songs.push(song);
client.queue.set(msg.guild.id, construct);
try {
const connection = await voiceChannel.join();
construct.connection = connection;
require("../../events/connectionEvents/handler")(client, connection);
client.funcs.play(msg.guild, construct.songs[0], client, 0, true);
} catch (error) {
client.queue.delete(msg.guild.id);
console.log(error);
return msg.channel.send(client.messages.error + error);
}
return;
};

View File

@ -1,17 +0,0 @@
module.exports = function msToTime(duration, format) {
var seconds = Math.floor((duration / 1000) % 60),
minutes = Math.floor((duration / (1000 * 60)) % 60),
hours = Math.floor((duration / (1000 * 60 * 60)) % 24),
days = Math.floor((duration / (1000 * 60 * 60 * 24)) % 24);
days = (days < 10) ? "0" + days : days;
hours = (hours < 10) ? "0" + hours : hours;
minutes = (minutes < 10) ? "0" + minutes : minutes;
seconds = (seconds < 10) ? "0" + seconds : seconds;
if (format === "hh:mm:ss") {
return `${hours}:${minutes}:${seconds}`;
} else if (format === "dd:hh:mm:ss") {
return `${days}:${hours}:${minutes}:${seconds}`;
}
}

View File

@ -1,94 +0,0 @@
const {
Readable: ReadableStream
} = require("stream");
const ytdl = require("ytdl-core");
const {
streamConfig
} = require("../config/config.js");
const prism = require("prism-media");
const { EmbedBuilder } = require("discord.js");
module.exports = async function (guild, song, client, seek, play) {
const queue = client.queue.get(guild.id);
if (!song) {
queue.voiceChannel.leave();
queue.exists = false;
client.queue.delete(guild.id);
return;
}
setTimeout(() => {
if (!queue.playing && queue.exists) {
queue.textChannel.send(client.messages.tookTooLong);
queue.voiceChannel.leave();
client.queue.delete(guild.id);
return;
}
}, 30000);
streamConfig.options.seek = seek;
let input = song.url;
if (song.type === "ytdl" || song.type === "spotify")
input = ytdl(song.url, streamConfig.ytdlOptions)
//.on('info', (info, format) => console.log(format))
.on("error", (error) => {
console.log(error)
queue.voiceChannel.leave();
client.queue.delete(guild.id);
queue.textChannel.send(client.messages.videoUnavailable)
});
const ffmpegArgs = [
"-analyzeduration",
"0",
"-loglevel",
"0",
"-f",
"s16le",
"-ar",
"48000",
"-ac",
"2",
"-af",
`bass=g=${queue.bass}`,
];
client.funcs.sleep(500);
if (queue.nightCore) {
ffmpegArgs.push("-af");
ffmpegArgs.push("asetrate=52920");
}
const isStream = input instanceof ReadableStream;
const args = isStream ? ffmpegArgs.slice() : ["-i", input, ...ffmpegArgs];
args.unshift("-ss", String(seek));
const transcoder = new prism.FFmpeg({
args: args,
});
const stream = input.pipe(transcoder).on("error", (error) => {
console.log(error);
});
const dispatcher = queue.connection.play(stream, streamConfig.options)
dispatcher.setVolume(queue.volume / 100);
require("../events/dispatcherEvents/handler")(client, dispatcher, queue, guild);
if ((client.global.db.guilds[guild.id].startPlaying && play) || play) {
if (song.type !== "ytdl" && song.type !== "spotify") return;
const embed = new EmbedBuilder()
.setTitle(`${client.messages.startPlaying}**${song.title}**`)
.setDescription(
`Song duration: \`${client.funcs.msToTime(
queue.songs[0].info.lengthSeconds * 1000,
"hh:mm:ss"
)}\``
)
.setColor(client.config.embedColor);
queue.textChannel.send(embed);
}
queue.playing = true;
};

View File

@ -1,19 +0,0 @@
module.exports = async function (client) {
if (client.config.saveDB && !client.config.devMode) {
//console.log('DB saved');
client.guilds.cache.forEach((guild) => {
client.db.collection("guilds").doc(guild.id).set({
prefix: client.global.db.guilds[guild.id].prefix,
defaultVolume: client.global.db.guilds[guild.id].defaultVolume,
permissions: client.global.db.guilds[guild.id].permissions,
dj: client.global.db.guilds[guild.id].dj,
djrole: client.global.db.guilds[guild.id].djrole,
startPlaying: client.global.db.guilds[guild.id].startPlaying,
bass: client.global.db.guilds[guild.id].bass,
blacklist: client.global.db.guilds[guild.id].blacklist,
premium: client.global.db.guilds[guild.id].premium,
autoPlay: client.global.db.guilds[guild.id].autoPlay
});
});
}
};

View File

@ -1,11 +0,0 @@
module.exports = function (a) {
for (let i = a.length - 1; i > 1; i--) {
const j = Math.floor(Math.random() * (i + 1));
if (i === 0 || j === 0) {
// J or I is 0. It works like this so hands off!
} else {
[a[i], a[j]] = [a[j], a[i]];
}
}
return a;
};

View File

@ -1,3 +0,0 @@
module.exports = function (milliseconds) {
return new Promise((resolve) => setTimeout(resolve, milliseconds));
};

View File

@ -1,17 +0,0 @@
module.exports = async function (client, msg, youtube, voiceChannel, url) {
if (url.match(/^https?:\/\/(www.youtube.com|youtube.com)\/playlist(.*)$/)) {
const lmsg = await msg.channel.send(client.messages.loadingSongs);
const playlist = await youtube.getPlaylist(url);
const videos = await playlist.getVideos();
for (const video of Object.values(videos)) {
const video2 = await youtube.getVideoByID(video.id);
await client.funcs.handleVideo(video2.url, msg, voiceChannel, client, true);
}
let message;
message = client.messages.playlistAdded.replace("%TITLE%", playlist.title);
lmsg.edit(message);
return true;
} else {
return false;
}
};