python检测到虚荣url discord.py
我在机器人上制作了ServerInfo命令。因此,我要添加服务器信息命令也显示公会的虚荣心!但是我阅读了整个不和谐文档,但找不到如何使机器人检测虚荣URL并发送。然后,我尝试通过将该命令作为单个命令进行测试。这是我的代码:
@bot.command()
async def vanity(ctx):
vanity = str(ctx.guild.vanity_url)
await ctx.send(vanity)
机器人对代码没有响应。帮助您将不胜感激。提前致谢。
I am making a Serverinfo command on my bot. So i want add the server info command show the guild's vanity too! But I read the whole discord documentation but can't find how can i make the bot detect the vanity url and sends it. Then I tried to test by making that command as a single command. Here is my code:
@bot.command()
async def vanity(ctx):
vanity = str(ctx.guild.vanity_url)
await ctx.send(vanity)
The bot doesn't response with the code. A help will be appreciated. Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试此尝试获取虚荣url:
文档参考: https://discordpy.readthedocs.io/en/stable/api.html#discord.guild.guild.vanity_invite
Try this to get the vanity url:
Documentation reference: https://discordpy.readthedocs.io/en/stable/api.html#discord.Guild.vanity_invite