freyacodes / ukulele

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

Feature request: play uploaded file #51

Open AGSPhoenix opened 2 years ago

AGSPhoenix commented 2 years ago

A few users on my server want to be able to just post MP3s and have the bot play them out. It seems like a blank ::play call with the file attached would be a pretty simple way to do so.

Security considerations:

For a first implementation, it might be best to have the bot fetch the full file before playing (Maybe cap it at 100 MB for non-Discord links?). Some servers will disconnect clients downloading slowly, or won't support resuming a transfer, which would cut the playback off several minutes in. Not sure if Discord's CDN does this. Might not even be necessary? Could use some testing.

Freya, any objections to this functionality? Kinda toying with the idea of writing this up into a PR.

freyacodes commented 2 years ago

I believe that linking URLs will just attempt to play any audio the bot finds. This is done by streaming, which doesn't seem to be a common issue. Streaming also supports the use of internet radios.

Grabbing any attachment URL to use instead would be very easy.

The configuration properties you mentioned could also be implemented.