我正在尝试获取一个invite命令,但我想不出如何向服务器发送invite,该命令是在其中表示的。
示例:
用户:$invite
机器人:这是你的邀请链接(邀请链接)
发布于 2021-02-08 08:00:18
要创建邀请,您需要使用await create_invite。下面是一个如何使用它的例子。
@client.command()
async def invite(ctx):
link = await ctx.channel.create_invite(max_age = 300, max_uses=1) # all of these default to 0, aka forever
await ctx.send(f"Invite for {ctx.author.mention}: {link}")

另外,下次您提出问题时,请包含您已经尝试过的一些代码的minimal, reproducible example,谢谢。
发布于 2021-02-08 07:21:46
@client.command()
async def invite(ctx):
invite = "Put invite link here"
ctx.send(f"Here's your invite link: {invite}")只需创建一个永久的invite链接,并将其存储在一个变量中
https://stackoverflow.com/questions/66094074
复制相似问题