async def make_proof(event, proof_id): proof = await System.get_messages(Sibyl_logs, ids=proof_id) try: reason = re.search(r"(\*\*)?(Scan)? ?Reason:(\*\*)? (`([^`]*)`|.*)", proof.message) reason = reason.group(4) if reason.group(4) else reason.group(3) except BaseException: return "Invalid" try: message = re.search('(\*\*)?Target Message:(\*\*)? (.*)', proof.message, re.DOTALL).group(3) except BaseException: proof_id -= 1 proof = await System.get_messages(Sibyl_logs, ids=proof_id) if proof: if proof.media: return "Media" else: return False else: return False async with session.post('https://nekobin.com/api/documents', json={'content': message}) as r: paste = f"https://nekobin.com/{(await r.json())['result']['key']}" url = "https://del.dog/documents" async with session.post(url, data=message.encode("UTF-8")) as f: r = await f.json() url = f"https://del.dog/{r['key']}" return proof_string.format(proof_id=proof_id, reason=reason, paste=paste, url=url)
async def proof(event): msg = await System.send_message( event.chat_id, 'Connecting to archive for case file >>>>>') try: proof_id = int(event.text.split(' ', 1)[1]) except BaseException: await msg.edit('>>>>>The case file ID is invalid') return await msg.edit('Fetching msg details from case file ID <<<<<<<') proof = await System.get_messages(Sibyl_logs, ids=proof_id) try: reason = re.search(r"(\*\*)?Scan Reason:(\*\*)? (`([^`]*)`|.*)", proof.message) reason = reason.group(4) if reason.group(4) else reason.group(3) except BaseException: await msg.edit( '>>>>Unable to see the msg or the case file ID is not valid') return try: message = re.search('(\*\*)?Target Message:(\*\*)? (.*)', proof.message, re.DOTALL).group(3) except BaseException: proof_id -= 1 proof = await System.get_messages(Sibyl_logs, ids=proof_id) if proof: if proof.media: await msg.edit('Case file includes media -> Forwarding message' ) await proof.forward_to(event.chat_id) return else: await msg.edit(f"Error getting case file from ID {proof_id}") return else: await msg.edit(f" Failed to pull case file, Is the ID valid?") return async with session.post('https://nekobin.com/api/documents', json={'content': message}) as r: paste = f"https://nekobin.com/{(await r.json())['result']['key']}" url = "https://del.dog/documents" async with session.post(url, data=message.encode("UTF-8")) as f: r = await f.json() url = f"https://del.dog/{r['key']}" await msg.edit( proof_string.format(proof_id=proof_id, reason=reason, paste=paste, url=url))
async def make_proof(user): data = await get_gban(user) if not data: return False message = data.get('message') or '' async with session.post('https://nekobin.com/api/documents', json={'content': message}) as r: paste = f"https://nekobin.com/{(await r.json())['result']['key']}" url = "https://del.dog/documents" async with session.post(url, data=message.encode("UTF-8")) as f: r = await f.json() url = f"https://del.dog/{r['key']}" return proof_string.format(proof_id=data['proof_id'], reason=data['reason'], paste=paste, url=url)
async def make_proof(user: Union[str, int]): if isinstance(user, str) and user.startswith("#"): data = await get_gban_by_proofid(int(user.strip("#"))) else: data = await get_gban(int(user)) if not data: return False message = data.get("message") or "" async with session.post("https://nekobin.com/api/documents", json={"content": message}) as r: paste = f"https://nekobin.com/{(await r.json())['result']['key']}" url = "https://del.dog/documents" async with session.post(url, data=message.encode("UTF-8")) as f: r = await f.json() url = f"https://del.dog/{r['key']}" return proof_string.format(proof_id=data["proof_id"], reason=data["reason"], paste=paste, url=url)
async def proof(event): if event.from_id in SIBYL: msg = await System.send_message(event.chat_id, 'Trying to get Proof owo >>>>>') try: proof_id = int(event.text.split(' ', 1)[1]) except BaseException: await msg.edit('>>>>> Proof id is not valid') return await msg.edit('Fetching msg details from proof id <<<<<<<') proof = await System.get_messages(Sibyl_logs, ids=proof_id) try: reason = re.search(r"Scan Reason: (.*)", proof.message).group(1) except BaseException: await msg.edit('>>>>It looks like I cannot see the msg or the proof id is not valid') return try: message = re.search( 'Target Message: (.*)', proof.message, re.DOTALL) if message: message = message.group(1) except BaseException: proof_id -= 1 proof = await System.get_messages(Sibyl_logs, ids=proof_id) if proof: if proof.media: await msg.edit('Proof is media -> Forwarding message') await proof.forward_to(event.chat_id) return else: await msg.edit(f"Error getting proof from id {proof_id}") return else: await msg.edit(f" Failed to get proof, Is the proof id valid?") return async with session.post('https://nekobin.com/api/documents', json={'content': message}) as r: paste = f"https://nekobin.com/{(await r.json())['result']['key']}" url = "https://del.dog/documents" async with session.post(url, data=message.encode("UTF-8")) as f: r = await f.json() url = f"https://del.dog/{r['key']}" await msg.edit(proof_string.format(proof_id = proof_id, reason=reason, paste=paste, url=url))
async def proof(event): if event.from_id in SIBYL: msg = await System.send_message(event.chat_id, 'Trying to get Proof owo >>>>>') try: proof_id = int(event.text.split(' ', 1)[1]) except: await msg.edit('>>>>> Proof id is not valid') return await msg.edit('Fetching msg details from proof id <<<<<<<') proof = await System.get_messages(Sibyl_logs, ids=proof_id) try: reason = re.search(r"Scan Reason: (.*)", proof.message).group(1) except: await msg.edit( '>>>>It looks like I cannot see the msg or the proof id is not valid' ) return try: message = re.search('Target Message: (.*)', proof.message, re.DOTALL).group(1) except: if not message or message == "": proof_id -= 1 proof = await System.get_messages(Sibyl_logs, ids=proof_id) if proof: if proof.media: proof.forward_to(event.chat_id) else: await msg.edit( f"Error getting proof from id {proof_id}") return else: await msg.edit( f" Failed to get proof, Is the proof id valid?") return async with session.post('https://nekobin.com/api/documents', json={'content': message}) as r: paste = f"https://nekobin.com/{(await r.json())['result']['key']}" await msg.edit( f"**Proof from ID** - {proof_id} :\n**Reason**: {reason}\n**Message**: [Nekobin]({paste})" )