我有一个可用的 discord 机器人,它可以警告人们并将原因和他们的 ID 插入到数据库中。我想不通的是,在提到原因之后如何进行每个论点。
rediss://:password@host:port
一切正常,我只需要在用户提及后成为一切的理由
答案 0 :(得分:0)
您只需要在 *
之前添加一个 reason
参数:
@bot.command(name="warn")
async def warn(ctx, user: discord.User, *, reason):
uid = user.id
role = discord.utils.get(ctx.guild.roles, name="Staff")
if role in ctx.author.roles:
warn = await bot.db.create_warn(int(uid), reason)
embed = discord.Embed(title="Warned @"+str(uid), description=f"reason: {reason}", color=0x0c0f27)