Voice Commands
Guide to creating Voice Channel related commands in Py-cord.
Last updated
Was this helpful?
Guide to creating Voice Channel related commands in Py-cord.
Last updated
Was this helpful?
This guide has been moved to . Please visit the new guide instead, since this one might be outdated.
The new guide looks better, has better explanations, and is way better overall.
To use voice commands, you need to update your library first -
First of all, we want to make a command that will make the bot join our VC.
When the user is not connected to a channel, the voice variable returns none. When it
Next, if the user is connected, we connect the the channel too, using await channel.connect()
Now, we have a problem. We left the VC, but our bot is stuck there. So, we need to make a leave command to make the bot leave the VC.
This command will make the bot leave ANY VC that it is in, as well as inform the user if the bot is not in a VC.
We can also make it necessary for the user to be in a Voice Channel to use this command, similar to the join command, but we don't want it, so lets not do it for now.
This is how you play local audio files.
Remember to replace Path and source with your own values.
Eg. C:\KMPlayer\ffmprg.exe for me. You can find the path through searching in file explorer on windows.
Its possible to so by using libraries such as YouTube-dl, however, downloading videos from YouTube is in breach of YouTube's Terms of Service, and the company could sue you.