因此,我尝试创建一个签入命令,该命令仅在特定服务器中工作,这取决于频道的组织方式。有没有办法检查命令运行的位置,如果不是来自这个特定的公会/服务器,就阻止它
我的命令我试图锁定一个特定的公会
@commands.command()
#something here to check guild?
async def checkin(self, ctx):
category = discord.utils.get(ctx.guild.categories, id=catID)
checkinem = discord.Embed(title='Realms Channels')
for channel in category.channels: # or text_channels or voice_channels
realm, emoji = channel.name.split('-')
checkinem.add_field(name=realm, value=emoji, inline=False)
checkinmsg = await ctx.send(embed=checkinem)
for channel in category.channels:
realm, emoji = channel.name.split('-')
await checkinmsg.add_reaction(emoji=emoji)
任何帮助都将不胜感激,再次感谢
您可以在命令开始时进行检查
如果你想要一个特定的公会,你也可以按照阿卜杜勒·阿齐兹的建议去做
相关问题 更多 >
编程相关推荐