def convert(self, ctx, arg):
match = self._get_id_match(arg)
state = ctx._state
if match:
guild = ctx.bot.get_guild(int(match.group(1)))
if guild:
return guild
if self.case_sensitive:
guilds = [g for g in state._guilds.values() if g.name == arg]
else:
lowered = arg.lower()
guilds = [g for g in state._guilds.values() if g.name.lower() == lowered]
return await ctx.disambiguate(guilds)
# A mapping for the discord.py class and it's corresponding searcher.
评论列表
文章目录