所以我有这个命令,我只想在一次聊天中使用。我如何限制它在称为“一般”的聊天之外的其他聊天中工作。我有其他的命令,需要在所有的聊天中工作,所以我不能只是限制机器人烫发。
发布于 2020-05-02 00:03:29
您可以编写自己的check
from discord.ext import commands
bot = commands.Bot("!")
def in_channel(*channels):
def predicate(ctx):
return ctx.channel.id in channels
return commands.check(predicate)
@in_channel(channel_id)
@bot.command()
async def command_name(ctx, ...):
...
bot.run("token")
https://stackoverflow.com/questions/61551293
复制相似问题