【发布时间】:2020-06-11 15:50:42
【问题描述】:
我正在尝试创建一个机器人命令,您可以在其中询问机器人是否是星期三,但我不断收到此错误,我不知道该怎么做。请帮忙。 这是我的代码:
@client.command(aliases=['wednesdaymydudes', 'wednesday', 'wednesdaycheck'],
pass_context=True)
async def isitwednesdaymydudes(ctx):
currentday = time.strftime('%A')
if currentday == 'Wednesday':
await ctx.send('It is Wednesday, {}'.format(ctx.message.author.mention))
else:
await ctx.send('It is not Wednesday, {}'.format(ctx.message.author.mention))
【问题讨论】:
-
你有另一个函数名为
time的命令吗?看起来有其他东西以该名称隐藏了 Python 模块(或者您尚未导入它)。
标签: python discord.py discord.py-rewrite