Discord.py: 更改服务器名称

Discord.py: change server name

如何更改服务器名称?我正在尝试该代码,但出现错误(TypeError: edit() takes 1 positional argument but 4 were given)

await ctx.guild.edit(ctx.guild.name, None, "New name")

你能帮帮我吗?

由于 API Reference 你的第二个参数不是必需的,因为 reason 的默认值已经是 none.

试试看

await ctx.guild.edit("New name")

或者尝试将您的值附加到字典 ** 字段中所需的键,例如:

await ctx.guild.edit(name="New name")

以及必要时可用参数中的其他参数。