我想巧妙地发布角色HOTS,如果“玩”中的用户是“风暴英雄”,但没有成功,虽然机器人没有显示错误该怎么办?
@client.event
async def on_member_update(before, after):
serverchannel = 'channel_id'
fileLFG = '{0}(LFG).txt'.format(before.id)
if os.path.exists(fileLFG):
with open(fileLFG, "r") as readFile:
LFG = int(readFile.read())
else:
with open(fileLFG, "w") as writeFile:
writeFile.write(str(0))
if after.game == 'Heroes of the Storm' and LFG == 1:
await client.add_roles(after, roleHOTS)