如何通过我的机器人在Discord上添加链接

时间:2018-12-07 06:21:31

标签: python hyperlink bots discord discord.py

每当用户输入#armory 角色名称时,我都希望机器人以一个链接来响应,以供用户单击。 我的代码是:-

@bot.command(pass_context=True)
async def armory(ctx, user: discord.Member):
    await bot.say("armory.warmane.com/search/{}".format(user.name))

因此,输入示例:#armory Darkmist

输出将是:armory.warmane.com/search/Darkmist

但是,这不是一个可点击的链接,我希望可以以某种方式实现它。

第二,有没有更好的方法来实现我刚刚编写的代码?如果是这样,将不胜感激任何投入。

1 个答案:

答案 0 :(得分:1)

您需要在链接的开头添加https://或http://。否则,discord只会忽略它,使其无法点击。