You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I was wondering if there is any way to play the sound from a file attached by the user?
I don't see in the documentation mentioning any local source (for uploading a file to the server, and further playback), or the possibility to add a raw track (via discord.File.fb).
Hey if you have an attachment and the attachment still exists in the channel (E.g the message has not been deleted) you can use the url of the attachment to search tracks directly.
tracks: wavelink.Search=awaitwavelink.Playable.search(attachment.url)
# Rest of code...
If you have files on your server that you want to play you can pass, None to source= in the Playable.search()
tracks: wavelink.Search=awaitwavelink.Playable.search("local.mp3", source=None)
# Rest of code...
Activity
EvieePy commentedon Aug 20, 2024
Hey if you have an attachment and the attachment still exists in the channel (E.g the message has not been deleted) you can use the url of the attachment to search tracks directly.
If you have files on your server that you want to play you can pass,
Nonetosource=in thePlayable.search()