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
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"
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"