【发布时间】:2021-05-02 08:25:01
【问题描述】:
我是 discord.py 的新手。
@bot.command(pass_context=True)
async def AddToDo(ctx, ToDoItem):
if(ctx.message.author.name not in ToDoList):
temporaryList.append(ToDoItem)
ToDoList[ctx.message.author.name] = temporaryList
await ctx.send(f"Successfully added {ToDoItem} to your To Do List!")
上面的代码工作正常。当用户键入不带参数的“$AddToDo”时,我想添加一条消息来纠正用户。我该怎么做?
注意:我的代码不包含类,但我可以添加一个。不过,我需要一些语法方面的帮助。
【问题讨论】:
标签: python discord.py