Skip to content

Commit

Permalink
add other packages for voice
Browse files Browse the repository at this point in the history
  • Loading branch information
andreidimaano committed Aug 25, 2021
1 parent f6c4c66 commit a7849d5
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,13 @@
"discord-api-types": "^0.22.0",
"discord.js": "^13.1.0",
"dotenv": "^8.2.0",
"ffmpeg": "^0.0.4",
"libsodium-wrappers": "^0.7.9",
"moment": "^2.29.1",
"momentjs": "^2.0.0",
"mongoose": "^5.11.9",
"node-cron": "^3.0.0",
"opusscript": "^0.0.8",
"prettier": "^2.3.2"
}
}
10 changes: 7 additions & 3 deletions src/commands/group.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const {
StreamType,
AudioPlayerStatus,
VoiceConnectionStatus,
generateDependencyReport
} = require("@discordjs/voice");
const moment = require("moment");

Expand Down Expand Up @@ -188,7 +189,8 @@ let intExe = async (interaction, options) => {
});

// YO
if (voice.channelId) {
if (voice.channel) {
console.log(generateDependencyReport());
let vc = voice.channel;
try {
await playSong();
Expand Down Expand Up @@ -299,18 +301,20 @@ let mesExe = async (options) => {
});

// YO
if (voice.channelId) {
if (voice.channel) {
console.log(generateDependencyReport());
let vc = voice.channel;
try {
await playSong();
const connection = await connectToChannel(vc);
connection.subscribe(player);
setTimeout(() => connection.destroy(), 4_000);
} catch (error) {
console.log("\n\nvoice could not play - error: ")
console.error(error);
}
} else {
console.log("voice could not play")
console.log("\n\nvoice could not play: channel ID not defined")
}

if (rest) {
Expand Down
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ const main = async () => {
return;
}
}

if(client.commands.get(command) === undefined) return;

await client.commands.get(command).execute(interaction, options);
} catch (error) {
Expand Down
17 changes: 17 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1769,6 +1769,13 @@ fb-watchman@^2.0.0:
dependencies:
bser "2.1.1"

ffmpeg@^0.0.4:
version "0.0.4"
resolved "https://registry.yarnpkg.com/ffmpeg/-/ffmpeg-0.0.4.tgz#1c460df8e7da5127f62ceef4bfa06c59c89630cb"
integrity sha1-HEYN+OfaUSf2LO70v6BsWciWMMs=
dependencies:
when ">= 0.0.1"

fill-range@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7"
Expand Down Expand Up @@ -3421,6 +3428,11 @@ optionator@^0.8.1:
type-check "~0.3.2"
word-wrap "~1.2.3"

opusscript@^0.0.8:
version "0.0.8"
resolved "https://registry.yarnpkg.com/opusscript/-/opusscript-0.0.8.tgz#00b49e81281b4d99092d013b1812af8654bd0a87"
integrity sha512-VSTi1aWFuCkRCVq+tx/BQ5q9fMnQ9pVZ3JU4UHKqTkf0ED3fKEPdr+gKAAl3IA2hj9rrP6iyq3hlcJq3HELtNQ==

ow@^0.27.0:
version "0.27.0"
resolved "https://registry.yarnpkg.com/ow/-/ow-0.27.0.tgz#d44da088e8184fa11de64b5813206f9f86ab68d0"
Expand Down Expand Up @@ -4738,6 +4750,11 @@ whatwg-url@^8.0.0:
tr46 "^2.0.2"
webidl-conversions "^6.1.0"

"when@>= 0.0.1":
version "3.7.8"
resolved "https://registry.yarnpkg.com/when/-/when-3.7.8.tgz#c7130b6a7ea04693e842cdc9e7a1f2aa39a39f82"
integrity sha1-xxMLan6gRpPoQs3J56Hyqjmjn4I=

which-module@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a"
Expand Down

0 comments on commit a7849d5

Please sign in to comment.