【发布时间】:2020-05-06 18:42:33
【问题描述】:
@bot.event
async def on_member_join(ctx):
user1 = discord.Member
channel = bot.get_channel(654805249311375400)
embed= discord.Embed(title='Welcome to Kitty\'s Play Place <3', description='Welcome! We hope you enjoy your time at Kitty\'s play place {} \n ----------------------------------------------------------------------- \n Please check <#654820877304856606> to avoid any problems \n after please go to <#654806729162227743> and <#654806701123567616> \n To gain access to our chats, click the reaction in the channels mentioned above \n ----------------------------------------------------------------------- \n'. format(user1), colour=discord.Color.red())
embed.set_image(url='https://cdn.discordapp.com/attachments/654804320222707723/665897722213171205/ezgif-7-ec547b785e7d.gif')
await channel.send(embed=embed)
所以我有这段代码,奇怪的是它可以工作,除了用户 ping 显示为:
<class 'discord.member.Member'>
而不是username。
谁能告诉我该怎么做?
【问题讨论】:
-
你试过user.mention吗? discordpy.readthedocs.io/en/latest/…
-
我会把它放在哪里?
-
它现在给了我这个
-
究竟你认为
<class 'discord.member.Member'>会是什么,而不是现在的样子?
标签: python bots discord discord.py discord.py-rewrite