dandln / TheEpicAudioStreamer

A Discord bot that streams audio from a local device to a voice channel.
MIT License
13 stars 0 forks source link

[ Feature Request ] Ability to add discord RPC & to Connect to external apps's rpc data! #13

Closed JoqniX closed 5 months ago

JoqniX commented 7 months ago

hello! its been a while! i've been using the bot alot it has helped alot! but i was wondering if it would be possible to add discord rpc to this? ofc custom one would be good. but i was more of looking towards if it would somehow will read/listen to external application's rpc stuff for example - for youtube music - https://github.com/th-ch/youtube-music , they have a discord rpc plugin. i was hopping if TEAS can somehow get that rpc info and run its own instance of rpc as well?

if this is possible then it builds a bridge to allow 2 types of rpc types - 1. custom rpcs , 2 - ability to read other application's rpc or connect to external app's plugin data or something!

i wonder for vlc and other media players there would be a rpc for it ig? so it would be good if its possible to connect to that!

or maybe just a lastfm integration will help alot ig? and for thumbnail or something ( if the above stuff is possible to connect to external apps somehow. then that would solve it ig? )

image

i tbh idk how the ytmusic app does the rpc stuff. since i dunno much bout coding. if possible could you take a lookie on their repo on how their rpc stuff works etc? maybe we can find a way to achieve this or so? ig?

do lmk if this is possible or not~ thank you ✨ hope you do enjoy your day ahead! happy Monday!

JoqniX commented 7 months ago

i did make sure to ask in the youtube-music's repo if this was possible ref - https://github.com/th-ch/youtube-music/discussions/1798

ArjixWasTaken commented 7 months ago

Cross posting my answer from the linked discussion:


You can have an arRPC server running locally! Sadly TheEpicAudioStreamer needs to support arRPC, which ain't hard to do.

They just have to listen for messages from ws://127.0.0.1:1337 and update the bot's rich presence based on them.


note: Discord desktop may conflict with arRPC, might need some testing.

ArjixWasTaken commented 7 months ago

Since this project looks stagnant (1 year of inactivity), I may make a PR later this day.

JoqniX commented 7 months ago

Thanks for crossposting! ✨️ and thank you for helping out~

dandln commented 7 months ago

Hi there!

Since this project looks stagnant (1 year of inactivity).

Now that's a little harsh @ArjixWasTaken :P Still very much here and keeping an eye on TEAS, I just didn't feel like there was much to do on it recently just waiting for it to either implode again because of a Discord API change or because someone reports a bug/requests a feature. :)

Rich Presence support definitely sounds interesting and a cool feature for the bot to have. I'm happy to read into it (and how DSharpPlus handles it) and add support for it to receive those RPC messages from arRPC. Might be a week or two though as I'm currently a little busy.

ArjixWasTaken commented 7 months ago

Oh that's great! Totally understandable, some projects don't need constant updates.

dandln commented 6 months ago

Just a small update here, this is still in the works and I was finally able to pick up the project again a couple of days ago. It will likely be another few weeks before I can release the new version as I'm trying to also get a couple of other (QoL) improvements in that I've had in mind for a while, but it's coming. :)

dandln commented 5 months ago

So kinda good news bad news situation here. The good news is that I finally managed to get everything done that I wanted to do before starting on this feature request and was excited to get going here.

The bad news is (and I probably should have researched this earlier) that, as it turns out, bots on Discord cannot use rich presence - it's a user feature only. Unless, @ArjixWasTaken you know more than I'm able to find here, you seemed to be confident that it was possible?

Again some good news is that as part of the other features I was working on, I already implemented the ability to define a custom activity that the bot will display ("Playing <whateveryouwant>"). And while it's not as pretty as a rich presence, this might be at least somewhat of a workaround. Mind that this is static and will not update at runtime unfortunately.

I'm happy to be told I'm wrong and that bots can in fact use rich presence, but otherwise I'll likely release the update as it is now over the next couple of days.

ArjixWasTaken commented 5 months ago

I also did not consider that, yikes! I am not familiar with the code-base here, but a self-bot (a bot using a real user account) would work fine.

The problem is, you may get that user account banned if discord decides to take action on it. (they rarely do)

(one more perk of self-bots is that they can stream videos as well, although you still have the risk of getting banned)

dandln commented 5 months ago

Thanks for your input! Yeah DSharpPlus does not support self-bots and I don't think that would be a good idea for this application anyway given that it would make it fairly volatile (and against ToS) for a relatively small benefit.

dandln commented 5 months ago

I've just released version 0.7.0 and will close this issue for now, but more than happy to revisit if the situation changes in the future.