def convert(self, ctx, arg):
bot = ctx.bot
try:
guild_id = int(arg)
except ValueError:
def is_guild(g):
return arg.lower() == g.name.lower()
guild = discord.utils.find(is_guild, bot.guilds)
if guild is None:
raise commands.BadArgument('Guild not found')
return guild
guild = bot.get_guild(guild_id)
if guild is None:
raise commands.BadArgument('Guild not found')
return guild
评论列表
文章目录