async def convert(self, ctx, argument):
    attachments = ctx.message.attachments
    mentions = MENTION_REGEX.finditer(argument)
    matches = IMAGE_LINKS.finditer(argument)
    emojis = EMOJI_REGEX.finditer(argument)
    ids = ID_REGEX.finditer(argument)
    urls = []
    if matches:
        for match in matches:
            urls.append(match.group(1))
    if emojis:
        for emoji in emojis:
            ext = ('gif' if emoji.group(2) else 'png')
            url = 'https://cdn.discordapp.com/emojis/{id}.{ext}?v=1'.format(id=emoji.group(3), ext=ext)
            urls.append(url)
    if mentions:
        for mention in mentions:
            user = ctx.guild.get_member(int(mention.group(1)))
            if user.is_avatar_animated():
                url = IMAGE_LINKS.search(str(user.avatar_url_as(format='gif')))
            else:
                url = IMAGE_LINKS.search(str(user.avatar_url_as(format='png')))
            urls.append(url.group(1))
    if ((not urls) and ids):
        for possible_id in ids:
            user = ctx.guild.get_member(int(possible_id.group(0)))
            if user:
                if user.is_avatar_animated():
                    url = IMAGE_LINKS.search(str(user.avatar_url_as(format='gif')))
                else:
                    url = IMAGE_LINKS.search(str(user.avatar_url_as(format='png')))
                urls.append(url.group(1))
    if attachments:
        for attachment in attachments:
            urls.append(attachment.url)
    if (not urls):
        ctx.command.reset_cooldown(ctx)
        raise BadArgument(_('No images provided.'))
    return urls
async def convert(self, ctx, argument):
    attachments = ctx.message.attachments
    mentions = MENTION_REGEX.finditer(argument)
    matches = IMAGE_LINKS.finditer(argument)
    emojis = EMOJI_REGEX.finditer(argument)
    ids = ID_REGEX.finditer(argument)
    urls = []
    if matches:
        for match in matches:
            urls.append(match.group(1))
    if emojis:
        for emoji in emojis:
            ext = ('gif' if emoji.group(2) else 'png')
            url = 'https://cdn.discordapp.com/emojis/{id}.{ext}?v=1'.format(id=emoji.group(3), ext=ext)
            urls.append(url)
    if mentions:
        for mention in mentions:
            user = ctx.guild.get_member(int(mention.group(1)))
            if user.is_avatar_animated():
                url = IMAGE_LINKS.search(str(user.avatar_url_as(format='gif')))
            else:
                url = IMAGE_LINKS.search(str(user.avatar_url_as(format='png')))
            urls.append(url.group(1))
    if ((not urls) and ids):
        for possible_id in ids:
            user = ctx.guild.get_member(int(possible_id.group(0)))
            if user:
                if user.is_avatar_animated():
                    url = IMAGE_LINKS.search(str(user.avatar_url_as(format='gif')))
                else:
                    url = IMAGE_LINKS.search(str(user.avatar_url_as(format='png')))
                urls.append(url.group(1))
    if attachments:
        for attachment in attachments:
            urls.append(attachment.url)
    if (not urls):
        ctx.command.reset_cooldown(ctx)
        raise BadArgument(_('No images provided.'))
    return urls