So im trying to make a function that call other function like this
@command.command()
async def test1(self, ctx):
text = "hi john"
await test2(ctx, text)
@command.command()
async def test2(self, ctx, *, text):
await ctx.send(text)
it will say
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: test2() takes 2 positional arguments but 3 were given
and if i tried
@command.command()
async def test1(self, ctx):
text = "hi john"
await test2(text)
@command.command()
async def test2(self, ctx, *, text):
await ctx.send(text)
it will say
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: test11() missing 1 required keyword-only argument: 'num'
And if i remove the * from test2 so that it become
@command.command()
async def test1(self, ctx):
text = "hi john"
await test2(ctx, text)
@command.command()
async def test2(self, ctx, text):
await ctx.send(text)
then it will work perfectly fine.
Note: i need * arg on test2 so that when i type test2, it can receive input more than 1 word. But the problem appears when i use other function to call test2. Please help