Esempio n. 1
0
async def stats(ctx, *, name=''):
    """Get the stats of a character/crew or item"""
    if len(name) == 0:
        return
    # First try to find a character match
    # (skip this section if command was invoked with 'item'
    if ctx.invoked_with != 'item':
        if name.startswith('--raw '):
            name = re.sub('^--raw[ ]+', '', name)
            result = p.get_stats(name, embed=False, raw=True)
        else:
            result = p.get_stats(name, embed=False, raw=False)
        if result is not None:
            await ctx.send(result)
            found_match = True

    # Next try to find an item match
    if ctx.invoked_with != 'char':
        market_txt = mkt.get_item_stats(name)
        if market_txt is not None:
            await ctx.send(market_txt)
            found_match = True

    if found_match is False:
        await ctx.send('Could not find entry for "{}"'.format(name))
Esempio n. 2
0
async def stats(ctx, *, name=None):
    """Get the stats of a character/crew or item"""
    if name is None:
        await bot.say('Enter: {} [name]'.format(command_prefix +
                                                ctx.invoked_with))
        return

    # First try to find a character match
    # (skip this section if command was invoked with 'item'
    if ctx.invoked_with != 'item':
        # write_log('stats {}'.format(name), str(ctx.author), str(ctx.server))
        result = p.get_stats(name, embed=False)
        if result is not None:
            await ctx.send(result)
            found_match = True

    # Next try to find an item match
    # raw_text = mkt.load_item_design_raw()
    # item_lookup = mkt.parse_item_designs(raw_text)
    # market_txt = mkt.filter_item_designs(name, item_lookup, filter='stats')
    market_txt = mkt.get_item_stats(name)
    if market_txt is not None:
        await ctx.send(market_txt)
        found_match = True

    if found_match is False:
        await ctx.send('Could not find {}'.format(name))
Esempio n. 3
0
async def stats(ctx, *, name=None):
    if name is None:
        await bot.say('Enter: {}stats [name]'.format(command_prefix))
        return

    write_log(command_prefix + 'stats {}'.format(name), ctx)
    result = p.get_stats(name, embed=False)
    if result is None:
        await bot.say('Could not find {}'.format(name))
    else:
        await bot.say(result)
Esempio n. 4
0
async def stats(ctx, *, name=None):
    """Get the stats of a character/crew or item"""
    # First try to find a character match
    # (skip this section if command was invoked with 'item'
    if ctx.invoked_with != 'item':
        result = p.get_stats(name, embed=False)
        if result is not None:
            await ctx.send(result)
            found_match = True

    # Next try to find an item match
    if ctx.invoked_with != 'char':
        market_txt = mkt.get_item_stats(name)
        if market_txt is not None:
            await ctx.send(market_txt)
            found_match = True

    if found_match is False:
        await ctx.send('Could not find {}'.format(name))