机器人能否使用YAGPDB:xyz的“警告”命令

2024-04-18 05:40:18 发布

您现在位置:Python中文网/ 问答频道 /正文

如果我键入命令,我想让我的bot(用discord.py编码)通过YAGPDB.xyz警告某人

这个想法突然出现在我的脑海里,我被这个想法困住了,这个命令工作得很好,但它没有警告他们。我不知道机器人是否不能使用警告命令,或者这是另一个问题

这是我的代码:

@bot.command()
@commands.has_any_role("ADMIN")
async def w(ctx, person, reason="No usar el canal correcto"):
    await bot.get_channel(ach).send(f"""-warn {person} {reason}""")
    await ctx.channel.purge(limit=1)
    time.sleep(1)
    await ctx.send(f"""{ctx.author.mention} Le he warneado :)""")
    await bot.get_channel(ach).send(f"""-warnings {person}""")
    time.sleep(5)
    await ctx.channel.purge(limit=1)

提前谢谢


Tags: 命令send警告gettimebotchannelsleep