如何在discord.py重写中“检查” channel 是否是私有(private)的, 我什至看到了类似的问题,但答案不起作用:<
最佳答案
检查 channel 是否是 PrivateChannel
的实例抽象基类:
from discord.abc import PrivateChannel
from discord.ext.commands import Bot
bot = Bot(command_prefix='!')
@bot.command()
async def isprivate(ctx):
await ctx.send(isinstance(ctx.channel, PrivateChannel))
bot.run("token")
关于python - 如果 channel 是私有(private)的,我怎么能得到 "check"呢?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52789414/