freyacodes / ukulele

Simple self-contained Discord music bot
MIT License
157 stars 75 forks source link

music bot stopped working(Fixed) #65

Closed Bogiano closed 1 year ago

Bogiano commented 1 year ago

bot connects but once you give it a command to play a song it disconnects seconds later then connects and disconnects again until you command it to stop and make it leave a discord channel. It was working perfectly but maybe discord is detecting it and is blocking from pulling requests.

jocull commented 1 year ago

Tracing this down with a tip-off from another dev (I don't know your Github username, but feel free to out yourself 😄)

I believe this traces back to some breaking changes in Discord API:

The suggestion involves bumping the version of https://github.com/DV8FromTheWorld/JDA but I do not know how possible this is or what kind of breaking changes or other side effects this will have.

For people using v5 (recommended), update to 5.0.0-beta.6 or later. The fix has been backported to v4 (legacy) with 4.4.1_353, however we recommend updating to v5 as soon as possible.

For context, Ukulele's master branch is set to 4.3.0_277: https://github.com/freyacodes/ukulele/blob/6f3d7042037a9b334b71f300d6a8638702354d41/build.gradle.kts#L22

Perhaps the 4.x version bump will work without issues? I do not know yet what an upgrade to 5.x will entail.

jocull commented 1 year ago

If you don't mind, it would be helpful to rename this issue with a more descriptive title, please 😄 Then other people can find it easier.

yardbro commented 1 year ago

Tracing this down with a tip-off from another dev (I don't know your Github username, but feel free to out yourself 😄)

I believe this traces back to some breaking changes in Discord API:

The suggestion involves bumping the version of https://github.com/DV8FromTheWorld/JDA but I do not know how possible this is or what kind of breaking changes or other side effects this will have.

For people using v5 (recommended), update to 5.0.0-beta.6 or later. The fix has been backported to v4 (legacy) with 4.4.1_353, however we recommend updating to v5 as soon as possible.

For context, Ukulele's master branch is set to 4.3.0_277:

https://github.com/freyacodes/ukulele/blob/6f3d7042037a9b334b71f300d6a8638702354d41/build.gradle.kts#L22

Perhaps the 4.x version bump will work without issues? I do not know yet what an upgrade to 5.x will entail.

;)

jocull commented 1 year ago

Thanks @yardbro 😄

jocull commented 1 year ago

Keeping up with the bit rot, a migration to JDA 5.x (beta at least) is not too bad. See https://github.com/jocull/ukulele/commit/dbd88c21d31596795307430573c202dcd9761bae

I have kept the master branch on my repo mirrored to this one, but if there is not a desire to maintain this repo I'll move forward with updating the mainline mine.

Frozen-byte commented 1 year ago

Thank you @jocull ! Is there any way to update the docker, too? I don't mind to use image: ghcr.io/jocull/ukulele:master as image, but that requires the CI/CD pipelines I guess.

jocull commented 1 year ago

@Frozen-byte I’ll have to look into configuring Docker for my fork. I think it’s fairly straightforward but I have not done it yet. Will try to get to it within the next few days 🙂

jocull commented 1 year ago

@Frozen-byte Please try https://github.com/jocull/ukulele/pkgs/container/ukulele/80500413?tag=aarch64

I know it's labeled as aarch64 but it's multi-arch - should work on AMD64 or ARM64. I am not sure if I did everything right, but I hope it works. I run this version on a Raspberry Pi 4 so it has a few adjustments for that.

Frozen-byte commented 1 year ago

@jocull you are my Hero, works like a charm 💯

zeyus commented 1 year ago

@jocull @Frozen-byte I've been running my own on a docker instance on my NAS (previously I was running it on a raspberry pi)

I just wanted to say first, thanks for your update @jocull it works great!

I’ll have to look into configuring Docker for my fork

I've set it up in mine, it's pretty easy you just need to set up the permissions and then update the build.yml for the github workflow to point to your repo instead of freyacodes/ukulele https://github.com/jocull/ukulele/blob/master/.github/workflows/build.yml#L30-L46

I'm happy to maintain my version for the moment, I actually built in the pending PRs that I found useful in this repo, so ukulele will time out after 10 minutes of being alone in a channel and disconnect, and I fixed some volume issues etc. (https://github.com/freyacodes/ukulele/pull/64, https://github.com/freyacodes/ukulele/pull/60, https://github.com/freyacodes/ukulele/pull/59, https://github.com/freyacodes/ukulele/pull/56, https://github.com/freyacodes/ukulele/pull/42)

I did not pull any changes from https://github.com/freyacodes/ukulele/pull/55/files, but it also looks good and would require little effort.

But if you want to maintain, then feel free to just pull in whatever from my repo and I can point to yours. I only did it because I especially wanted that leave on idle functionality.

Anyway, if you want to check it out my repo is here: https://github.com/zeyus/ukulele and the built package (now working with the changes in your diff https://github.com/jocull/ukulele/commit/dbd88c21d31596795307430573c202dcd9761bae thanks :heart:) https://github.com/zeyus/ukulele/pkgs/container/ukulele

I tried to cherry-pick your commit but I think our forks were too divergent, plus I needed to update the VoiceJonEvent and VoiceLeaveEvent to use the unified net.dv8tion.jda.api.events.guild.voice.GuildVoiceUpdateEvent with the event handler override fun onGuildVoiceUpdate(event: GuildVoiceUpdateEvent).

Finally, I'm considering over the next couple of months tinkering a little with this to change the ::<command> style to using slashcommands and reactions, so it could list the top 5 results of a search and people can click on the corresponding reaction to queue that track. Of course it needs to be thought out properly and made into something nice, but that's the one feature I miss from other bots (even though I use ukulele exclusively now), it's a pain having to stop what you're doing and tab out to youtube, search, etc...also would be nice if you could search yt by default and optionally search something else like soundcloud.

🤘

jocull commented 1 year ago

Thanks @zeyus 😄

I'm happy to maintain my version for the moment, I actually built in the pending PRs that I found useful in this repo, so ukulele will time out after 10 minutes of being alone in a channel and disconnect, and I fixed some volume issues etc. (https://github.com/freyacodes/ukulele/pull/64, https://github.com/freyacodes/ukulele/pull/60, https://github.com/freyacodes/ukulele/pull/59, https://github.com/freyacodes/ukulele/pull/56, https://github.com/freyacodes/ukulele/pull/42)

Those are helpful additions to have! I have been meaning to pull them myself so I will have to look into that. I didn't want to diverge too much for everyone who may not want the changes. Awesome to see that you got the JDA 5.x beta in there as well 😄

zeyus commented 1 year ago

I didn't want to diverge too much for everyone who may not want the changes.

Yeah fair enough, I forked the repo because I wanted to add those things (I mean, it's always an option to add new features and allow them to be configured as enabled or disabled), and of course add in the search / slash / reaction stuff. Also that the PRs haven't been merged in a couple of years :)

freyacodes commented 1 year ago

@jocull thank you for #66! Hopefully we can get a proper migration to v5