我想巧妙地发布HOTS这个角色

时间:2018-02-05 00:43:15

标签: python-3.x discord discord.py

我想巧妙地发布角色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)

0 个答案:

没有答案