正如标题所问,有没有办法让机器人不在 PM 中工作,而仅在渠道中使用时才工作?
我现在所做的就是在我的@client.command 前面添加此声明
@client.command(pass_context=True)
async def profile(ctx):
if ctx.message.server == None:
pass
else:
# Code
Run Code Online (Sandbox Code Playgroud)
有没有更简单的方法来做到这一点?我读过可以对其使用全局检查,但我不确定如何实现。
编辑:我正在使用这个编码Commands Extension