Answer the question
In order to leave comments, you need to log in
The play function does not accept the url argument, what should I do?
Hello, I'm writing a discord music bot and I've run into a problem. I wrote the video queue and play code separately, and now I'm trying to combine them. To do this, I entered the url argument in brackets to def play, but it complains and displays an error
TypeError: play() missing 1 required keyword-only argument: 'url'
async def play(ctx, *, command = None, url):
Answer the question
In order to leave comments, you need to log in
Hey! I have a counter question: do you write play in the main file or in cog?
There are 2 solutions:
- First, if you have kogi
@commands.command()
async def play(self, ctx: commands.Context, url: str, *args: str):
'''Adds a song to the queue either by YouTube URL or YouTube Search.'''
@client.command()
async def play(ctx, url : str):
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question