Compare commits
2 Commits
ca25d44b9e
...
179e6c5455
Author | SHA1 | Date |
---|---|---|
|
179e6c5455 | |
|
3f04d08d1b |
|
@ -174,11 +174,13 @@ async def get_cas(entity):
|
|||
return f'- <b>XXX:</b> {html.escape(json.get("description", "XXX"))}'
|
||||
|
||||
async def get_spam_protection(entity):
|
||||
async with session.get(f'https://api.intellivoid.net/spamprotection/v1/lookup?query={entity}') as resp:
|
||||
try:
|
||||
status = 500
|
||||
try:
|
||||
async with session.get(f'https://api.intellivoid.net/spamprotection/v1/lookup?query={entity}') as resp:
|
||||
status = resp.staus
|
||||
json = await resp.json()
|
||||
except BaseException as ex:
|
||||
return f'- <b>{resp.status}:</b> {html.escape(type(ex).__name__)}: {html.escape(str(ex))}'
|
||||
except BaseException as ex:
|
||||
return f'- <b>{status}:</b> {html.escape(type(ex).__name__)}: {html.escape(str(ex))}'
|
||||
if json['success']:
|
||||
text = ''
|
||||
if json['results']['private_telegram_id']:
|
||||
|
@ -208,8 +210,13 @@ async def get_spam_protection(entity):
|
|||
async def get_sibyl(entity):
|
||||
if not config['config'].get('sibyl_api'):
|
||||
return '- <b>404:</b> Missing sibyl api key'
|
||||
async with session.get(f'https://psychopass.animekaizoku.com/getInfo?token={config["config"]["sibyl_api"]}&userid={entity}') as resp:
|
||||
json = await resp.json()
|
||||
status = 500
|
||||
try:
|
||||
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()
|
||||
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']:
|
||||
return f'- <b>{json["error"]["code"]}:</b> {html.escape(json["error"]["message"])}'
|
||||
json = json['result']
|
||||
|
|
Loading…
Reference in New Issue