1
0
mirror of https://github.com/musix-org/musix-oss synced 2025-09-05 15:53:22 +00:00

257 Commits

Author SHA1 Message Date
Christer Warén
09c6d5b117 Update 2024-03-06 02:32:44 +02:00
Christer Warén
75a080a399 Merge pull request #33 from musix-org/dependabot/npm_and_yarn/v2/firebase-10.8.1
Bump firebase from 10.8.0 to 10.8.1
2024-02-29 04:13:35 +02:00
dependabot[bot]
79b7e9d3cd Bump firebase from 10.8.0 to 10.8.1
Bumps [firebase](https://github.com/firebase/firebase-js-sdk) from 10.8.0 to 10.8.1.
- [Release notes](https://github.com/firebase/firebase-js-sdk/releases)
- [Changelog](https://github.com/firebase/firebase-js-sdk/blob/master/CHANGELOG.md)
- [Commits](https://github.com/firebase/firebase-js-sdk/compare/firebase@10.8.0...firebase@10.8.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-28 23:11:18 +00:00
Christer Warén
0ba6e28efd Merge pull request #31 from musix-org/dependabot/npm_and_yarn/v2/nodemon-3.1.0
Bump nodemon from 3.0.3 to 3.1.0
2024-02-24 19:01:29 +02:00
dependabot[bot]
1616a1783a 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:16:31 +00:00
Christer Warén
67301e72ff Merge pull request #28 from musix-org/dependabot/npm_and_yarn/v2/dotenv-16.4.5
Bump dotenv from 16.4.4 to 16.4.5
2024-02-21 20:52:25 +02:00
dependabot[bot]
8be4ff7357 Bump dotenv from 16.4.4 to 16.4.5
Bumps [dotenv](https://github.com/motdotla/dotenv) from 16.4.4 to 16.4.5.
- [Changelog](https://github.com/motdotla/dotenv/blob/master/CHANGELOG.md)
- [Commits](https://github.com/motdotla/dotenv/compare/v16.4.4...v16.4.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-20 23:54:21 +00:00
Christer Warén
7f372b5a5b Merge pull request #26 from musix-org/dependabot/npm_and_yarn/v2/dotenv-16.4.4
Bump dotenv from 16.4.1 to 16.4.4
2024-02-14 15:20:25 +02:00
dependabot[bot]
8068fb5027 Bump dotenv from 16.4.1 to 16.4.4
Bumps [dotenv](https://github.com/motdotla/dotenv) from 16.4.1 to 16.4.4.
- [Changelog](https://github.com/motdotla/dotenv/blob/master/CHANGELOG.md)
- [Commits](https://github.com/motdotla/dotenv/compare/v16.4.1...v16.4.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-13 23:30:15 +00:00
Christer Warén
9049a5e6b8 Fix code to work on this decade 1/x 2024-02-09 11:53:30 +02:00
Christer Warén
d609687957 Merge branch 'master' into v2 2024-02-09 07:58:16 +02:00
Christer Warén
da226c0377 Merge pull request #22 from musix-org/dependabot/npm_and_yarn/v2/ms-2.1.3
Bump ms from 2.1.2 to 2.1.3
2024-02-09 07:28:38 +02:00
Christer Warén
f6f7998602 Merge pull request #21 from musix-org/dependabot/npm_and_yarn/v2/firebase-admin-12.0.0
Bump firebase-admin from 8.11.0 to 12.0.0
2024-02-09 07:28:30 +02:00
Christer Warén
81e043808d Merge pull request #20 from musix-org/dependabot/npm_and_yarn/v2/ytdl-core-4.11.5
Bump ytdl-core from 0.29.7 to 4.11.5
2024-02-09 07:28:21 +02:00
dependabot[bot]
a7f95ddfa4 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-09 00:04:08 +00:00
dependabot[bot]
7797656765 Bump firebase-admin from 8.11.0 to 12.0.0
Bumps [firebase-admin](https://github.com/firebase/firebase-admin-node) from 8.11.0 to 12.0.0.
- [Release notes](https://github.com/firebase/firebase-admin-node/releases)
- [Commits](https://github.com/firebase/firebase-admin-node/compare/v8.11.0...v12.0.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-09 00:03:56 +00:00
dependabot[bot]
0907e52d9f 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-09 00:03:40 +00:00
Christer Warén
39f27c4f1a Merge branch 'master' into v2 2024-02-09 00:09:31 +02:00
Christer Warén
f9a1347cc5 Merge branch 'master' into v2 2024-02-09 00:06:40 +02:00
Christer Warén
9af70c1612 Merge pull request #11 from musix-org/dependabot/npm_and_yarn/v2/discord.js-14.14.1
Bump discord.js from 11.6.4 to 14.14.1
2024-02-09 00:02:31 +02:00
dependabot[bot]
ef34822636 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:03 +00:00
Christer Warén
5afa15fbba Merge pull request #7 from musix-org/dependabot/npm_and_yarn/v2/dblapi.js-2.4.1
Bump dblapi.js from 2.4.0 to 2.4.1
2024-02-09 00:01:18 +02:00
Christer Warén
e92eb0b7df Merge pull request #9 from musix-org/dependabot/npm_and_yarn/v2/firebase-10.8.0
Bump firebase from 6.6.2 to 10.8.0
2024-02-09 00:01:03 +02:00
dependabot[bot]
ce9d7fab14 Bump firebase from 6.6.2 to 10.8.0
Bumps [firebase](https://github.com/firebase/firebase-js-sdk) from 6.6.2 to 10.8.0.
- [Release notes](https://github.com/firebase/firebase-js-sdk/releases)
- [Changelog](https://github.com/firebase/firebase-js-sdk/blob/master/CHANGELOG.md)
- [Commits](https://github.com/firebase/firebase-js-sdk/compare/firebase@6.6.2...firebase@10.8.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-08 21:58:36 +00:00
dependabot[bot]
cb5b830f48 Bump dblapi.js from 2.4.0 to 2.4.1
Bumps [dblapi.js](https://github.com/top-gg/dblapi.js) from 2.4.0 to 2.4.1.
- [Release notes](https://github.com/top-gg/dblapi.js/releases)
- [Commits](https://github.com/top-gg/dblapi.js/compare/v2.4.0...v2.4.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-08 21:58:30 +00:00
Christer Warén
7d6873344c Merge pull request #14 from musix-org/dependabot/npm_and_yarn/v2/ffmpeg-static-5.2.0
Bump ffmpeg-static from 4.2.0 to 5.2.0
2024-02-08 23:57:25 +02:00
dependabot[bot]
9970e70a4f Bump ffmpeg-static from 4.2.0 to 5.2.0
Bumps [ffmpeg-static](https://github.com/eugeneware/ffmpeg-static) from 4.2.0 to 5.2.0.
- [Release notes](https://github.com/eugeneware/ffmpeg-static/releases)
- [Commits](https://github.com/eugeneware/ffmpeg-static/compare/v4.2.0...5.2.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-08 21:56:27 +00:00
Christer Warén
7aaa15f30b Merge pull request #5 from musix-org/dependabot/npm_and_yarn/v2/dotenv-16.4.1
Bump dotenv from 8.2.0 to 16.4.1
2024-02-08 23:52:58 +02:00
dependabot[bot]
65ccc7349d Bump dotenv from 8.2.0 to 16.4.1
Bumps [dotenv](https://github.com/motdotla/dotenv) from 8.2.0 to 16.4.1.
- [Changelog](https://github.com/motdotla/dotenv/blob/master/CHANGELOG.md)
- [Commits](https://github.com/motdotla/dotenv/compare/v8.2.0...v16.4.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-08 21:52:20 +00:00
Christer Warén
978398b04e Merge branch 'master' into v2 2024-02-08 23:28:23 +02:00
Christer Warén
59d6fbb911 Update README.md 2024-02-08 17:39:40 +02:00
Christer Warén
2c935d4926 Merge remote-tracking branch 'musix-v2/master' into v2 2024-02-08 17:33:47 +02:00
Matte
c9dc8bc587 Merge pull request #17 from Musix-Development/dependabot/npm_and_yarn/websocket-extensions-0.1.4
Bump websocket-extensions from 0.1.3 to 0.1.4
2021-07-01 02:34:27 +03:00
Matte
e92c058979 Merge pull request #18 from Musix-Development/dependabot/npm_and_yarn/y18n-3.2.2
Bump y18n from 3.2.1 to 3.2.2
2021-07-01 02:34:19 +03:00
Matte
985f34493f Merge pull request #19 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:34:10 +03:00
dependabot[bot]
cf77259d5a 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:27:01 +00:00
dependabot[bot]
21d9a3f76a Bump y18n from 3.2.1 to 3.2.2
Bumps [y18n](https://github.com/yargs/y18n) from 3.2.1 to 3.2.2.
- [Release notes](https://github.com/yargs/y18n/releases)
- [Changelog](https://github.com/yargs/y18n/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yargs/y18n/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-31 20:26:04 +00:00
Matte
5e9a446b55 Update README.md 2020-07-19 13:34:39 +03:00
dependabot[bot]
852c8f7f21 Bump websocket-extensions from 0.1.3 to 0.1.4
Bumps [websocket-extensions](https://github.com/faye/websocket-extensions-node) from 0.1.3 to 0.1.4.
- [Release notes](https://github.com/faye/websocket-extensions-node/releases)
- [Changelog](https://github.com/faye/websocket-extensions-node/blob/master/CHANGELOG.md)
- [Commits](https://github.com/faye/websocket-extensions-node/compare/0.1.3...0.1.4)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-19 10:33:24 +00:00
MatteZ02
b50d826dd0 version and updated modules 2020-04-29 12:15:49 +03:00
Matte
4a74bc8871 Update config.js 2020-01-21 15:08:55 +02:00
MatteZ02
8723ddc7b6 Update config.js 2020-01-13 12:37:12 +02:00
MatteZ02
2caac65a35 Update handleVideo.js 2020-01-01 21:39:29 +02:00
MatteZ02
f1b93642c3 Merge branch 'master' of https://github.com/MatteZ02/Musix-V2 2020-01-01 19:06:01 +02:00
MatteZ02
7d3c2dd416 Added shuffle command 2020-01-01 19:05:50 +02:00
Matte
cce24d05a1 Update status.js 2019-12-24 15:21:34 +02:00
MatteZ02
decc53083f Merge branch 'master' of https://github.com/MatteZ02/Musix-V2 2019-12-18 17:21:43 +02:00
MatteZ02
018fec70a6 Songselection won't take input from other users 2019-12-18 17:21:40 +02:00
Matte
06011e0cc3 Update Client.js 2019-12-17 04:12:12 +02:00
Matte
9f17804f86 Update ready.js 2019-12-16 23:10:06 +02:00
MatteZ02
96c9552660 Update ready.js 2019-12-16 21:16:36 +02:00
MatteZ02
2e31350def ffmpeg error detections system 2019-12-16 21:01:42 +02:00
MatteZ02
069ba70cb5 Update config.js 2019-12-06 15:29:42 +02:00
MatteZ02
60b9fc6b9b Merge branch 'master' of https://github.com/MatteZ02/Musix-V2 2019-12-05 15:17:17 +02:00
MatteZ02
faa80e6749 big update 2019-12-05 15:17:15 +02:00
Matte
dfc360368c Update loop.js 2019-11-27 14:06:24 +02:00
Matte
5d34e80312 Update queue.js 2019-11-27 14:05:27 +02:00
MatteZ02
b83ee14cba cmduses 2019-11-25 20:48:56 +02:00
MatteZ02
f6d82709be Update message.js 2019-11-25 20:04:40 +02:00
MatteZ02
6d23063a30 fixed dev bypass 2019-11-23 15:03:08 +02:00
MatteZ02
afd2b3600f Update play.js 2019-11-23 10:38:43 +02:00
MatteZ02
65ef473f0d Update play.js 2019-11-23 09:31:40 +02:00
MatteZ02
202743e63b patched the error if skipping when nothing is playing 2019-11-23 09:17:43 +02:00
MatteZ02
0c72a2d9b1 Updated the way currently playing music is declared.
This should get arid of the problem when skipping/stopping music causes the bot to error.
2019-11-22 20:51:41 +02:00
MatteZ02
a05b069f99 Update delete.js 2019-11-20 08:05:01 +02:00
MatteZ02
f76769d512 Update delete.js 2019-11-19 18:10:20 +02:00
MatteZ02
3d391a685a playlist patch 2019-11-19 18:08:00 +02:00
MatteZ02
698bb0eb9b Voteskip 2019-11-19 15:59:14 +02:00
MatteZ02
c32d592074 fixed songSelection setting 2019-11-18 20:36:18 +02:00
MatteZ02
79a53ecb03 added songselection setting 2019-11-14 20:23:51 +02:00
MatteZ02
1190bd7de3 Option for song selection 2019-11-14 19:56:01 +02:00
MatteZ02
89d010e2e5 Update ready.js 2019-11-11 15:55:32 +02:00
MatteZ02
67bc85b47e Update ready.js 2019-11-05 19:28:03 +02:00
MatteZ02
c2490b94ed Update setDj.js 2019-11-03 13:55:04 +02:00
MatteZ02
bc7e31a05f Update index.js 2019-11-03 10:04:23 +02:00
MatteZ02
e5dd77d3b9 Update ready.js 2019-11-03 09:55:54 +02:00
MatteZ02
25f76daf88 Update add.js 2019-11-03 09:53:40 +02:00
MatteZ02
97adfdbf86 Update skip.js 2019-11-02 08:56:39 +02:00
MatteZ02
176960fa24 fixed apikey 2019-11-01 14:37:31 +02:00
MatteZ02
2d8143cea5 Fixed after christer. Updated dev only commands. 2019-11-01 13:39:04 +02:00
Matte
ac96a99e1c Merge pull request #16 from cwchristerw/changes
Changes
2019-11-01 10:56:22 +02:00
Christer Warén
41022e98c0 Update eval.js 2019-10-31 23:49:48 +02:00
Christer Warén
c17baf973a Update seek.js 2019-10-31 23:49:14 +02:00
Christer Warén
8f4df31a66 Update remove.js 2019-10-31 23:48:38 +02:00
Christer Warén
e6263db933 Update exe.js 2019-10-31 23:47:17 +02:00
Christer Warén
e101d780e7 Update forcestop.js 2019-10-31 23:45:58 +02:00
Christer Warén
82b2bc9916 Update resume.js 2019-10-31 23:45:16 +02:00
Christer Warén
a637d929f5 Update pause.js 2019-10-31 23:44:37 +02:00
Christer Warén
2cae32c926 Update loop.js 2019-10-31 23:43:43 +02:00
Christer Warén
b5590e1c7f Update playlist.js 2019-10-31 23:42:23 +02:00
Christer Warén
9210c41d83 Update message.js 2019-10-31 23:40:50 +02:00
Christer Warén
363f7fa49c Update guildcreate.js 2019-10-31 23:35:57 +02:00
Christer Warén
3166c44ac8 Update ready.js 2019-10-31 23:32:47 +02:00
Christer Warén
1cc363d6c8 Update settings.js 2019-10-31 21:10:53 +02:00
Christer Warén
6f893516d8 Update playlist.js 2019-10-31 21:10:24 +02:00
Christer Warén
17c1369765 Update handleVideo.js 2019-10-31 21:09:35 +02:00
Christer Warén
3fec29be3b Update exe.js 2019-10-31 21:08:45 +02:00
Christer Warén
2820622a70 Update index.js
process.env.DISCORD_TOKEN
process.env.DISCORD_DEV_UID
process.env.DISCORD_DEBUG_CHANNEL_ID
process.env.YOUTUBE_KEY
process.env.DBL_TOKEN
process.env.PREFIX
2019-10-31 21:05:51 +02:00
Christer Warén
9b98935e9d Update message.js 2019-10-31 20:49:23 +02:00
Christer Warén
3c3df91675 Update index.js 2019-10-31 20:47:39 +02:00
Christer Warén
a656e315aa Merge pull request #16 from cwchristerw/changing-dependencies
Update package.json
2019-10-31 20:41:08 +02:00
Christer Warén
f1af6f7462 Merge pull request #15 from MatteZ02/master
Option handler for playlists and settings. Exe function to execute co…
2019-10-31 20:36:58 +02:00
MatteZ02
8615735431 Option handler for playlists and settings. Exe function to execute command files. Command aliases updated. 2019-10-31 20:29:26 +02:00
Christer Warén
e1091e03b3 Update package.json 2019-10-31 17:05:44 +02:00
Christer Warén
b1e9c260e3 Merge pull request #9 from MatteZ02/master
Base to Fork
2019-10-31 15:57:26 +02:00
Matte
1899c8647b Merge pull request #10 from cwchristerw/update-package-json
Added repository to package.json
2019-10-31 15:16:28 +02:00
Christer Warén
046fd1ab0f Added repository 2019-10-31 14:13:21 +02:00
Christer Warén
1f310190d9 Merge pull request #8 from MatteZ02/master
Base to Fork
2019-10-31 13:58:30 +02:00
MatteZ02
0bfa09209a Update play.js 2019-10-29 17:47:57 +02:00
MatteZ02
6aa654c9e7 Update message.js 2019-10-27 18:06:48 +02:00
MatteZ02
f79b120334 Update index.js 2019-10-25 22:47:09 +03:00
MatteZ02
b40bc72ead Update volume.js 2019-10-24 21:02:44 +03:00
MatteZ02
a72818583f Update index.js 2019-10-24 21:00:05 +03:00
MatteZ02
81d9896f88 Merge branch 'master' of https://github.com/MatteZ02/Musix-V2 2019-10-24 20:56:20 +03:00
MatteZ02
1a858fe31b Update nowplaying.js 2019-10-24 20:56:17 +03:00
Matte
b9d6f01b32 Update playlist.js 2019-10-24 20:30:54 +03:00
MatteZ02
54f3b6ca70 Update settings.js 2019-10-24 20:23:37 +03:00
MatteZ02
7162be204d Update settings.js 2019-10-24 20:21:55 +03:00
MatteZ02
38c0103281 More powerful number handling. Setting whether to announce songs starting to play. Remove command fixes 2019-10-24 20:11:08 +03:00
MatteZ02
bd9ef87dde Song author and remove command 2019-10-24 19:29:04 +03:00
MatteZ02
72e600454f Update playlist.js 2019-10-23 20:45:22 +03:00
Matte
1917fe7784 too small dealy 2019-10-22 18:42:37 +03:00
MatteZ02
9b71cc6efe Update ready.js 2019-10-22 18:40:42 +03:00
MatteZ02
ad67d626e8 Update index.js 2019-10-22 18:34:45 +03:00
MatteZ02
c227d49113 Update status 2019-10-22 18:28:15 +03:00
Matte
97e9da5628 Update playlist.js 2019-10-21 14:58:27 +03:00
Matte
88806ad7b2 Update play.js 2019-10-21 14:57:31 +03:00
Matte
7b20498221 Update playlist.js 2019-10-20 22:53:51 +03:00
Matte
0be11ffedd Update play.js 2019-10-20 22:53:12 +03:00
MatteZ02
74548e8f88 local fix 2019-10-20 22:24:22 +03:00
MatteZ02
ed2d3368a1 fix? 2019-10-20 22:19:42 +03:00
MatteZ02
b6f7ddbbf9 Update play.js 2019-10-20 21:33:28 +03:00
MatteZ02
6c9ce70873 Update play.js 2019-10-20 21:32:24 +03:00
MatteZ02
e19e5f7656 Update play.js 2019-10-20 21:29:57 +03:00
MatteZ02
03ec1ddf64 Merge branch 'master' of https://github.com/MatteZ02/Musix-V2 2019-10-20 21:28:34 +03:00
MatteZ02
65cd122c7b update modules 2019-10-20 21:28:25 +03:00
Matte
abd09f6b0c Update playlist.js 2019-10-20 21:23:35 +03:00
Matte
9f571c10d7 Update play.js 2019-10-20 21:21:51 +03:00
MatteZ02
1d0fcb6fae update modules 2019-10-20 21:17:53 +03:00
Matte
6d98488f40 Update play.js 2019-10-20 20:59:53 +03:00
Matte
102b10df79 Update play.js 2019-10-20 20:59:17 +03:00
Matte
ee0d66c554 Update stop.js 2019-10-20 20:57:21 +03:00
Matte
52de7012d3 Update forcestop.js 2019-10-20 20:54:32 +03:00
Matte
50821c2b2b Update forcestop.js 2019-10-20 20:46:57 +03:00
MatteZ02
34aeeede66 Create forcestop.js 2019-10-20 20:31:37 +03:00
MatteZ02
a6d4dcbcd5 update 2019-10-18 21:44:15 +03:00
MatteZ02
83945c779a error logs 2019-10-18 16:01:26 +03:00
Matte
e34fb2d069 Update index.js 2019-10-17 08:26:10 +03:00
MatteZ02
2366f7e3a6 Update 2019-10-16 14:20:49 +03:00
Matte
4b7b90a5e2 Update status.js 2019-10-14 19:20:38 +03:00
Matte
224b8cd839 Update message.js 2019-10-13 21:08:04 +03:00
Matte
5007962c4e Update index.js 2019-10-13 21:07:46 +03:00
MatteZ02
f2d105d5e2 Added commands to playlist 2019-10-13 20:52:51 +03:00
MatteZ02
55c3ff293b Update playlist.js 2019-10-13 16:01:46 +03:00
MatteZ02
3bc49ad955 Update playlist.js 2019-10-13 15:58:46 +03:00
MatteZ02
44e05abfe6 Update playlist.js 2019-10-13 13:59:41 +03:00
MatteZ02
ca61906f57 DJ role support 2019-10-13 10:33:59 +03:00
MatteZ02
1b4dd3921b Update ready.js 2019-10-12 18:56:44 +03:00
MatteZ02
198130700c Update settings.js 2019-10-12 18:25:19 +03:00
MatteZ02
af5e40975c Update settings.js 2019-10-12 18:23:18 +03:00
MatteZ02
d096810907 Update ready.js 2019-10-12 18:06:27 +03:00
MatteZ02
fbb007e67a Update ready.js 2019-10-12 18:03:15 +03:00
MatteZ02
c716867b8d Addition to the playlists 2019-10-12 18:01:13 +03:00
MatteZ02
ff2845c6cb Update message.js 2019-10-12 17:42:27 +03:00
MatteZ02
a8cde6abca Saved queues 2019-10-12 17:40:00 +03:00
MatteZ02
e8f30cd706 Update eval.js 2019-10-12 13:43:09 +03:00
MatteZ02
271c16a4c0 removed console.lgos 2019-10-12 13:38:12 +03:00
MatteZ02
59b578c5a5 editing console logs 2019-10-12 13:34:38 +03:00
MatteZ02
81f317105b Added consolelogs 2019-10-12 13:31:07 +03:00
MatteZ02
970ec44de8 Updated looping 2019-10-12 12:49:24 +03:00
MatteZ02
8c117edd1e Revert "Update package-lock.json"
This reverts commit 0794bbf3e5.
2019-10-12 11:16:08 +03:00
MatteZ02
f4eb7b06f7 Revert "added ffmpeg"
This reverts commit db12d61eae.
2019-10-12 11:16:03 +03:00
MatteZ02
c8e7d7476f Revert "Update ready.js"
This reverts commit eceb55edff.
2019-10-12 11:14:21 +03:00
MatteZ02
6ef55d2255 Revert "Updated looping function"
This reverts commit 6ebbf0216d.
2019-10-12 11:14:12 +03:00
MatteZ02
fc2d513694 Revert "removed ffmpeg"
This reverts commit ac62125d3f.
2019-10-12 11:14:09 +03:00
MatteZ02
62ebb54c1a Revert "Update index.js"
This reverts commit 1643abd605.
2019-10-12 11:14:04 +03:00
MatteZ02
2515e781b8 Revert "Update play.js"
This reverts commit 9821119f3d.
2019-10-12 11:13:58 +03:00
MatteZ02
879efe23b9 Revert "Update play.js"
This reverts commit 10288ed81e.
2019-10-12 11:13:55 +03:00
MatteZ02
301eb70ea9 Revert "Added ffmpeg"
This reverts commit 2f2b551ea8.
2019-10-12 11:13:53 +03:00
MatteZ02
4750756ac0 Revert "removed ffmpeg"
This reverts commit e55c26c2b1.
2019-10-12 11:13:49 +03:00
MatteZ02
c296bb4b47 Revert "removed ffmpeg"
This reverts commit 18b240ed06.
2019-10-12 11:13:46 +03:00
MatteZ02
0382c8ef82 Revert "Update ready.js"
This reverts commit 20316ede3a.
2019-10-12 11:13:38 +03:00
MatteZ02
20316ede3a Update ready.js 2019-10-12 10:54:24 +03:00
MatteZ02
18b240ed06 removed ffmpeg 2019-10-12 10:34:55 +03:00
MatteZ02
e55c26c2b1 removed ffmpeg 2019-10-12 10:27:44 +03:00
MatteZ02
2f2b551ea8 Added ffmpeg 2019-10-12 10:22:00 +03:00
MatteZ02
10288ed81e Update play.js 2019-10-12 10:18:05 +03:00
MatteZ02
9821119f3d Update play.js 2019-10-12 10:16:46 +03:00
MatteZ02
1643abd605 Update index.js 2019-10-12 10:07:43 +03:00
MatteZ02
ac62125d3f removed ffmpeg 2019-10-12 10:05:55 +03:00
MatteZ02
6ebbf0216d Updated looping function 2019-10-12 10:05:21 +03:00
MatteZ02
eceb55edff Update ready.js 2019-10-12 08:40:22 +03:00
Christer Warén
e6eba1b38f Merge pull request #7 from MatteZ02/master
Base to Fork
2019-10-11 23:51:55 +03:00
MatteZ02
db12d61eae added ffmpeg 2019-10-11 21:50:31 +03:00
MatteZ02
0794bbf3e5 Update package-lock.json 2019-10-11 21:43:29 +03:00
Matte
e19dd1676e Merge pull request #8 from cwchristerw/fix-7
HTML decoding titles in Song Selection
2019-10-11 21:13:03 +03:00
Christer Warén
a271bbe8f8 Adding he to dependencies in package.json 2019-10-11 21:03:57 +03:00
Christer Warén
ffbdc173f6 Update play.js 2019-10-11 21:02:37 +03:00
MatteZ02
1145d92556 Update play.js 2019-10-11 20:50:49 +03:00
Christer Warén
208c1dfdc1 Merge pull request #6 from MatteZ02/master
Update play.js
2019-10-11 20:40:32 +03:00
MatteZ02
4bda51e696 Update play.js 2019-10-11 20:36:46 +03:00
Christer Warén
967aeeb3ff Merge pull request #5 from MatteZ02/master
Base to Fork
2019-10-11 20:33:59 +03:00
MatteZ02
fb8ae3cf35 Fix for the database error 2019-10-11 18:50:22 +03:00
MatteZ02
873f0c8e1e Update message.js 2019-10-11 15:02:15 +03:00
MatteZ02
f23385a151 Merge branch 'master' of https://github.com/MatteZ02/Musix-V2 2019-10-11 14:58:28 +03:00
MatteZ02
ebc3cd1827 Update README.md 2019-10-11 14:58:15 +03:00
Matte
3b4e592a5f Merge pull request #5 from cwchristerw/homepage-address-package-json
Changing homepage address in package json
2019-10-11 14:55:10 +03:00
Christer Warén
b2b85321ee Changing homepage address in package.json 2019-10-11 14:50:00 +03:00
MatteZ02
6fc09e0400 Update README.md 2019-10-11 14:35:20 +03:00
MatteZ02
3a4327b95c Fixed 2019-10-11 14:30:10 +03:00
Christer Warén
8fa1840d06 Merge pull request #2 from MatteZ02/master
Base to Fork
2019-10-11 14:29:26 +03:00
MatteZ02
62a07834a8 Update index.js 2019-10-11 14:27:20 +03:00
Matte
6c108f5b71 Merge pull request #4 from cwchristerw/master
Adding start command to package.json
2019-10-11 14:25:19 +03:00
Christer Warén
49d4ed9e7f Update package.json 2019-10-11 14:24:27 +03:00
Christer Warén
b6abb8de1d Merge pull request #1 from MatteZ02/master
Base to Fork
2019-10-11 14:23:50 +03:00
MatteZ02
66ca65577b Update .gitignore 2019-10-11 14:18:38 +03:00
MatteZ02
147fffaf8a Added packages 2019-10-11 14:13:40 +03:00
Matte
a1a5076e1c Merge pull request #3 from cwchristerw/add-gitignore
Add .gitignore
2019-10-11 13:58:10 +03:00
Matte
25bf1229c9 Merge pull request #2 from cwchristerw/add-license-1
Add license 1
2019-10-11 13:57:45 +03:00
Christer Warén
0db5e4b71e Create .gitignore 2019-10-11 13:51:23 +03:00
Christer Warén
017dc5d1aa Create LICENSE 2019-10-11 13:48:05 +03:00
Christer Warén
bafa248b79 Create README.md 2019-10-11 13:45:38 +03:00
MatteZ02
feea924d92 Update 2019-10-11 11:48:50 +03:00
MatteZ02
b3a83f3cf0 Removed modules 2019-10-10 16:58:48 +03:00
MatteZ02
50b9bed483 Updated 2019-10-10 16:43:04 +03:00
MatteZ02
6f6ac8a6fa Merge branch 'master' of https://github.com/MatteZ02/Musix-V2 2019-09-15 09:18:37 +03:00
MatteZ02
e4e99d76c9 Updated everything 2019-09-15 09:18:33 +03:00
Matte
9520ff629d Update README.md 2019-08-20 20:48:54 +03:00
MatteZ02
9d7e55b5ee updated all commands and removed some weird files 2019-08-14 15:26:33 +03:00
MatteZ02
29b40867a3 Update invite.js 2019-08-04 16:05:06 +03:00
MatteZ02
3388da95b9 Update invite.js 2019-08-04 16:02:31 +03:00
MatteZ02
e07ec319f2 Update invite.js 2019-08-04 16:00:05 +03:00
MatteZ02
e658301846 Delete duplicate.js 2019-08-04 08:53:04 +03:00
MatteZ02
ec93ed0a42 Duplicate command 2019-08-04 08:51:08 +03:00
MatteZ02
4ddef360fe Update index.js 2019-08-03 22:11:31 +03:00
MatteZ02
91e5d24e5b Update invite.js 2019-08-03 20:49:02 +03:00
MatteZ02
17a3ea3ae1 Update volume.js 2019-08-03 20:32:04 +03:00
MatteZ02
a9909c947c Update volume.js 2019-08-03 20:27:18 +03:00
MatteZ02
565ccfd9b6 Format update 2019-08-03 10:47:12 +03:00
MatteZ02
8c037a2b9a Format update 2019-08-03 10:19:32 +03:00
MatteZ02
21eda1f641 Format update 2019-08-03 09:49:03 +03:00
MatteZ02
b0341d8eb8 Args requirement 2019-08-03 09:46:34 +03:00
MatteZ02
e377b0d360 Update q.js 2019-08-03 09:43:48 +03:00
MatteZ02
ce23be4fa3 Update queue.js 2019-08-03 09:43:36 +03:00
MatteZ02
e82263af2f Queue format update 2019-08-03 09:27:25 +03:00
MatteZ02
134fb4f6a7 queue page 2 fix & info update 2019-08-02 21:35:25 +03:00
Matte
b105fb1ea3 Update q.js 2019-08-02 20:24:15 +03:00
Matte
5eadbd6b95 Update p.js 2019-08-02 20:23:40 +03:00
Matte
f23082f035 Update p.js 2019-08-02 20:22:07 +03:00
MatteZ02
fd1d99fbfb One letter commands 2019-08-02 15:14:45 +03:00
MatteZ02
e6c55a6fd8 Removed ffmpeg 2019-08-02 11:44:07 +03:00
MatteZ02
8fbc83b677 Musix theme update 2019-08-02 11:42:28 +03:00
Matte
3fba5f22db Create Procfile 2019-08-02 11:39:11 +03:00
Matte
4d0d611ae2 Delete yarn.lock 2019-08-02 11:37:09 +03:00
Matte
9e5b889a34 Update index.js 2019-08-02 11:34:15 +03:00
MatteZ02
bf618eecd7 Initial 2019-08-02 11:32:00 +03:00
Matte
6ae27ae369 Initial commit 2019-08-02 11:29:47 +03:00
47 changed files with 4763 additions and 1 deletions

3
.gitignore vendored
View File

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

58
Client.js Normal file
View File

@@ -0,0 +1,58 @@
const { Client, Collection } = require('discord.js');
const admin = require('firebase-admin');
require('dotenv/config');
module.exports = class extends Client {
constructor() {
super({
intents: [
"Guilds",
"GuildMessages",
"GuildVoiceStates",
"MessageContent"
],
disableMentions: "everyone",
disabledEvents: ["TYPING_START"]
});
this.commands = new Collection();
this.commandAliases = new Collection();
this.playlistCmd = new Collection();
this.settingCmd = new Collection();
this.events = new Collection();
this.queue = new Map();
this.funcs = {};
this.funcs.handleVideo = require('./funcs/handleVideo.js');
this.funcs.play = require('./funcs/play.js');
this.funcs.msToTime = require('./funcs/msToTime.js');
this.funcs.exe = require('./funcs/exe.js');
this.config = require('./config.js');
this.global = {
db: {
guilds: {},
playlists: {},
},
};
if(this.config.firebase.serviceAccount){
this.funcs.dbget = require('./funcs/dbget.js');
admin.initializeApp({
credential: admin.credential.cert(this.config.firebase.serviceAccount),
});
this.db = admin.firestore();
this.db.FieldValue = require('firebase-admin').firestore.FieldValue;
}
}
};

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 +1,21 @@
# Musix OSS
# Musix-V2
THIS VERSION OF MUSIX IS NO LONGER SUPPORTED!
## Discord music bot
Second version of Musix discord music bot.
Made with discord.js V11
NOTE! THIS BOT CANNOT BE USED AFTER OCTOBER 4TH 2020! This is due to new rules for bots by discord.
## Installation
npm install (idk how yarn works)
Some modules are outdated to updating is recommended!
## Usage
You will need you own .env file and serviceAccount.json for database!

32
commands/help.js Normal file
View File

@@ -0,0 +1,32 @@
const { EmbedBuilder } = require("discord.js");
module.exports = {
name: 'help',
description: 'Help command.',
alias: 'help',
cooldown: 5,
execute(message, args, client, prefix) {
const embed = new EmbedBuilder()
.setTitle(`Commands for ${client.user.username}!`)
.addFields(
{ name: `${prefix}play | ${prefix}p`, value: 'Play a song.', inline: true },
{ name: `${prefix}skip | ${prefix}s`, value: 'Skip a song.', inline: true },
{ name: `${prefix}queue | ${prefix}q`, value: 'Display the queue.', inline: true },
{ name: `${prefix}nowplaying | ${prefix}np`, value: 'Display what\'s currently playing.', inline: true },
{ name: `${prefix}remove | ${prefix}rm`, value: 'Remove songs from the queue.', 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}loop`, value: 'Loop the queue.', inline: true },
{ name: `${prefix}seek`, value: 'Seek music.', inline: true },
{ name: `${prefix}stop`, value: 'Stop the music, Clear the queue and leave the current voice channel.', inline: true },
{ name: `${prefix}invite`, value: 'Invite Musix.', inline: true },
{ name: `${prefix}status`, value: 'See different information for Musix.', inline: true },
{ name: `${prefix}settings`, value: 'Change the guild specific settings.', inline: true },
{ name: `${prefix}help`, value: 'Display the help.', inline: true }
)
.setAuthor({ name: client.user.username, iconURL: client.user.avatarURL()})
.setColor(client.config.embedColor)
return message.channel.send({ embeds: [embed] });
}
};

15
commands/invite.js Normal file
View File

@@ -0,0 +1,15 @@
const { EmbedBuilder } = require("discord.js");
module.exports = {
name: 'invite',
description: 'Invite command.',
alias: 'invite',
cooldown: 5,
execute(message, args, client, prefix) {
const embed = new EmbedBuilder()
.setTitle(`Invite ${client.user.username} to your Discord server!`)
.setURL(`https://discord.com/oauth2/authorize?client_id=${client.user.id}&permissions=2184465408&scope=applications.commands+bot`)
.setColor(client.config.embedColor)
return message.channel.send({ embeds: [embed] });
}
};

27
commands/loop.js Normal file
View File

@@ -0,0 +1,27 @@
const { PermissionFlagsBits } = require('discord.js');
module.exports = {
name: 'loop',
description: 'loop command.',
alias: 'loop',
cooldown: 10,
async execute(message, args, client, prefix) {
const serverQueue = client.queue.get(message.guild.id);
const permissions = message.channel.permissionsFor(message.author);
const voiceChannel = message.member.voice.channel;
if (!serverQueue) return message.channel.send(':x: There is nothing playing.');
if (voiceChannel !== serverQueue.voiceChannel) return message.channel.send(':x: I\'m sorry but you need to be in the same voice channel as Musix to loop the queue!');
if (client.global.db.guilds[message.guild.id].permissions === true) {
if (client.global.db.guilds[message.guild.id].dj) {
if (!message.member.roles.cache.has(client.global.db.guilds[message.guild.id].djrole)) return message.channel.send(':x: You need the `DJ` role to loop the queue!');
} else if (!permissions.has(PermissionFlagsBits.ManageChannels)) return message.channel.send(':x: You need the `MANAGE_MESSAGES` permission to loop the queue!');
}
if (!serverQueue.looping) {
serverQueue.looping = true;
message.channel.send(':repeat: Looping the queue now!');
} else {
serverQueue.looping = false;
message.channel.send(':repeat: No longer looping the queue!');
}
}
};

27
commands/nowplaying.js Normal file
View File

@@ -0,0 +1,27 @@
const { EmbedBuilder } = require('discord.js');
module.exports = {
name: 'nowplaying',
description: 'Now playing command.',
alias: 'np',
cooldown: 5,
async execute(message, args, client, prefix) {
const ytdl = require('ytdl-core');
const serverQueue = client.queue.get(message.guild.id);
if (!serverQueue) return message.channel.send(':x: There is nothing playing.');
if (!serverQueue.playing) return message.channel.send(':x: There is nothing playing.');
let data = await Promise.resolve(ytdl.getInfo(serverQueue.songs[0].url));
let songtime = (data.length_seconds * 1000).toFixed(0);
let completed = (serverQueue.connection.dispatcher.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 embed = new EmbedBuilder()
.setTitle("__Now playing__")
.setDescription(`🎶**Now playing:** ${serverQueue.songs[0].title}\n${array.join('')} | \`${client.funcs.msToTime(completed)} / ${client.funcs.msToTime(songtime)}\``)
.setFooter({ text: `Queued by ${serverQueue.songs[0].author.tag}` })
.setURL(serverQueue.songs[0].url)
.setColor(client.config.embedColor)
return message.channel.send({ embeds: [embed] });
}
};

25
commands/pause.js Normal file
View File

@@ -0,0 +1,25 @@
const { PermissionFlagsBits } = require('discord.js');
module.exports = {
name: 'pause',
description: 'Pause command.',
alias: 'pause',
cooldown: 5,
execute(message, args, client, prefix) {
const serverQueue = client.queue.get(message.guild.id);
const permissions = message.channel.permissionsFor(message.author);
const voiceChannel = message.member.voice.channel;
if (!serverQueue) return message.channel.send(':x: There is nothing playing.');
if (serverQueue.playing && !serverQueue.paused) {
if (voiceChannel !== serverQueue.voiceChannel) return message.channel.send(':x: I\'m sorry but you need to be in the same voice channel as Musix to pause the music!');
if (client.global.db.guilds[message.guild.id].permissions === true) {
if (client.global.db.guilds[message.guild.id].dj) {
if (!message.member.roles.cache.has(client.global.db.guilds[message.guild.id].djrole)) return message.channel.send(':x: You need the `DJ` role to pause the music!');
} else if (!permissions.has(PermissionFlagsBits.ManageMessages)) return message.channel.send(':x: You need the `MANAGE_MESSAGES` permission to pause the music!');
}
serverQueue.paused = true;
serverQueue.audioPlayer.pause();
return message.channel.send('⏸ Paused the music!');
} else return message.channel.send(':x: There is nothing playing.');
}
};

86
commands/play.js Normal file
View File

@@ -0,0 +1,86 @@
const YouTube = require("simple-youtube-api");
const he = require('he');
const { EmbedBuilder, PermissionFlagsBits } = require("discord.js");
module.exports = {
name: 'play',
description: 'Play command.',
usage: '[song name]',
alias: 'p',
args: true,
cooldown: 3,
async execute(message, args, client, prefix) {
const youtube = new YouTube(client.config.youtube_api_key);
const searchString = args.slice(1).join(" ");
const url = args[1] ? args[1].replace(/<(.+)>/g, "$1") : "";
const serverQueue = client.queue.get(message.guild.id);
const voiceChannel = message.member.voice.channel;
if (!serverQueue) {
if (!voiceChannel) return message.channel.send(':x: I\'m sorry but you need to be in a voice channel to play music!');
} else {
if (voiceChannel !== serverQueue.voiceChannel) return message.channel.send(':x: I\'m sorry but you need to be in the same voice channel as Musix to play music!');
}
if (!args[1]) return message.channel.send(':x: You need to use a link or search for a song!');
const permissions = voiceChannel.permissionsFor(message.client.user);
if (!permissions.has(PermissionFlagsBits.Connect)) {
return message.channel.send(':x: I cannot connect to your voice channel, make sure I have the proper permissions!');
}
if (!permissions.has(PermissionFlagsBits.Speak)) {
return message.channel.send(':x: I cannot speak in your 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 client.funcs.handleVideo(video2, message, voiceChannel, client, true);
}
return message.channel.send(`:white_check_mark: Playlist: **${playlist.title}** has been added to the queue!`);
} else if (client.global.db.guilds[message.guild.id].songSelection) {
try {
var video = await youtube.getVideo(url);
} catch (error) {
try {
var videos = await youtube.searchVideos(searchString, 10);
let index = 0;
const embed = new EmbedBuilder()
.setTitle("__Song Selection__")
.setDescription(`${videos.map(video2 => `**${++index}** ${he.decode(video2.title)} `).join('\n')}`)
.setFooter({ text: "Please provide a number ranging from 1-10 to select one of the search results." })
.setColor(client.config.embedColor)
message.channel.send({ embeds: [embed] });
try {
var response = await message.channel.awaitMessages({
filter: message2 => message2.content > 0 && message2.content < 11 && message2.author === message.author,
max: 1,
time: 10000,
errors: ['time']
});
} catch (err) {
console.error(err);
return message.channel.send(':x: Cancelling video selection');
}
const videoIndex = parseInt(response.first().content);
var video = await youtube.getVideoByID(videos[videoIndex - 1].id);
} catch (err) {
console.error(err);
return message.channel.send(':x: I could not obtain any search results!');
}
}
return client.funcs.handleVideo(video, message, voiceChannel, client, false);
} else {
try {
var video = await youtube.getVideo(url);
} catch (error) {
try {
var videos = await youtube.searchVideos(searchString, 1);
var video = await youtube.getVideoByID(videos[0].id);
} catch (err) {
console.error(err);
return message.channel.send(':x: I could not obtain any search results!');
}
}
return client.funcs.handleVideo(video, message, voiceChannel, client, false);
}
}
};

44
commands/playlist.js Normal file
View File

@@ -0,0 +1,44 @@
const YouTube = require("simple-youtube-api");
const he = require('he');
const { EmbedBuilder, PermissionFlagsBits } = require("discord.js");
module.exports = {
name: 'playlist',
usage: '[option]',
description: 'Save and load queues',
alias: 'pl',
cooldown: 10,
async execute(message, args, client, prefix) {
const embed = new EmbedBuilder()
.setTitle('Options for playlist!')
.addFields(
{ name: 'play', value: 'Play the guild specific queue.', inline: true },
{ name: 'save', value: 'Save the currently playing queue. Note that this will overwrite the currently saved queue!', inline: true },
{ name: 'add', value: 'Add songs to the playlist. Like song selection', inline: true },
{ name: 'remove', value: 'Remove songs from the playlist.', inline: true },
{ name: 'list', value: 'Display the playlist.', inline: true }
)
.setFooter({ text: `how to use: ${prefix}playlist <Option> <Optional option>` })
.setAuthor({ name: client.user.username, iconURL: client.user.avatarURL()})
.setColor(client.config.embedColor)
const permissions = message.channel.permissionsFor(message.author);
if (client.global.db.guilds[message.guild.id].dj) {
if (!message.member.roles.cache.has(client.global.db.guilds[message.guild.id].djrole)) return message.channel.send(':x: You need the `DJ` role to modify or play the playlist!');
} else if (!permissions.has(PermissionFlagsBits.ManageGuild)) return message.channel.send(':x: You need the `MANAGE_SERVER` permission to modify the playlist!');
if (client.global.db.guilds[message.guild.id].premium) {
if (args[1]) {
const optionName = args[1].toLowerCase();
const option = client.playlistCmd.get(optionName) || client.playlistCmd.find(cmd => cmd.aliases && cmd.aliases.includes(optionName));
if (!option) return message.channel.send({ embeds: [embed] });
try {
option.execute(message, args, client, prefix);
} catch (error) {
message.reply(`:x: there was an error trying to execute that option!`);
console.log(error);
}
} else {
return message.channel.send({ embeds: [embed] });
}
} else return message.channel.send(":x: This is not a premium guild!");
},
};

53
commands/playlist/add.js Normal file
View File

@@ -0,0 +1,53 @@
const YouTube = require("simple-youtube-api");
const he = require('he');
const { EmbedBuilder } = require("discord.js");
module.exports = {
name: 'add',
async execute(message, args, client, prefix) {
if (client.global.db.playlists[message.guild.id].saved) {
const serverQueue = client.queue.get(message.guild.id);
const youtube = new YouTube(client.config.youtube_api_key);
const searchString = args.slice(2).join(" ");
const url = args[2] ? args[2].replace(/<(.+)>/g, "$1") : "";
if (!args[2]) return message.channel.send(':x: You need to use a link or search for a song!');
try {
var video = await youtube.getVideo(url);
} catch (error) {
try {
var videos = await youtube.searchVideos(searchString, 10);
let index = 0;
const embed = new EmbedBuilder()
.setTitle("__Song Selection__")
.setDescription(`${videos.map(video2 => `**${++index}** ${he.decode(video2.title)} `).join('\n')}`)
.setFooter({ text: "Please provide a number ranging from 1-10 to select one of the search results." })
.setColor("#b50002")
message.channel.send({ embeds: [embed] });
try {
var response = await message.channel.awaitMessages({
filter: message2 => message2.content > 0 && message2.content < 11,
max: 1,
time: 10000,
errors: ['time']
});
} catch (err) {
console.error(err);
return message.channel.send(':x: Cancelling video selection');
}
const videoIndex = parseInt(response.first().content);
var video = await youtube.getVideoByID(videos[videoIndex - 1].id);
} catch (err) {
console.error(err);
return message.channel.send(':x: I could not obtain any search results!');
}
}
let song = {
id: video.id,
title: he.decode(video.title),
url: `https://www.youtube.com/watch?v=${video.id}`
}
client.global.db.playlists[message.guild.id].songs.push(song);
message.channel.send(`:white_check_mark: ${song.title} added to the playlist!`);
} else return message.channel.send(':x: There is no playlist saved! Start by using the save option!');
}
};

View File

@@ -0,0 +1,11 @@
module.exports = {
name: 'delete',
async execute(message, args, client, prefix) {
client.global.db.playlists[message.guild.id] = {
songs: [],
firstSong: undefined,
saved: false,
};
message.channel.send(':wastebasket: Deleted the playlist.');
}
};

24
commands/playlist/list.js Normal file
View File

@@ -0,0 +1,24 @@
const { EmbedBuilder } = require("discord.js");
module.exports = {
name: 'list',
async execute(message, args, client, prefix) {
if (args[2]) {
if (isNaN(args[2])) return msg.channel.send(':x: I\'m sorry, But you need to enter a valid __number__.');
}
let page = parseInt(args[2]);
if (!page) page = 1;
let pagetext = `:page_facing_up: Page: ${page} :page_facing_up:`
let queuesongs = client.global.db.playlists[message.guild.id].songs.slice((page - 1) * 20, page * 20);
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}**`);
}
const embed = new EmbedBuilder()
.setTitle("__playlist queue__")
.setDescription(`${pagetext}\n${queuemessage}`)
.setColor("#b50002")
return message.channel.send({ embeds: [embed] });
}
};

69
commands/playlist/play.js Normal file
View File

@@ -0,0 +1,69 @@
const { PermissionFlagsBits } = require("discord.js");
const { createAudioPlayer, getVoiceConnection, joinVoiceChannel, NoSubscriberBehavior } = require("@discordjs/voice");
module.exports = {
name: 'play',
async execute(message, args, client, prefix) {
const serverQueue = client.queue.get(message.guild.id);
const voiceChannel = message.member.voice.channel;
if (!voiceChannel) return message.channel.send(':x: I\'m sorry but you need to be in a voice channel to play music!');
const permissions = voiceChannel.permissionsFor(message.client.user);
if (!permissions.has(PermissionFlagsBits.Connect)) {
return message.channel.send(':x: I cannot connect to your voice channel, make sure I have the proper permissions!');
}
if (!permissions.has(PermissionFlagsBits.Speak)) {
return message.channel.send(':x: I cannot speak in your voice channel, make sure I have the proper permissions!');
}
let songs;
if (!voiceChannel) return message.channel.send(':x: I\'m sorry but you need to be in a voice channel to play music!');
if (args[2]) {
if (client.global.db.guilds[args[2]].premium && client.global.db.playlists[args[2]].saved) {
songs = client.global.db.playlists[args[2]].songs;
} else return message.channel.send(':x: There is no queue saved for this guild!')
} else {
songs = client.global.db.playlists[message.guild.id].songs;
}
if (client.global.db.playlists[message.guild.id].saved) {
if (!serverQueue) {
const construct = {
textChannel: message.channel,
voiceChannel: message.member.voice.channel,
connection: null,
audioPlayer: createAudioPlayer({
behaviors: {
noSubscriber: NoSubscriberBehavior.Play,
}
}),
songs: [...songs],
volume: client.global.db.guilds[message.guild.id].defaultVolume,
playing: false,
looping: false,
paused: false,
votes: 0,
voters: [],
votesNeeded: null
};
client.queue.set(message.guild.id, construct);
message.channel.send(":white_check_mark: Queue set!");
try {
const connection =
getVoiceConnection(voiceChannel.guild.id) ??
joinVoiceChannel({
channelId: voiceChannel.id,
guildId: voiceChannel.guild.id,
adapterCreator: voiceChannel.guild.voiceAdapterCreator
});
construct.connection = connection;
client.funcs.play(message.guild, construct.songs[0], client, message, 0, false);
} catch (error) {
client.queue.delete(message.guild.id);
return message.channel.send(`:x: An error occured: ${error}`);
}
} else {
serverQueue.audioPlayer.stop();
serverQueue.songs = [...client.global.db.playlists[message.guild.id].songs];
message.channel.send(":white_check_mark: Queue set!");
}
} else return message.channel.send(':x: There is no queue set for this server!')
}
};

View File

@@ -0,0 +1,13 @@
module.exports = {
name: 'remove',
async execute(message, args, client, prefix) {
if (client.global.db.playlists[message.guild.id].saved) {
if (!args[2]) return message.channel.send(':x: Please provide a number on the position of the song that you wan\'t to remove!');
const songNum = parseInt(args[2]) - 1;
if (isNaN(songNum)) return message.channel.send(':x: You need to enter a __number__!');
if (parseInt(songNum) > client.global.db.playlists[message.guild.id].songs.size) return message.channel.send(`:x: There is only ${serverQueue.songs.size} amount of songs in the queue!`);
message.channel.send(`🗑️ removed \`${client.global.db.playlists[message.guild.id].songs[songNum].title}\` from the playlist!`);
return client.global.db.playlists[message.guild.id].songs.splice(songNum, 1);
} else return message.channel.send(':x: There is no playlist saved! Start by using the save option!');
}
};

13
commands/playlist/save.js Normal file
View File

@@ -0,0 +1,13 @@
module.exports = {
name: 'save',
async execute(message, args, client, prefix) {
const serverQueue = client.queue.get(message.guild.id);
if (!serverQueue) return message.channel.send(':x: There is nothing playing!');
client.global.db.playlists[message.guild.id] = {
songs: serverQueue.songs,
firstSong: serverQueue.songs[0],
saved: true,
};
message.channel.send(":white_check_mark: Queue saved!");
}
};

39
commands/queue.js Normal file
View File

@@ -0,0 +1,39 @@
const { EmbedBuilder } = require("discord.js");
module.exports = {
name: 'queue',
description: 'Queue command.',
alias: 'q',
cooldown: 5,
async execute(message, args, client, prefix) {
const serverQueue = client.queue.get(message.guild.id);
if (!serverQueue) return message.channel.send(':x: There is nothing playing.');
if (args[1]) {
if (isNaN(args[1])) return msg.channel.send(':x: I\'m sorry, But you need to enter a valid __number__.');
}
let page = parseInt(args[1]);
if (!page) page = 1;
let pagetext = `:page_facing_up: Page: ${page} :page_facing_up:`
if (page === 1) pagetext = ':arrow_down: Next in queue :arrow_down:'
let queuesongs = serverQueue.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}**`);
}
if (!serverQueue.looping) {
const embed = new EmbedBuilder()
.setTitle("__Song queue__")
.setDescription(`**Now playing:** ${serverQueue.songs[0].title}🎶\n${pagetext}\n${queuemessage}`)
.setColor(client.config.embedColor)
return message.channel.send({ embeds: [embed] });
} else {
const embed = new EmbedBuilder()
.setTitle("__Song queue__")
.setDescription(`**Now playing:** ${serverQueue.songs[0].title}🎶\n${pagetext}\n${queuemessage}`)
.setFooter({ text: '🔁 Currently looping the queue!' })
.setColor(client.config.embedColor)
return message.channel.send({ embeds: [embed] });
}
}
};

28
commands/remove.js Normal file
View File

@@ -0,0 +1,28 @@
const { PermissionFlagsBits } = require("discord.js");
module.exports = {
name: 'remove',
description: 'Remove command.',
alias: 'rm',
cooldown: 5,
execute(message, args, client, prefix) {
const voiceChannel = message.member.voice.channel;
const serverQueue = client.queue.get(message.guild.id);
const permissions = message.channel.permissionsFor(message.author);
if (!serverQueue) return message.channel.send(':x: There is nothing playing.');
if (!serverQueue.playing) return message.channel.send(':x: There is nothing playing');
if (!args[1]) return message.channel.send(':x: Please provide a song position in queue for me to remove!');
const pos = parseInt(args[1]);
if (isNaN(pos)) return message.channel.send(':x: You need to enter a number!');
if (pos === 0) return message.channel.send(':x: You can not remove the currently playing song!');
if (pos > serverQueue.songs.size) return message.channel.send(`:x: There is only ${serverQueue.songs.size} amount of songs in the queue!`);
if (voiceChannel !== serverQueue.voiceChannel) return message.channel.send(':x: I\'m sorry but you need to be in the same voice channel as Musix to remove songs!');
if (client.global.db.guilds[message.guild.id].dj) {
if (serverQueue.songs[pos].author !== message.author) {
if (!message.member.roles.cache.has(client.global.db.guilds[message.guild.id].djrole)) return message.channel.send(':x: You need the `DJ` role to remove songs queue by others!');
}
} else if (!permissions.has(PermissionFlagsBits.ManageMessages) && serverQueue.songs[pos].author !== message.author) return message.channel.send(':x: You need the `MANAGE_MESSAGES` permission to remove songs queued by others!');
message.channel.send(`🗑️ removed \`${serverQueue.songs[pos].title}\` from the queue!`);
return serverQueue.songs.splice(pos, 1);
}
};

26
commands/resume.js Normal file
View File

@@ -0,0 +1,26 @@
const { PermissionFlagsBits } = require("discord.js");
module.exports = {
name: 'resume',
description: 'Resume command.',
alias: 'resume',
cooldown: 5,
execute(message, args, client, prefix) {
const serverQueue = client.queue.get(message.guild.id);
const permissions = message.channel.permissionsFor(message.author);
const voiceChannel = message.member.voice.channel;
if (!serverQueue) return message.channel.send(':x: There is nothing playing.');
if (serverQueue.playing && serverQueue.paused) {
if (voiceChannel !== serverQueue.voiceChannel) return message.channel.send(':x: I\'m sorry but you need to be in the same voice channel as Musix to loop the queue!');
if (client.global.db.guilds[message.guild.id].permissions === true) {
if (client.global.db.guilds[message.guild.id].dj) {
if (!message.member.roles.cache.has(client.global.db.guilds[message.guild.id].djrole)) return message.channel.send(':x: You need the `DJ` role to resume the music!');
} else if (!permissions.has(PermissionFlagsBits.ManageMessages)) return message.channel.send(':x: You need the `MANAGE_MESSAGES` permission to resume the music!');
}
serverQueue.paused = false;
serverQueue.audioPlayer.unpause();
return message.channel.send('▶ Resumed the music!');
}
return message.channel.send(':x: The music is not paused!');
}
};

32
commands/seek.js Normal file
View File

@@ -0,0 +1,32 @@
const { PermissionFlagsBits } = require("discord.js");
module.exports = {
name: 'seek',
description: 'Seek music.',
alias: 'seek',
cooldown: 10,
async execute(message, args, client, prefix) {
const ytdl = require('ytdl-core');
const serverQueue = client.queue.get(message.guild.id);
const permissions = message.channel.permissionsFor(message.author);
const voiceChannel = message.member.voice.channel;
if (!serverQueue) return message.channel.send(':x: There is nothing playing.');
let data = await Promise.resolve(ytdl.getInfo(serverQueue.songs[0].url));
if (serverQueue.playing) {
if (voiceChannel !== serverQueue.voiceChannel) return message.channel.send(':x: I\'m sorry but you need to be in the same voice channel as Musix to seek the song!');
if (client.global.db.guilds[message.guild.id].permissions === true) {
if (client.global.db.guilds[message.guild.id].dj) {
if (!message.member.roles.cache.has(client.global.db.guilds[message.guild.id].djrole)) return message.channel.send(':x: You need the `DJ` role to seek the song!');
} else if (!permissions.has(PermissionFlagsBits.ManageMessages)) return message.channel.send(':x: You need the `MANAGE_MESSAGES` permission to seek the song!');
}
if (!args[1]) return message.channel.send(`:x: Correct usage: \`${prefix}seek <seeking point in seconds>\``);
const pos = parseInt(args[1])
if (isNaN(pos)) return message.channel.send(':x: I\'m sorry, But you need to enter a valid __number__.');
if (pos < 0) return message.channel.send(':x: The seeking point needs to be a positive number!');
if (pos > data.length_seconds) return message.channel.send(`:x: The lenght of this song is ${data.length_seconds} seconds! You can't seek further than that!`);
serverQueue.audioPlayer.stop();
client.funcs.play(message.guild, serverQueue.songs[0], client, message, pos, false);
} else {
message.channel.send(':x: There is nothing playing!');
}
}
};

39
commands/settings.js Normal file
View File

@@ -0,0 +1,39 @@
const { EmbedBuilder, PermissionFlagsBits } = require("discord.js");
module.exports = {
name: 'settings',
usage: '[setting]',
description: 'Change the settings',
alias: 'settings',
cooldown: 10,
async execute(message, args, client, prefix) {
const embed = new EmbedBuilder()
.setTitle('Guild settings for Musix')
.addFields(
{ name: 'prefix', value: 'Change the guild specific prefix. (string)', inline: true},
{ name: 'volume', value: 'Change the default volume that the bot will start playing at. (number)', inline: true },
{ name: 'permissions', value: 'Change whether to require permissions to use eg `skip, stop, pause, loop, etc...`', inline: true },
{ name: 'setdj', value: '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!', inline: true },
{ name: 'announcesongs', value: 'Whether to announce songs that start playing or not.' },
{ name: 'songselection', value: 'Will i ask to select a song from the top 10 queries or start playing the first result instantly.' }
)
.setFooter({ text: `how to use: ${prefix}settings <name> <value>` })
.setAuthor({ name: client.user.username, iconURL: client.user.avatarURL() })
.setColor(client.config.embedColor)
const permissions = message.channel.permissionsFor(message.author);
if (!permissions.has(PermissionFlagsBits.ManageGuild)) return message.channel.send(':x: You need the `MANAGE_SERVER` permission to change the settings!');
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 message.channel.send({ embeds: [embed] });
try {
option.execute(message, args, client, prefix);
} catch (error) {
message.reply(`:x: there was an error trying to execute that option!`);
console.log(error);
}
} else {
return message.channel.send({ embeds: [embed] });
}
},
};

View File

@@ -0,0 +1,12 @@
module.exports = {
name: 'announcesongs',
async execute(message, args, client, prefix) {
if (client.global.db.guilds[message.guild.id].startPlaying) {
client.global.db.guilds[message.guild.id].startPlaying = false;
return message.channel.send(':white_check_mark: announcesongs now set to `false`!');
} else {
client.global.db.guilds[message.guild.id].startPlaying = true;
return message.channel.send(':white_check_mark: announcesongs now set to `true`!');
}
}
};

View File

@@ -0,0 +1,17 @@
module.exports = {
name: 'permissions',
async execute(message, args, client, prefix) {
if (!args[2]) return message.channel.send(`🔒 Permission requirement: \`${client.global.db.guilds[message.guild.id].permissions}\``);
if (args[2] === 'true') {
if (!client.global.db.guilds[message.guild.id].permissions) {
client.global.db.guilds[message.guild.id].permissions = true;
message.channel.send(`:white_check_mark: Permissions requirement now set to: \`true\``);
} else return message.channel.send(':x: That value is already `true`!');
} else if (args[2] === 'false') {
if (client.global.db.guilds[message.guild.id].permissions) {
client.global.db.guilds[message.guild.id].permissions = false;
message.channel.send(`:white_check_mark: Permissions requirement now set to: \`false\``);
} else return message.channel.send(':x: That value is already `false`!');
} else return message.channel.send(':x: Please define a boolean! (true/false)');
}
};

View File

@@ -0,0 +1,8 @@
module.exports = {
name: 'prefix',
async execute(message, args, client, prefix) {
if (!args[2]) return message.channel.send(`Current prefix: \`${client.global.db.guilds[message.guild.id].prefix}\``);
client.global.db.guilds[message.guild.id].prefix = args[2];
message.channel.send(`:white_check_mark: New prefix set to: \`${args[2]}\``);
}
};

View File

@@ -0,0 +1,14 @@
module.exports = {
name: 'reset',
async execute(message, args, client, prefix) {
client.global.db.guilds[message.guild.id] = {
prefix: client.config.prefix,
defaultVolume: 5,
permissions: false,
premium: false,
dj: false,
djrole: null
};
message.channel.send(':white_check_mark: Reset __all__ guild settings!');
}
};

View File

@@ -0,0 +1,28 @@
const { PermissionFlagsBits } = require("discord.js");
module.exports = {
name: 'setdj',
async execute(message, args, client, prefix) {
if (!client.global.db.guilds[message.guild.id].dj) {
if (!client.global.db.guilds[message.guild.id].permissions) {
client.global.db.guilds[message.guild.id].permissions = true;
}
if (message.guild.roles.cache.find(x => x.name === "DJ")) {
client.global.db.guilds[message.guild.id].djrole = message.guild.roles.cache.find(x => x.name === "DJ").id;
message.channel.send(':white_check_mark: I found a `DJ` role from this guild! This role is now the DJ role.');
client.global.db.guilds[message.guild.id].dj = true;
} else {
const permissions = message.channel.permissionsFor(message.client.user);
if (!permissions.has(PermissionFlagsBits.ManageRoles)) return message.channel.send(':x: 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!');
message.guild.createRole({ name: 'DJ' })
.then(role => client.global.db.guilds[message.guild.id].djrole = role.id)
.catch(console.error)
client.global.db.guilds[message.guild.id].dj = true;
message.channel.send(':white_check_mark: I did not find a role `DJ` so i have created one for you!');
}
} else {
client.global.db.guilds[message.guild.id].dj = false;
message.channel.send(':white_check_mark: `DJ` now set to `false`');
}
}
};

View File

@@ -0,0 +1,34 @@
module.exports = {
name: 'setpremium',
async execute(message, args, client, prefix) {
//if (message.author.id !== client.config.devId) return;
if (args[2]) {
const guild = client.guilds.get(args[2]);
if (!client.global.db.guilds[guild.id].premium) {
client.global.db.playlists[guild.id] = {
songs: [],
firstSong: undefined,
saved: false,
};
client.global.db.guilds[guild.id].premium = true;
message.channel.send(`:white_check_mark: Guild ${guild.name} | ${guild.id} is now premium! :tada:`)
} else {
client.global.db.guilds[guild.id].premium = false;
message.channel.send(`:white_check_mark: Guild ${guild.name} | ${guild.id} is no longer premium!`)
}
} else {
if (!client.global.db.guilds[message.guild.id].premium) {
client.global.db.playlists[message.guild.id] = {
songs: [],
firstSong: undefined,
saved: false,
};
client.global.db.guilds[message.guild.id].premium = true;
message.channel.send(':white_check_mark: This guild is now premium! :tada:')
} else {
client.global.db.guilds[message.guild.id].premium = false;
message.channel.send(":white_check_mark: This guild is no longer premium!")
}
}
}
};

View File

@@ -0,0 +1,12 @@
module.exports = {
name: 'songselection',
async execute(message, args, client, prefix) {
if (!client.global.db.guilds[message.guild.id].songSelection) {
message.channel.send(':white_check_mark: Songselection now set to `true`!');
client.global.db.guilds[message.guild.id].songSelection = true;
} else {
client.global.db.guilds[message.guild.id].songSelection = false;
message.channel.send(':white_check_mark: Songselection now set to `false`');
}
}
};

View File

@@ -0,0 +1,10 @@
module.exports = {
name: 'volume',
async execute(message, args, client, prefix) {
if (!args[2]) return message.channel.send(`:speaker: Current default volume is: \`${client.global.db.guilds[message.guild.id].defaultVolume}\``);
if (isNaN(args[2])) return message.channel.send(':x: I\'m sorry, But the default volume needs to be a valid __number__.');
if (args[2].length > 2) return message.channel.send(':x: The default volume must be below `100` for quality and safety resons.');
client.global.db.guilds[message.guild.id].defaultVolume = args[2];
message.channel.send(`:white_check_mark: Default volume set to: \`${args[2]}\``);
}
};

21
commands/shuffle.js Normal file
View File

@@ -0,0 +1,21 @@
module.exports = {
name: 'Shuffle',
description: 'Shuffle command.',
alias: 'shuffle',
cooldown: 5,
execute(message, args, client, prefix) {
const serverQueue = client.queue.get(message.guild.id);
let currentIndex = serverQueue.songs.length,
temporaryValue,
randomIndex;
while (0 !== currentIndex) {
randomIndex = Math.floor(Math.random() * currentIndex);
currentIndex -= 1;
temporaryValue = serverQueue.songs[currentIndex];
serverQueue.songs[currentIndex] = serverQueue.songs[randomIndex];
serverQueue.songs[randomIndex] = temporaryValue;
}
}
};

46
commands/skip.js Normal file
View File

@@ -0,0 +1,46 @@
const { PermissionFlagsBits } = require("discord.js");
module.exports = {
name: 'skip',
description: 'Skip command.',
alias: 's',
cooldown: 5,
execute(message, args, client, prefix) {
const voiceChannel = message.member.voice.channel;
const serverQueue = client.queue.get(message.guild.id);
const permissions = message.channel.permissionsFor(message.author);
if (!serverQueue) return message.channel.send(':x: There is nothing playing that I could skip for you.');
if (!serverQueue.playing) return message.channel.send(':x: There is nothing playing that I could skip for you.');
if (voiceChannel !== serverQueue.voiceChannel) return message.channel.send(':x: I\'m sorry but you need to be in the same voice channel as Musix to skip the song!');
if (client.global.db.guilds[message.guild.id].permissions === true) {
if (!message.member.roles.cache.has(client.global.db.guilds[message.guild.id].djrole) && !permissions.has(PermissionFlagsBits.ManageMessages)) {
return vote(serverQueue, message, client);
} else {
return skipSong(serverQueue, message);
}
} else {
return vote(serverQueue, message, client);
}
}
};
function skipSong(serverQueue, message) {
message.channel.send(':fast_forward: Skipped the song!');
serverQueue.audioPlayer.stop();
};
function vote(serverQueue, message) {
serverQueue.votesNeeded = Math.floor(serverQueue.voiceChannel.members.size / 2);
serverQueue.votesNeeded.toFixed();
if (serverQueue.voiceChannel.members.size > 2) {
if (serverQueue.voters.includes(message.member.id)) return message.channel.send(':x: You have already voted to skip!');
serverQueue.votes++;
serverQueue.voters.push(message.member.id);
if (serverQueue.votes >= serverQueue.votesNeeded) {
serverQueue.voters = [];
serverQueue.votes = 0;
serverQueue.votesNeeded = null;
return skipSong(serverQueue, message);
} else return message.channel.send(`:x: Not enough votes! ${serverQueue.votes} / ${serverQueue.votesNeeded}!`);
} else {
return skipSong(serverQueue, message);
}
};

25
commands/status.js Normal file
View File

@@ -0,0 +1,25 @@
const { EmbedBuilder } = require("discord.js");
const { getVoiceConnections } = require("@discordjs/voice");
module.exports = {
name: 'status',
description: 'Status command.',
alias: 'status',
cooldown: 5,
async execute(message, args, client, prefix) {
const uptime = client.funcs.msToTime(client.uptime);
const ping = Math.floor(client.ws.ping * 10) / 10;
const embed = new EmbedBuilder()
.setTitle(`Status for ${client.user.username}`)
.addFields(
{ name: ':signal_strength: Ping', value: ping + ' ms', inline: true },
{ name: ':stopwatch: Uptime', value: uptime, inline: true },
{ name: ':play_pause: Currently playing music on', value: `${getVoiceConnections.size ?? 0} guild(s)`, inline: true },
{ name: ':cd: Operating system', value: process.platform, inline: true }
)
.setAuthor({ name: client.user.username, iconURL: client.user.avatarURL()})
.setColor(client.config.embedColor)
return message.channel.send({ embeds: [embed] });
}
};

25
commands/stop.js Normal file
View File

@@ -0,0 +1,25 @@
const { PermissionFlagsBits } = require("discord.js");
module.exports = {
name: 'stop',
description: 'Stop command.',
alias: 'stop',
cooldown: 5,
execute(message, args, client, prefix) {
const voiceChannel = message.member.voice.channel;
const serverQueue = client.queue.get(message.guild.id);
const permissions = message.channel.permissionsFor(message.author);
if (!serverQueue) return message.channel.send(':x: There is nothing playing that I could stop for you.');
if (!serverQueue.playing) return message.channel.send(':x: There is nothing playing that I could stop for you.');
if (voiceChannel !== serverQueue.voiceChannel) return message.channel.send(':x: I\'m sorry but you need to be in the same voice channel as Musix to stop the music!');
if (client.global.db.guilds[message.guild.id].permissions === true) {
if (client.global.db.guilds[message.guild.id].dj) {
if (!message.member.roles.cache.has(client.global.db.guilds[message.guild.id].djrole)) return message.channel.send(':x: You need the `DJ` role to stop the music!');
} else if (!permissions.has(PermissionFlagsBits.ManageChannels)) return message.channel.send(':x: You need the `MANAGE_CHANNELS` permission to stop the music!');
}
serverQueue.songs = [];
serverQueue.looping = false;
serverQueue.audioPlayer.stop();
message.channel.send(':stop_button: Stopped the music!')
}
};

29
commands/volume.js Normal file
View File

@@ -0,0 +1,29 @@
const { PermissionFlagsBits } = require("discord.js");
module.exports = {
name: 'volume',
description: 'Volume command.',
alias: 'volume',
cooldown: 5,
execute(message, args, client, Discord, prefix) {
const voiceChannel = message.member.voice.channel;
const serverQueue = client.queue.get(message.guild.id);
const permissions = message.channel.permissionsFor(message.author);
if (!serverQueue) return message.channel.send(':x: There is nothing playing.');
if (!serverQueue.playing) return message.channel.send(':x: There is nothing playing.');
if (!args[1]) return message.channel.send(`:loud_sound: The current volume is: **${serverQueue.volume}**`);
const volume = parseFloat(args[1]);
if (!voiceChannel) return message.channel.send(':x: I\'m sorry but you need to be in a voice channel to change the volume!');
if (client.global.db.guilds[message.guild.id].permissions === true) {
if (client.global.db.guilds[message.guild.id].dj) {
if (!message.member.roles.cache.has(client.global.db.guilds[message.guild.id].djrole)) return message.channel.send(':x: You need the `DJ` role to change the volume!');
} else if (!permissions.has(PermissionFlagsBits.ManageChannels)) return message.channel.send(':x: You need the `MANAGE_CHANNELS` permission to change the volume!');
}
if (isNaN(volume)) return message.channel.send(':x: I\'m sorry, But you need to enter a valid __number__.');
if (volume > 100) return message.channel.send(':x: The max volume is `100`!');
if (volume < 0) return message.channel.send(':x: The volume needs to be a positive number!');
serverQueue.volume = volume;
serverQueue.audioResource.volume.setVolume(volume / 100);
return message.channel.send(`:loud_sound: I set the volume to: **${volume}**`);
}
};

10
config.js Normal file
View File

@@ -0,0 +1,10 @@
module.exports = {
discord_api_token: process.env.DISCORD_API_TOKEN,
firebase: {
serviceAccount: null
//serviceAccount: require('./serviceAccount.json')
},
youtube_api_key: process.env.YOUTUBE_API_KEY,
prefix: process.env.BOT_PREFIX ?? "mx>",
embedColor: "#b50002"
}

25
events/guildcreate.js Normal file
View File

@@ -0,0 +1,25 @@
module.exports = {
name: 'guildcreate',
async execute(client, guild) {
if(client.config.firebase.serviceAccount){
client.db.collection('guilds').doc(guild.id).set({
prefix: client.config.prefix,
defaultVolume: 50,
permissions: false,
premium: false,
dj: false,
djrole: null,
startPlaying: true
});
client.global.db.guilds[guild.id] = {
prefix: client.config.prefix,
defaultVolume: 50,
permissions: false,
premium: false,
dj: false,
djrole: null,
startPlaying: true
};
}
}
}

24
events/message.js Normal file
View File

@@ -0,0 +1,24 @@
module.exports = {
name: 'message',
async execute(client, message) {
if (message.author.bot || !message.guild) return;
let prefix = client.global.db.guilds[message.guild.id].prefix;
const args = message.content.slice(prefix.length).split(' ');
if (message.mentions.users.first()) {
if (message.mentions.users.first().id === client.user.id) {
if (!args[1]) return;
if (args[1] === 'prefix') return message.channel.send(`My prefix here is: \`${prefix}\`.`);
if (args[1] === 'help') {
const command = client.commands.get("help");
return client.funcs.exe(message, args, client, prefix, command);
}
}
}
if (!message.content.startsWith(prefix)) return;
if (!args[0]) return;
const commandName = args[0].toLowerCase();
const command = client.commands.get(commandName) || client.commands.find(cmd => cmd.aliases && cmd.aliases.includes(commandName)) || client.commandAliases.get(commandName);
if (!command && message.content !== `${prefix}`) return;
client.funcs.exe(message, args, client, prefix, command);
}
}

53
events/ready.js Normal file
View File

@@ -0,0 +1,53 @@
module.exports = {
name: 'ready',
async execute(client) {
client.user.setActivity(`@${client.user.username} help | 🎶`, { type: 'LISTENING' });
client.user.setStatus('online');
console.log('- Activated -');
client.guilds.cache.forEach(guild => {
client.global.db.guilds[guild.id] = {
prefix: client.config.prefix,
defaultVolume: 50,
permissions: false,
premium: false,
dj: false,
djrole: null,
startPlaying: true
};
});
if(client.config.firebase.serviceAccount){
const remoteMusixGuildsData = await client.funcs.dbget('guilds', null, client);
const remoteMusixPlaylistsData = await client.funcs.dbget('playlists', null, client);
remoteMusixGuildsData.forEach(guildData => {
client.global.db.guilds[guildData.id] = guildData.d;
});
remoteMusixPlaylistsData.forEach(guildData => {
client.global.db.playlists[guildData.id] = guildData.d;
});
console.log('- DB Set -');
setInterval(async () => {
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,
premium: client.global.db.guilds[guild.id].premium,
dj: client.global.db.guilds[guild.id].dj,
djrole: client.global.db.guilds[guild.id].djrole,
startPlaying: client.global.db.guilds[guild.id].startPlaying
});
if (client.global.db.guilds[guild.id].premium) {
client.db.collection('playlists').doc(guild.id).set({
songs: client.global.db.playlists[guild.id].songs,
saved: client.global.db.playlists[guild.id].saved,
});
}
});
}, 1800000);
}
}
}

22
funcs/dbget.js Normal file
View File

@@ -0,0 +1,22 @@
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;
}
};

13
funcs/exe.js Normal file
View File

@@ -0,0 +1,13 @@
const { EmbedBuilder, PermissionFlagsBits } = require("discord.js");
module.exports = function (message, args, client, prefix, command) {
const permissions = message.channel.permissionsFor(message.client.user);
if (!permissions.has(PermissionFlagsBits.EmbedLinks)) return message.channel.send(':x: I cannot send embeds (Embed links), make sure I have the proper permissions!');
try {
command.uses++;
command.execute(message, args, client, prefix);
} catch (error) {
message.reply(`:x: there was an error trying to execute that command!`);
console.log(error);
}
};

53
funcs/handleVideo.js Normal file
View File

@@ -0,0 +1,53 @@
const { createAudioPlayer, getVoiceConnection, joinVoiceChannel, NoSubscriberBehavior } = require("@discordjs/voice");
module.exports = async function (video, message, voiceChannel, client, playlist = false) {
let song = {
id: video.id,
title: he.decode(video.title),
url: `https://www.youtube.com/watch?v=${video.id}`,
author: message.author
}
const serverQueue = client.queue.get(message.guild.id);
if (!serverQueue) {
const construct = {
textChannel: message.channel,
voiceChannel: voiceChannel,
connection: null,
audioPlayer: createAudioPlayer({
behaviors: {
noSubscriber: NoSubscriberBehavior.Play,
}
}),
songs: [],
volume: client.global.db.guilds[message.guild.id].defaultVolume,
playing: false,
paused: false,
looping: false,
votes: 0,
voters: [],
votesNeeded: null
};
construct.songs.push(song);
client.queue.set(message.guild.id, construct);
try {
const connection =
getVoiceConnection(voiceChannel.guild.id) ??
joinVoiceChannel({
channelId: voiceChannel.id,
guildId: voiceChannel.guild.id,
adapterCreator: voiceChannel.guild.voiceAdapterCreator
});
construct.connection = connection;
client.funcs.play(message.guild, construct.songs[0], client, message, 0, true);
} catch (error) {
client.queue.delete(message.guild.id);
console.log("Error with connecting to voice channel: " + error);
return message.channel.send(`:x: An error occured: ${error}`);
}
} else {
serverQueue.songs.push(song);
if (playlist) return undefined;
return message.channel.send(`:white_check_mark: **${song.title}** has been added to the queue!`);
}
return undefined;
}

11
funcs/msToTime.js Normal file
View File

@@ -0,0 +1,11 @@
module.exports = function msToTime(duration) {
var seconds = Math.floor((duration / 1000) % 60),
minutes = Math.floor((duration / (1000 * 60)) % 60),
hours = Math.floor((duration / (1000 * 60 * 60)) % 24);
hours = (hours < 10) ? "0" + hours : hours;
minutes = (minutes < 10) ? "0" + minutes : minutes;
seconds = (seconds < 10) ? "0" + seconds : seconds;
return `${hours}:${minutes}:${seconds}`;
}

48
funcs/play.js Normal file
View File

@@ -0,0 +1,48 @@
const { EmbedBuilder } = require('discord.js');
const { AudioPlayerStatus, createAudioResource } = require('@discordjs/voice');
const ytdl = require('ytdl-core');
module.exports = async function (guild, song, client, message, seek, play) {
const serverQueue = client.queue.get(guild.id);
if (!song) {
serverQueue.connection.destroy();
client.queue.delete(guild.id);
return;
}
serverQueue.audioPlayer
.on(AudioPlayerStatus.Idle, () => {
serverQueue.playing = false;
serverQueue.audioPlayer.removeAllListeners();
if (serverQueue.looping) {
serverQueue.songs.push(serverQueue.songs[0]);
}
serverQueue.songs.shift();
client.funcs.play(guild, serverQueue.songs[0], client, message);
})
.on('error', (error) => {
console.error(error)
});
const audioResource = createAudioResource(ytdl(song.url, { filter: "audio", highWaterMark: 1 << 25 }),{
inlineVolume: true
});
audioResource.volume.setVolume(serverQueue.volume / 100);
serverQueue.audioPlayer.play(audioResource);
serverQueue.audioResource = audioResource;
serverQueue.connection.subscribe(serverQueue.audioPlayer);
/*.playStream(ytdl(song.url, { filter: "audio", highWaterMark: 1 << 25 }), { seek: seek, bitrate: 1024, passes: 10, volume: 1 })*/
if (client.global.db.guilds[guild.id].startPlaying || play) {
let data = await Promise.resolve(ytdl.getInfo(serverQueue.songs[0].url));
let songtime = (data.length_seconds * 1000).toFixed(0);
const embed = new EmbedBuilder()
.setTitle(`:musical_note: Start playing: **${song.title}**`)
.setDescription(`Song duration: \`${client.funcs.msToTime(songtime)}\``)
.setColor("#b50002")
serverQueue.textChannel.send({ embeds: [embed] });
}
serverQueue.playing = true;
}

50
index.js Normal file
View File

@@ -0,0 +1,50 @@
const Discord = require('discord.js');
const MusicClient = require('./Client');
const client = new MusicClient({});
const fs = require('fs');
const commandFiles = fs.readdirSync('./commands/').filter(f => f.endsWith('.js'));
for (const file of commandFiles) {
const command = require(`./commands/${file}`);
command.uses = 0;
client.commands.set(command.name, command);
client.commandAliases.set(command.alias, command);
}
const eventFiles = fs.readdirSync('./events/').filter(f => f.endsWith('.js'));
for (const file of eventFiles) {
const event = require(`./events/${file}`);
client.events.set(event.name, event);
}
const playlistFiles = fs.readdirSync('./commands/playlist/').filter(f => f.endsWith('.js'));
for (const file of playlistFiles) {
const option = require(`./commands/playlist/${file}`);
client.playlistCmd.set(option.name, option);
}
const settingFiles = fs.readdirSync('./commands/settings/').filter(f => f.endsWith('.js'));
for (const file of settingFiles) {
const option = require(`./commands/settings/${file}`);
client.settingCmd.set(option.name, option);
}
client.on('ready', async () => {
const eventName = 'ready';
const event = client.events.get(eventName) || client.events.find(ent => ent.aliases && ent.aliases.includes(eventName));
event.execute(client);
});
client.on('messageCreate', message => {
const eventName = 'message';
const event = client.events.get(eventName) || client.events.find(ent => ent.aliases && ent.aliases.includes(eventName));
event.execute(client, message);
});
client.on('guildCreate', async (guild) => {
const eventName = 'guildcreate';
const event = client.events.get(eventName) || client.events.find(ent => ent.aliases && ent.aliases.includes(eventName));
event.execute(client, guild);
});
client.login(client.config.discord_api_token).catch(err => { console.log('- Failed To Login -> ' + err); });

3451
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

34
package.json Normal file
View File

@@ -0,0 +1,34 @@
{
"name": "musix-oss",
"version": "2.22.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "node index.js",
"start:dev": "nodemon"
},
"keywords": [],
"author": "Musix Org",
"license": "MIT",
"homepage": "https://https://github.com/musix-oss/musix",
"repository": {
"type": "git",
"url": "https://https://github.com/musix-oss/musix"
},
"dependencies": {
"discord.js": "^14.14.1",
"@discordjs/voice": "^0.16.1",
"@discordjs/opus": "^0.9.0",
"dotenv": "^16.4.5",
"firebase": "^10.8.1",
"firebase-admin": "^12.0.0",
"he": "^1.2.0",
"ms": "^2.1.3",
"request": "^2.88.2",
"simple-youtube-api": "^5.2.1",
"ytdl-core": "^4.11.5"
},
"devDependencies": {
"nodemon": "^3.1.0"
}
}