Answer the question
In order to leave comments, you need to log in
The bot does not see spaces, what should I do?
I am writing an economic bot. The problem is that when I write -buy (something), if there are two words in the subject in the name, then the code does not react, it does not see. How to fix?
mainshop = [{"name":"Морской конек","price":1000,"description":"*******"},] - магазин
@client.command()
async def buy(ctx,item,amount = 1):
await open_account(ctx.author)
res = await buy_this(ctx.author,item,amount)
if not res[0]:
if res[1]==1:
await ctx.send("Этого нет в магазине")
return
if res[1]==2:
await ctx.send(f"У вас нет столько Коинов {amount} {item}")
return
await ctx.send(f"Вы купили {amount} {item}") - код отвечающий за покупку
Answer the question
In order to leave comments, you need to log in
https://discordpy.readthedocs.io/en/stable/ext/com...
from typing import Optional
...
@client.command()
async def buy(ctx, amount: Optional[int] = 1, *, item: str):
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question