コード例 #1
0
ファイル: evekills.py プロジェクト: ghoti/Rooster
 def _get_characer_id(name):
     api = evelink.eve.EVE()
     try:
         id = api.character_id_from_name(name=name)[0]
     except Exception:
         raise Exception("Alliance not found")
     return id
コード例 #2
0
ファイル: who.py プロジェクト: FwedditMk2/DiscordRooster
def who(toon):
    if not toon:
        return 'NEED A NAME WTF'

    api = evelink.eve.EVE()
    id = api.character_id_from_name(toon)

    if not id.result:
        return "Character not found"

    # There be dragons here
    try:
        # if this breaks, that means someone tried to who a corp, we can handle that
        name, corp, corpsince, alliance, secstatus, age = corpsheet(id, api)
        stats = killstats(id)

        lastseen = activity(id)

        if alliance:
            return "```{} (Born {})\n{} SecStatus with {}\nJoined {} {} ({})\nLast seen {}```".format(
                name, age, secstatus, stats, corp, corpsince, alliance,
                lastseen)
        else:
            return "```{} (Born {})\n{} SecStatus with {}\nJoined {} {}\nLast seen {}```".format(
                name, age, secstatus, stats, corp, corpsince, lastseen)
    except evelink.api.APIError:
        try:
            # and here we fail if we supplied an alliance name, oof
            name, ticker, alliance, desc, ceo, members = corpinfo(id)
            return "``` {} <{}>\n{}\nAlliance: {}\nCEO: {}\nMembers: {}```".format(
                name, ticker, desc, alliance, ceo, members)
        except evelink.api.APIError:
            return "Seems you supplied an alliance name, soonTM"
コード例 #3
0
ファイル: who.py プロジェクト: Marthalamule/DiscordRooster
def who(toon):

    if not toon:
        return 'NEED A NAME WTF'

    api = evelink.eve.EVE()
    id = api.character_id_from_name(toon)

    if not id.result:
        return "Character not found"

    # There be dragons here
    try:
        # if this breaks, that means someone tried to who a corp, we can handle that
        name, corp, corpsince, alliance, secstatus, age = corpsheet(id, api)
        stats = killstats(id)

        if alliance:
            return "```{} (Born {})\n{} SecStatus with {}\nJoined {} {} ({})```".format(
                    name, age, secstatus, stats, corp, corpsince, alliance)
        else:
            return "```{} (Born {})\n{} SecStatus with {}\nJoined {} {}```".format(
                    name, age, secstatus, stats, corp, corpsince)
    except evelink.api.APIError:
        try:
            #and here we fail if we supplied an alliance name, oof
            name, ticker, alliance, desc, ceo, members = corpinfo(id)
            return "``` {} <{}>\n{}\nAlliance: {}\nCEO: {}\nMembers: {}```".format(name, ticker, desc, alliance, ceo, members)
        except evelink.api.APIError:
            return "Seems you supplied an alliance name, soonTM"