Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed no audio bug + errors on unsupported platform #68

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
2 changes: 2 additions & 0 deletions .env.example
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ DISCORD_CLIENT_TOKEN=""
DISCORD_CLIENT_PUBKEY=""

DISCORD_GUILD_ID=""

DISCORD_CONTACT_PERSION_ID=""
Empty file modified .eslintrc.js
100644 → 100755
Empty file.
Empty file modified .github/workflows/deploy-image.yml
100644 → 100755
Empty file.
1 change: 1 addition & 0 deletions .gitignore
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ package-lock.json

# tests
test
notes.txt
Empty file modified .replit
100644 → 100755
Empty file.
Empty file modified .vscode/settings.json
100644 → 100755
Empty file.
Empty file modified Dockerfile
100644 → 100755
Empty file.
Empty file modified README.md
100644 → 100755
Empty file.
Empty file modified commands/back.js
100644 → 100755
Empty file.
Empty file modified commands/bassboost.js
100644 → 100755
Empty file.
Empty file modified commands/clear.js
100644 → 100755
Empty file.
Empty file modified commands/history.js
100644 → 100755
Empty file.
Empty file modified commands/jump.js
100644 → 100755
Empty file.
Empty file modified commands/loop.js
100644 → 100755
Empty file.
Empty file modified commands/np.js
100644 → 100755
Empty file.
Empty file modified commands/pause.js
100644 → 100755
Empty file.
8 changes: 8 additions & 0 deletions commands/play.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ module.exports = class extends SlashCommand {
const guild = client.guilds.cache.get(ctx.guildID);
const channel = guild.channels.cache.get(ctx.channelID);
const query = ctx.options.query;
let isLink = true;
let url;
try {
url = new URL(String(query));
} catch (_) {
isLink = false;
}
if (isLink && !String(query).includes("youtube.com") && !String(query).includes("youtu.be") && !String(query).includes("fb.watch") && !String(query).includes("fb.gg") && !String(query).includes("facebook.com") && !String(query).includes("vimeo.com")) return void ctx.sendFollowUp({ content: 'This bot only supports YouTube, Facebook and Vimeo!\nIf you think that this is an error please contact <@' + process.env.DISCORD_CONTACT_PERSION_ID + '>.' });
const searchResult = await client.player
.search(query, {
requestedBy: ctx.user,
Expand Down
Empty file modified commands/playnext.js
100644 → 100755
Empty file.
Empty file modified commands/queue.js
100644 → 100755
Empty file.
Empty file modified commands/remove.js
100644 → 100755
Empty file.
Empty file modified commands/resume.js
100644 → 100755
Empty file.
Empty file modified commands/seek.js
100644 → 100755
Empty file.
Empty file modified commands/shuffle.js
100644 → 100755
Empty file.
Empty file modified commands/skip.js
100644 → 100755
Empty file.
Empty file modified commands/stop.js
100644 → 100755
Empty file.
Empty file modified commands/volume.js
100644 → 100755
Empty file.
Empty file modified docs.js
100644 → 100755
Empty file.
Empty file modified events.js
100644 → 100755
Empty file.
Empty file modified index.js
100644 → 100755
Empty file.
4 changes: 3 additions & 1 deletion package.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
"discord-player": "^5.1.0",
"discord.js": "^13.1.0",
"dotenv": "^10.0.0",
"slash-create": "^4.0.1"
"opusscript": "^0.0.8",
"slash-create": "^4.0.1",
"ytdl-core": "^4.10.0"
},
"devDependencies": {
"eslint": "^7.32.0",
Expand Down
Empty file modified replit.nix
100644 → 100755
Empty file.
519 changes: 262 additions & 257 deletions yarn.lock
100644 → 100755

Large diffs are not rendered by default.