【发布时间】:2022-01-18 07:45:47
【问题描述】:
我正在尝试编写一个命令来向提到的用户发送消息。此命令仅适用于高级用户。但是,即使使用此命令的用户是高级用户,我的机器人仍然会说 '哎呀!此命令仅供高级用户使用。'。如何使这个命令起作用?
@client.command(aliases=['dm'])
async def message(ctx, member: discord.Member, description):
description = description
em=discord.Embed(title="You received a letter..", description=description, color=0xe9a9a9)
em.set_author(name=f"{ctx.author.name} ━ Message", icon_url=ctx.author.avatar_url)
em.set_footer(text="DM a Manager to report harrassment")
if ctx.author.id == "88877713685543985":
await member.send(embed=em)
await ctx.send(f"Your message has been delivered to {member.mention}!", embed=em)
return
else:
await ctx.send("Oops! This command is only available to premium users.")
return
【问题讨论】:
-
请不要在标题或问题正文中添加“固定”之类的内容。如果您设法解决了问题,那么要么接受帮助您解决问题的答案,要么在您的解决方案中发布您自己的答案并在超时后接受。