Reputation: 1
@commands.command()
@commands.cooldown(1,10,BucketType.user)
async def wiki(self,ctx,*,word):
def sum(arg):
definition = wikipedia.summary(arg,sentences=3,chars=1000)
return sum(word)
await ctx.send(sum)
I am making a Wiki command, it doesn't work as expected and responds with this:
Upvotes: 0
Views: 136
Reputation: 1413
That's because you are using sum
the wrong way. Instead of this:
await ctx.send(sum)
you have to do this:
await ctx.send(sum(word))
Also, why are you invoking the function from within itself? In sum
you should return definition
.
Try not to shadow the builtin sum
. You should rename the function to be get_definition
or something else instead.
Upvotes: 1