我想自动删除嵌入的触发器,我该怎么做?
I want to delete the trigger of the embed automatically how do I do it?
例如。 trigger - hi ,bot 回复 hello 但我希望 bot 自动删除 trigger hi 。
async def cd(ctx, message=None):
embed=discord.Embed(description= " \n ", color=3092790)
embed.set_image(url= "cdn.discordapp.com/attachments/846254397210230806/…)
ctx.message.delete
await ctx.send(embed=embed)
这完全取决于您如何实现该触发器。例如,如果您使用 Discord.Bot.add_command
或使用 bot cogs 添加了该触发器,您只需调用 bot.remove_command(command_name). Or if you have added the trigger using
bot.add_listener[=12 即可删除该命令=]bot.remove_listener(函数,name_of_event)`.
不确定您是在寻找命令还是 OG 消息,如果是 OG 消息,您应该使用 ctx.message.delete
这是给你的 the doc。
欢迎使用堆栈,但首先您应该学习 How to Ask,向我们展示您的努力或您的代码。
例如。 trigger - hi ,bot 回复 hello 但我希望 bot 自动删除 trigger hi 。
async def cd(ctx, message=None):
embed=discord.Embed(description= " \n ", color=3092790)
embed.set_image(url= "cdn.discordapp.com/attachments/846254397210230806/…)
ctx.message.delete
await ctx.send(embed=embed)
这完全取决于您如何实现该触发器。例如,如果您使用 Discord.Bot.add_command
或使用 bot cogs 添加了该触发器,您只需调用 bot.remove_command(command_name). Or if you have added the trigger using
bot.add_listener[=12 即可删除该命令=]bot.remove_listener(函数,name_of_event)`.
不确定您是在寻找命令还是 OG 消息,如果是 OG 消息,您应该使用 ctx.message.delete
这是给你的 the doc。
欢迎使用堆栈,但首先您应该学习 How to Ask,向我们展示您的努力或您的代码。