首页 > 解决方案 > discord.py 服务器模板

问题描述

所以我正在尝试创建一个创建模板的命令,代码:

@client.command()
async def template(ctx, name):
    await ctx.guild.create_template(name = name, description = None)
    await ctx.send('Done.')

每次使用此命令时,我都会收到此错误:

AttributeError: 'Guild' object has no attribute 'create_template'

标签: pythonpython-3.xdiscord.py

解决方案


  1. 你把'Guild'写成'guild'

  2. 的用法create_template:(await discord.Guild.create_template(*, name, description=None) 只是让你知道)


推荐阅读