有两件事不对:
有个问题
return
代码中使用的语句。
返回
出口
子程序,所以行
bot.send_message(bot.get_channel("534496148149370900"), mesg)
实际上从未被呼叫过。所以你的代码应该改成这样:
#---Report Command---#
@bot.command(pass_context=True)
async def report(ctx, reportedTag, reporterTag, *reasons):
if int(ctx.message.channel.id) == 416164062901305345:
reason = ' '.join(reasons)
await bot.delete_message(ctx.message)
mesg = "Report by "+ reporterTag + " for " + reportedTag + "Reason is: " + reason
await bot.send_message(bot.get_channel("534496148149370900"), mesg)
return await bot.say("Report recieved. Staff have been notified :)\nEnjoy your day and we'll take care of this")
else:
print ("Something went wrong")
除此之外,如果“出了问题”实际上是
输出的
也就是说
int(ctx.message.channel.id) == 416164062901305345
是假的。请检查你的身份证和你正在写的频道。