我正在使用discord.py的重写版本
代码:
log_channel_id = db.get_log_channel()
channel_id = db.get_channel()
log_channel = self.bot.get_channel(int(log_channel_id))
channel = self.bot.get_channel(int(channel_id))
status = get_status()
if status is False:
await log_channel.send('False!') #here
elif status is True:
await channel.send('True!') #and here i got SyntaxError: invalid syntax
在我的测试文件中,一切正常
test.py:
@commands.command()
async def test(self, ctx, channel_id):
channel = self.bot.get_channel(int(channel_id))
await channel.send('test!')
有什么想法吗?