Remove SPB
This commit is contained in:
parent
d86c5a3a60
commit
d55a53a260
|
@ -50,7 +50,7 @@ DEAI_MODULE_CODES = {
|
||||||
"8": "Codename Gestapo"
|
"8": "Codename Gestapo"
|
||||||
}
|
}
|
||||||
|
|
||||||
@Client.on_message(~filters.scheduled & ~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['einfo', 'externalinfo', 'sw', 'spamwatch', 'deai', 'spb', 'spamprotection', 'cas', 'combot', 'rose', 'sibyl'], prefixes=config['config']['prefixes']))
|
@Client.on_message(~filters.scheduled & ~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['einfo', 'externalinfo', 'sw', 'spamwatch', 'deai', 'cas', 'combot', 'rose', 'sibyl'], prefixes=config['config']['prefixes']))
|
||||||
@log_errors
|
@log_errors
|
||||||
@public_log_errors
|
@public_log_errors
|
||||||
async def fedstat(client, message):
|
async def fedstat(client, message):
|
||||||
|
@ -62,13 +62,11 @@ async def fedstat(client, message):
|
||||||
elif not getattr(message.reply_to_message, 'empty', True):
|
elif not getattr(message.reply_to_message, 'empty', True):
|
||||||
reply = message.reply_to_message
|
reply = message.reply_to_message
|
||||||
entity = reply.from_user or reply.sender_chat or entity
|
entity = reply.from_user or reply.sender_chat or entity
|
||||||
if isinstance(entity, str) and (not entity.isnumeric() and not entity.startswith('TEL-')):
|
if isinstance(entity, str) and not entity.isnumeric():
|
||||||
entity, entity_client = await get_entity(client, entity)
|
entity, entity_client = await get_entity(client, entity)
|
||||||
if not isinstance(entity, str):
|
if not isinstance(entity, str):
|
||||||
entity = str(entity.id)
|
entity = str(entity.id)
|
||||||
if entity.startswith('TEL-') or int(entity) < 0 or command in ('spb', 'spamprotection'):
|
if command in ('sw', 'spamwatch'):
|
||||||
await message.reply_text(f'Spam Protection:\n{await get_spam_protection(entity)}', disable_web_page_preview=True)
|
|
||||||
elif command in ('sw', 'spamwatch'):
|
|
||||||
await message.reply_text(f'SpamWatch:\n{await get_spamwatch(entity)}', disable_web_page_preview=True)
|
await message.reply_text(f'SpamWatch:\n{await get_spamwatch(entity)}', disable_web_page_preview=True)
|
||||||
elif command == 'deai':
|
elif command == 'deai':
|
||||||
await message.reply_text(f'DEAI:\n{await get_deai(client, entity)}', disable_web_page_preview=True)
|
await message.reply_text(f'DEAI:\n{await get_deai(client, entity)}', disable_web_page_preview=True)
|
||||||
|
@ -79,7 +77,7 @@ async def fedstat(client, message):
|
||||||
elif command == 'sibyl':
|
elif command == 'sibyl':
|
||||||
await message.reply_text(f'Sibyl:\n{await get_sibyl(entity)}', disable_web_page_preview=True)
|
await message.reply_text(f'Sibyl:\n{await get_sibyl(entity)}', disable_web_page_preview=True)
|
||||||
else:
|
else:
|
||||||
spamwatch, deai, cas, spam_protection, rose, sibyl = await asyncio.gather(get_spamwatch(entity), get_deai(client, entity), get_cas(entity), get_spam_protection(entity), get_rose(client, entity), get_sibyl(entity))
|
spamwatch, deai, cas, rose, sibyl = await asyncio.gather(get_spamwatch(entity), get_deai(client, entity), get_cas(entity), get_rose(client, entity), get_sibyl(entity))
|
||||||
await message.reply_text(f'''SpamWatch:
|
await message.reply_text(f'''SpamWatch:
|
||||||
{spamwatch}
|
{spamwatch}
|
||||||
|
|
||||||
|
@ -92,9 +90,6 @@ Rose Support:
|
||||||
DEAI:
|
DEAI:
|
||||||
{deai}
|
{deai}
|
||||||
|
|
||||||
Spam Protection:
|
|
||||||
{spam_protection}
|
|
||||||
|
|
||||||
Sibyl:
|
Sibyl:
|
||||||
{sibyl}''', disable_web_page_preview=True)
|
{sibyl}''', disable_web_page_preview=True)
|
||||||
|
|
||||||
|
@ -173,40 +168,6 @@ async def get_cas(entity):
|
||||||
- <b>Offenses:</b> {json["result"]["offenses"]}'''
|
- <b>Offenses:</b> {json["result"]["offenses"]}'''
|
||||||
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):
|
|
||||||
status = 500
|
|
||||||
try:
|
|
||||||
async with session.get(f'https://api.intellivoid.net/spamprotection/v1/lookup?query={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))}'
|
|
||||||
if json['success']:
|
|
||||||
text = ''
|
|
||||||
if json['results']['private_telegram_id']:
|
|
||||||
text += f'- <b>PTID:</b> <code>' + json['results']['private_telegram_id'] + "</code>\n"
|
|
||||||
if json['results']['attributes']['intellivoid_accounts_verified']:
|
|
||||||
text += '- <b>Intellivoid Account Linked:</b> Yes\n'
|
|
||||||
if json['results']['attributes']['is_potential_spammer']:
|
|
||||||
text += '- <b>Potential Spammer:</b> Yes\n'
|
|
||||||
if json['results']['attributes']['is_operator']:
|
|
||||||
text += '- <b>Operator:</b> Yes\n'
|
|
||||||
if json['results']['attributes']['is_agent']:
|
|
||||||
text += '- <b>Agent:</b> Yes\n'
|
|
||||||
if json['results']['attributes']['is_whitelisted']:
|
|
||||||
text += '- <b>Whitelisted:</b> Yes\n'
|
|
||||||
text += f'- <b>Ham/Spam Prediction:</b> {json["results"]["spam_prediction"]["ham_prediction"] or 0}/{json["results"]["spam_prediction"]["spam_prediction"] or 0}'
|
|
||||||
if json['results']['language_prediction']['language']:
|
|
||||||
text += f'''\n- <b>Language Prediction:</b> {json["results"]["language_prediction"]["language"]}
|
|
||||||
- <b>Language Prediction Probability:</b> {json["results"]["language_prediction"]["probability"]}'''
|
|
||||||
if json['results']['attributes']['is_blacklisted']:
|
|
||||||
text += f'''\n- <b>Blacklist Flag:</b> {json["results"]["attributes"]["blacklist_flag"]}
|
|
||||||
- <b>Blacklist Reason:</b> {json["results"]["attributes"]["blacklist_reason"]}'''
|
|
||||||
if json['results']['attributes']['original_private_id']:
|
|
||||||
text += f'\n- <b>Original Private ID:</b> {json["results"]["attributes"]["original_private_id"]}'
|
|
||||||
return text
|
|
||||||
return f'- <b>{json["response_code"]}</b>: {json["error"]["error_code"]}: {json["error"]["type"]}: {html.escape(json["error"]["message"])}'
|
|
||||||
|
|
||||||
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'
|
||||||
|
@ -261,9 +222,5 @@ Aliases: {prefix}combot
|
||||||
{prefix}deai <i><user></i> - Get DEAI info of <i><user></i>
|
{prefix}deai <i><user></i> - Get DEAI info of <i><user></i>
|
||||||
{prefix}deai <i>(as reply to message)</i> - Get DEAI info of replied user
|
{prefix}deai <i>(as reply to message)</i> - Get DEAI info of replied user
|
||||||
|
|
||||||
{prefix}spamprotection <i><user></i> - Get Spam Protection info of <i><user></i>
|
|
||||||
{prefix}spamprotection <i>(as reply to message)</i> - Get Spam Protection info of replied user
|
|
||||||
Aliases: {prefix}spb'
|
|
||||||
|
|
||||||
{prefix}sibyl <i><user></i> - Get Sibyl's judgement of <i><user></i>
|
{prefix}sibyl <i><user></i> - Get Sibyl's judgement of <i><user></i>
|
||||||
{prefix}sibyl <i>(as reply to message)</i> - Get Sibyl's judement of the replied to user''')
|
{prefix}sibyl <i>(as reply to message)</i> - Get Sibyl's judement of the replied to user''')
|
||||||
|
|
Loading…
Reference in New Issue