【发布时间】:2020-09-17 12:30:54
【问题描述】:
我希望我的机器人根据今天是哪一天说出某行代码。但是,这会导致问题,因为机器人甚至没有在 Discord 中编写任何内容。
async def schedule(ctx):
if x.strftime == "Wednesday":
await ctx.send(f""" Today is {x.strftime}. Today is a half day.
Today's Schedule:
Block 1: 7:25 - 8:25
Block 2: 8:30 - 9:30
Block 3: 9:35 - 10:35
Block 4: 10:40 - 11:40""")
elif x.strftime == "Monday" or x.strftime == "Tuesday" or x.strftime == "Thursday" or x.strftime == "Friday":
await ctx.send(f""" Today is {x.strftime}. Today is a full day.
Today's Schedule:
Block 1: 7:25 - 8:50
Block 2: 8:55 - 10:15
Block 3: 10:20 - 12:25
Block 4: 12:33 - 1:55""")
elif x.strftime == "Saturday" or x.strftime == "Sunday":
await ctx.send(f"Today is {x.strftime}. No school today.")
【问题讨论】:
-
x在哪里定义?你有任何追溯吗?试试我提供的解决方案,看看是否适合你。
标签: python discord.py