【发布时间】:2021-09-05 21:23:43
【问题描述】:
如果代码正确,我想制作一个机器人,让机器人邀请我访问特定服务器。 但它有错误。
这是我的代码:
@client.command()
async def invite(ctx, *, code):
if code == "12320001":
guild = "851841115896152084"
invite = await ctx.guild.create_invite(max_uses=1)
await ctx.send(f"Here's your invite : {invite}")
else:
await ctx.send(f"Code is wrong!")
和错误:
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'NoneType' object has no attribute 'create_invite'
【问题讨论】:
标签: python discord.py