Compare commits

..

No commits in common. "179e6c54554c9ad3919795102fcfb5e485556406" and "ca25d44b9ed6a2952136c1be2781e94902059ba0" have entirely different histories.

1 changed files with 6 additions and 13 deletions

View File

@ -174,13 +174,11 @@ async def get_cas(entity):
return f'- <b>XXX:</b> {html.escape(json.get("description", "XXX"))}' return f'- <b>XXX:</b> {html.escape(json.get("description", "XXX"))}'
async def get_spam_protection(entity): async def get_spam_protection(entity):
status = 500
try:
async with session.get(f'https://api.intellivoid.net/spamprotection/v1/lookup?query={entity}') as resp: async with session.get(f'https://api.intellivoid.net/spamprotection/v1/lookup?query={entity}') as resp:
status = resp.staus try:
json = await resp.json() json = await resp.json()
except BaseException as ex: except BaseException as ex:
return f'- <b>{status}:</b> {html.escape(type(ex).__name__)}: {html.escape(str(ex))}' return f'- <b>{resp.status}:</b> {html.escape(type(ex).__name__)}: {html.escape(str(ex))}'
if json['success']: if json['success']:
text = '' text = ''
if json['results']['private_telegram_id']: if json['results']['private_telegram_id']:
@ -210,13 +208,8 @@ async def get_spam_protection(entity):
async def get_sibyl(entity): async def get_sibyl(entity):
if not config['config'].get('sibyl_api'): if not config['config'].get('sibyl_api'):
return '- <b>404:</b> Missing sibyl api key' return '- <b>404:</b> Missing sibyl api key'
status = 500
try:
async with session.get(f'https://psychopass.animekaizoku.com/getInfo?token={config["config"]["sibyl_api"]}&userid={entity}') as resp: async with session.get(f'https://psychopass.animekaizoku.com/getInfo?token={config["config"]["sibyl_api"]}&userid={entity}') as resp:
status = resp.status
json = await resp.json() json = await resp.json()
except BaseException as ex:
return f'- <b>{status}:</b> {html.escape(type(ex).__name__)}: {html.escape(str(ex).replace(config["config"]["sibyl_api"], "<api key>"))}'
if json['error']: if json['error']:
return f'- <b>{json["error"]["code"]}:</b> {html.escape(json["error"]["message"])}' return f'- <b>{json["error"]["code"]}:</b> {html.escape(json["error"]["message"])}'
json = json['result'] json = json['result']