我使此命令只能通过 ping 使用,但我不知道如何添加使用成员 ID 的机会。
这是我已经拥有的代码:
@Bot.command()
async def slap( ctx, member : discord.Member ):
emb = discord.Embed(title=None, description = f"For the whole chat there was a noise from a {ctx.author.mention} slap {member.mention} in the face!", color=0x3498db)
await ctx.send( embed = emb )
您可以使用guild.get_member(ID)
.
顺便说一句,您的命令也应该与 fullname#tag 一起使用,slap AZ#0573
而不是提及
@Bot.command()
async def slap(ctx, member_id:int):
member = ctx.guild.get_member(member_id)
emb = discord.Embed(title=None, description = f"For the whole chat there was a noise from a {ctx.author.mention} slap {member.mention} in the face!", color=0x3498db)
await ctx.send( embed = emb )
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句