所以...我不知道该说些什么,我显然会很快
代码:
@bot.event
async def on_server_role_update(role, before, after):
print("[" + (colored("{}".format(role.server), 'blue')) + "] " + (colored("Role Updated: {0} >> {1}".format(before, after), 'yellow')))
错误:
TypeError: on_server_role_update() missing 1 positional argument: 'after'
你看到了吗?我有论点,但显示错误!
答案 0 :(得分:0)
on_server_role_update
应该有两个自变量:Role
before
和Role
after
。您为什么认为还有第三个role
参数?
@bot.event
async def on_server_role_update(before, after):
server_blue = colored(str(before.server), 'blue')
msg = "Role Updated: {0} >> {1}".format(before, after)
color_msg = colored(msg, 'yellow')
print("[{}] {}".format(server_blue, color_msg))