async def gethash(hash_q): hashtxt_ = hash_q.pattern_match.group(1) hashtxt = open("hashdis.txt", "w+") hashtxt.write(hashtxt_) hashtxt.close() md5 = runapp(["md5sum", "hashdis.txt"], stdout=PIPE) md5 = md5.stdout.decode() sha1 = runapp(["sha1sum", "hashdis.txt"], stdout=PIPE) sha1 = sha1.stdout.decode() sha256 = runapp(["sha256sum", "hashdis.txt"], stdout=PIPE) sha256 = sha256.stdout.decode() sha512 = runapp(["sha512sum", "hashdis.txt"], stdout=PIPE) runapp(["rm", "hashdis.txt"], stdout=PIPE) sha512 = sha512.stdout.decode() ans = ("Text: `" + hashtxt_ + "`\nMD5: `" + md5 + "`SHA1: `" + sha1 + "`SHA256: `" + sha256 + "`SHA512: `" + sha512[:-1] + "`") if len(ans) > 4096: hashfile = open("hashes.txt", "w+") hashfile.write(ans) hashfile.close() await hash_q.client.send_file( hash_q.chat_id, "hashes.txt", reply_to=hash_q.id, caption="`Çox böyük, əvəzinə mətn faylı göndərir. `") runapp(["rm", "hashes.txt"], stdout=PIPE) else: await hash_q.reply(ans)
async def gethash(hash_q): """ Untuk perintah .hash, temukan md5, sha1, sha256, sha512 dari string tersebut. """ hashtxt_ = hash_q.pattern_match.group(1) hashtxt = open("hashdis.txt", "w+") hashtxt.write(hashtxt_) hashtxt.close() md5 = runapp(["md5sum", "hashdis.txt"], stdout=PIPE) md5 = md5.stdout.decode() sha1 = runapp(["sha1sum", "hashdis.txt"], stdout=PIPE) sha1 = sha1.stdout.decode() sha256 = runapp(["sha256sum", "hashdis.txt"], stdout=PIPE) sha256 = sha256.stdout.decode() sha512 = runapp(["sha512sum", "hashdis.txt"], stdout=PIPE) runapp(["rm", "hashdis.txt"], stdout=PIPE) sha512 = sha512.stdout.decode() ans = ("Text: `" + hashtxt_ + "`\nMD5: `" + md5 + "`SHA1: `" + sha1 + "`SHA256: `" + sha256 + "`SHA512: `" + sha512[:-1] + "`") if len(ans) > 4096: hashfile = open("hashes.txt", "w+") hashfile.write(ans) hashfile.close() await hash_q.client.send_file( hash_q.chat_id, "hashes.txt", reply_to=hash_q.id, caption= "`Ini terlalu besar, sebagai gantinya saya mengirim file teks. `", ) runapp(["rm", "hashes.txt"], stdout=PIPE) else: await hash_q.reply(ans)
async def gethash(hash_q): """ For .hash command, find the md5, sha1, sha256, sha512 of the string. """ hashtxt_ = hash_q.pattern_match.group(1) hashtxt = open("hashdis.txt", "w+") hashtxt.write(hashtxt_) hashtxt.close() md5 = runapp(["md5sum", "hashdis.txt"], stdout=PIPE) md5 = md5.stdout.decode() sha1 = runapp(["sha1sum", "hashdis.txt"], stdout=PIPE) sha1 = sha1.stdout.decode() sha256 = runapp(["sha256sum", "hashdis.txt"], stdout=PIPE) sha256 = sha256.stdout.decode() sha512 = runapp(["sha512sum", "hashdis.txt"], stdout=PIPE) runapp(["rm", "hashdis.txt"], stdout=PIPE) sha512 = sha512.stdout.decode() ans = ("Text: `" + hashtxt_ + "`\nMD5: `" + md5 + "`SHA1: `" + sha1 + "`SHA256: `" + sha256 + "`SHA512: `" + sha512[:-1] + "`") if len(ans) > 4096: hashfile = open("hashes.txt", "w+") hashfile.write(ans) hashfile.close() await hash_q.client.send_file( hash_q.chat_id, "hashes.txt", reply_to=hash_q.id, caption="`It's too big, sending a text file instead. `", ) runapp(["rm", "hashes.txt"], stdout=PIPE) else: await hash_q.reply(ans)
async def gethash(hash_q): """ .hash komutu md5, sha1, sha256, sha512 dizelerini bulur. """ hashtxt_ = hash_q.pattern_match.group(1) hashtxt = open("hashdis.txt", "w+") hashtxt.write(hashtxt_) hashtxt.close() md5 = runapp(["md5sum", "hashdis.txt"], stdout=PIPE) md5 = md5.stdout.decode() sha1 = runapp(["sha1sum", "hashdis.txt"], stdout=PIPE) sha1 = sha1.stdout.decode() sha256 = runapp(["sha256sum", "hashdis.txt"], stdout=PIPE) sha256 = sha256.stdout.decode() sha512 = runapp(["sha512sum", "hashdis.txt"], stdout=PIPE) runapp(["rm", "hashdis.txt"], stdout=PIPE) sha512 = sha512.stdout.decode() ans = ("Text: `" + hashtxt_ + "`\nMD5: `" + md5 + "`SHA1: `" + sha1 + "`SHA256: `" + sha256 + "`SHA512: `" + sha512[:-1] + "`") if len(ans) > 4096: hashfile = open("hashes.txt", "w+") hashfile.write(ans) hashfile.close() await hash_q.client.send_file( hash_q.chat_id, "hashes.txt", reply_to=hash_q.id, caption="`Çok büyük, bunun yerine bir metin dosyası gönderiliyor. `" ) runapp(["rm", "hashes.txt"], stdout=PIPE) else: await hash_q.reply(ans)
async def hash(e): if not e.text[0].isalpha() and e.text[0] not in ("/", "#", "@", "!"): hashtxt_ = e.pattern_match.group(1) hashtxt = open("hashdis.txt", "w+") hashtxt.write(hashtxt_) hashtxt.close() md5 = runapp(["md5sum", "hashdis.txt"], stdout=PIPE) md5 = md5.stdout.decode() sha1 = runapp(["sha1sum", "hashdis.txt"], stdout=PIPE) sha1 = sha1.stdout.decode() sha256 = runapp(["sha256sum", "hashdis.txt"], stdout=PIPE) sha256 = sha256.stdout.decode() sha512 = runapp(["sha512sum", "hashdis.txt"], stdout=PIPE) runapp(["rm", "hashdis.txt"], stdout=PIPE) sha512 = sha512.stdout.decode() ans = ("Text: `" + hashtxt_ + "`\nMD5: `" + md5 + "`SHA1: `" + sha1 + "`SHA256: `" + sha256 + "`SHA512: `" + sha512[:-1] + "`") if len(ans) > 4096: f = open("hashes.txt", "w+") f.write(ans) f.close() await e.client.send_file( e.chat_id, "hashes.txt", reply_to=e.id, caption="`It's too big, in a text file and hastebin instead. `" + hastebin.post(ans[1:-1]), ) runapp(["rm", "hashes.txt"], stdout=PIPE) else: await e.reply(ans)
async def gethash(hash_q): """ For .hash command, find the md5, sha1, sha256, sha512 of the string. """ hashtxt_ = hash_q.pattern_match.group(1) with open("hashdis.txt", "w+") as hashtxt: hashtxt.write(hashtxt_) md5 = runapp(["md5sum", "hashdis.txt"], stdout=PIPE) md5 = md5.stdout.decode() sha1 = runapp(["sha1sum", "hashdis.txt"], stdout=PIPE) sha1 = sha1.stdout.decode() sha256 = runapp(["sha256sum", "hashdis.txt"], stdout=PIPE) sha256 = sha256.stdout.decode() sha512 = runapp(["sha512sum", "hashdis.txt"], stdout=PIPE) runapp(["rm", "hashdis.txt"], stdout=PIPE) sha512 = sha512.stdout.decode() ans = ("Text: `" + hashtxt_ + "`\nMD5: `" + md5 + "`SHA1: `" + sha1 + "`SHA256: `" + sha256 + "`SHA512: `" + sha512[:-1] + "`") if len(ans) > 4096: with open("hashes.txt", "w+") as hashfile: hashfile.write(ans) await hash_q.client.send_file( hash_q.chat_id, "hashes.txt", reply_to=hash_q.id, caption="`É muito grande, enviando um arquivo de texto. `", ) runapp(["rm", "hashes.txt"], stdout=PIPE) else: await hash_q.reply(ans)
async def gethash(hash_q): """ Untuk perintah .hash, temukan md5, sha1, sha256, sha512 dari string tersebut. """ hashtxt_ = hash_q.pattern_match.group(1) hashtxt = open("hashdis.txt", "w+") hashtxt.write(hashtxt_) hashtxt.close() md5 = runapp(["md5sum", "hashdis.txt"], stdout=PIPE) md5 = md5.stdout.decode() sha1 = runapp(["sha1sum", "hashdis.txt"], stdout=PIPE) sha1 = sha1.stdout.decode() sha256 = runapp(["sha256sum", "hashdis.txt"], stdout=PIPE) sha256 = sha256.stdout.decode() sha512 = runapp(["sha512sum", "hashdis.txt"], stdout=PIPE) runapp(["rm", "hashdis.txt"], stdout=PIPE) sha512 = sha512.stdout.decode() ans = ("Text: **" + hashtxt_ + "**\nMD5: **" + md5 + "**SHA1: **" + sha1 + "**SHA256: **" + sha256 + "**SHA512: **" + sha512[:-1] + "**") if len(ans) > 4096: hashfile = open("hashes.txt", "w+") hashfile.write(ans) hashfile.close() await hash_q.client.send_file( hash_q.chat_id, "hashes.txt", reply_to=hash_q.id, caption= "**Teks terlalu banyak, jika ingin melihatnya buka file** `hashes.txt`", ) runapp(["rm", "hashes.txt"], stdout=PIPE) else: await hash_q.reply(ans)
async def gethash(hash_q): if hash_q.fwd_from: return event = await eor(hash_q, "Processing...") hashtxt_ = hash_q.pattern_match.group(1) hashtxt = open("hashdis.txt", "w+") hashtxt.write(hashtxt_) hashtxt.close() md5 = runapp(["md5sum", "hashdis.txt"], stdout=PIPE) md5 = md5.stdout.decode() sha1 = runapp(["sha1sum", "hashdis.txt"], stdout=PIPE) sha1 = sha1.stdout.decode() sha256 = runapp(["sha256sum", "hashdis.txt"], stdout=PIPE) sha256 = sha256.stdout.decode() sha512 = runapp(["sha512sum", "hashdis.txt"], stdout=PIPE) runapp(["rm", "hashdis.txt"], stdout=PIPE) sha512 = sha512.stdout.decode() ans = ("Text: `" + hashtxt_ + "`\nMD5: `" + md5 + "`SHA1: `" + sha1 + "`SHA256: `" + sha256 + "`SHA512: `" + sha512[:-1] + "`") if len(ans) > 4096: hashfile = open("hashes.txt", "w+") hashfile.write(ans) hashfile.close() await hash_q.client.send_file( hash_q.chat_id, "hashes.txt", reply_to=hash_q.id, caption="`It's too big, sending a text file instead. `", ) runapp(["rm", "hashes.txt"], stdout=PIPE) else: await hash_q.reply(ans) await event.delete()
async def gethash(hash_q): if hash_q.fwd_from: return hashtxt_ = "".join(hash_q.text.split(maxsplit=1)[1:]) with open("hashdis.txt", "w+") as hashtxt: hashtxt.write(hashtxt_) md5 = runapp(["md5sum", "hashdis.txt"], stdout=PIPE) md5 = md5.stdout.decode() sha1 = runapp(["sha1sum", "hashdis.txt"], stdout=PIPE) sha1 = sha1.stdout.decode() sha256 = runapp(["sha256sum", "hashdis.txt"], stdout=PIPE) sha256 = sha256.stdout.decode() sha512 = runapp(["sha512sum", "hashdis.txt"], stdout=PIPE) runapp(["rm", "hashdis.txt"], stdout=PIPE) sha512 = sha512.stdout.decode() ans = f"**Text : **\ \n__{hashtxt_}__\ \n**MD5 : **__\ \n__{md5}__\ \n**SHA1 : **__\ \n__{sha1}__\ \n**SHA256 : **__\ \n__{sha256}__\ \n**SHA512 : **__\ \n__{sha512[:-1]}__\ " await edit_or_reply(hash_q, ans)
async def gethash(hash_q): "Find the md5, sha1, sha256, sha512 of the string when written into a txt file." hashtxt_ = "".join(hash_q.text.split(maxsplit=1)[1:]) with open("hashdis.txt", "w+") as hashtxt: hashtxt.write(hashtxt_) md5 = runapp(["md5sum", "hashdis.txt"], stdout=PIPE) md5 = md5.stdout.decode() sha1 = runapp(["sha1sum", "hashdis.txt"], stdout=PIPE) sha1 = sha1.stdout.decode() sha256 = runapp(["sha256sum", "hashdis.txt"], stdout=PIPE) sha256 = sha256.stdout.decode() sha512 = runapp(["sha512sum", "hashdis.txt"], stdout=PIPE) runapp(["rm", "hashdis.txt"], stdout=PIPE) sha512 = sha512.stdout.decode() ans = f"**Text : **\ \n`{hashtxt_}`\ \n**MD5 : **`\ \n`{md5}`\ \n**SHA1 : **`\ \n`{sha1}`\ \n**SHA256 : **`\ \n`{sha256}`\ \n**SHA512 : **`\ \n`{sha512[:-1]}`\ " await edit_or_reply(hash_q, ans)
async def gethash(hash_q): """ .hash komutu md5, sha1, sha256, sha512 dizelerini bulur. """ hashtxt_ = extract_args(hash_q) if len(hashtxt_) < 1: await hash_q.edit("`Komutun yanına bir metin yazın.`") return hashtxt = open("hashdis.txt", "w+") hashtxt.write(hashtxt_) hashtxt.close() md5 = runapp(["md5sum", "hashdis.txt"], stdout=PIPE) md5 = md5.stdout.decode() sha1 = runapp(["sha1sum", "hashdis.txt"], stdout=PIPE) sha1 = sha1.stdout.decode() sha256 = runapp(["sha256sum", "hashdis.txt"], stdout=PIPE) sha256 = sha256.stdout.decode() sha512 = runapp(["sha512sum", "hashdis.txt"], stdout=PIPE) runapp(["rm", "hashdis.txt"], stdout=PIPE) sha512 = sha512.stdout.decode() def rem_filename(st): return st[:st.find(' ')] ans = (f"Text: `{hashtxt_}`" f"\nMD5: `{rem_filename(md5)}`" f"\nSHA1: `{rem_filename(sha1)}`" f"\nSHA256: `{rem_filename(sha256)}`" f"\nSHA512: `{rem_filename(sha512)}`") if len(ans) > 4096: hashfile = open("hashes.txt", "w+") hashfile.write(ans) hashfile.close() await hash_q.client.send_file( hash_q.chat_id, "hashes.txt", reply_to=hash_q.id, caption="`Çok büyük, bunun yerine bir metin dosyası gönderiliyor. `" ) runapp(["rm", "hashes.txt"], stdout=PIPE) hash_q.delete() else: await hash_q.edit(ans)
def hash(message): hashtxt_ = extract_args(message) if len(hashtxt_) < 1: edit(message, '`Komutun yanına bir metin yazın.`') return hashtxt = open("hash.txt", "w+") hashtxt.write(hashtxt_) hashtxt.close() md5 = runapp(["md5sum", "hash.txt"], stdout=PIPE) md5 = md5.stdout.decode() sha1 = runapp(["sha1sum", "hash.txt"], stdout=PIPE) sha1 = sha1.stdout.decode() sha256 = runapp(["sha256sum", "hash.txt"], stdout=PIPE) sha256 = sha256.stdout.decode() sha512 = runapp(["sha512sum", "hash.txt"], stdout=PIPE) runapp(["rm", "hash.txt"], stdout=PIPE) sha512 = sha512.stdout.decode() def rem_filename(st): return st[:st.find(' ')] ans = (f"Text: `{hashtxt_}`" f"\nMD5: `{rem_filename(md5)}`" f"\nSHA1: `{rem_filename(sha1)}`" f"\nSHA256: `{rem_filename(sha256)}`" f"\nSHA512: `{rem_filename(sha512)}`") if len(ans) > 4096: hashfile = open("hash.txt", "w+") hashfile.write(ans) hashfile.close() reply_doc(message, "hash.txt", caption='`Çok büyük, bunun yerine bir metin dosyası gönderiliyor. `') runapp(["rm", "hash.txt"], stdout=PIPE) message.delete() else: edit(message, ans)
def hash(message): hashtxt_ = extract_args(message) if len(hashtxt_) < 1: edit(message, f'`{get_translation("wrongCommand")}`') return hashtxt = open('hash.txt', 'w+') hashtxt.write(hashtxt_) hashtxt.close() md5 = runapp(['md5sum', 'hash.txt'], stdout=PIPE) md5 = md5.stdout.decode() sha1 = runapp(['sha1sum', 'hash.txt'], stdout=PIPE) sha1 = sha1.stdout.decode() sha256 = runapp(['sha256sum', 'hash.txt'], stdout=PIPE) sha256 = sha256.stdout.decode() sha512 = runapp(['sha512sum', 'hash.txt'], stdout=PIPE) runapp(['rm', 'hash.txt'], stdout=PIPE) sha512 = sha512.stdout.decode() def rem_filename(st): return st[:st.find(' ')] ans = (f'Text: `{hashtxt_}`' f'\nMD5: `{rem_filename(md5)}`' f'\nSHA1: `{rem_filename(sha1)}`' f'\nSHA256: `{rem_filename(sha256)}`' f'\nSHA512: `{rem_filename(sha512)}`') if len(ans) > 4096: hashfile = open('hash.txt', 'w+') hashfile.write(ans) hashfile.close() reply_doc(message, 'hash.txt', caption=f'`{get_translation("outputTooLarge")}`') runapp(['rm', 'hash.txt'], stdout=PIPE) message.delete() else: edit(message, ans)
async def inline_id_handler(event: events.InlineQuery.Event): builder = event.builder me = await client.get_me() if event.query.user_id == me.id: hashtxt_ = event.pattern_match.group(1) urllib.parse.quote_plus(hashtxt_) hashtxt = open("hashdis.txt", "w+") hashtxt.write(hashtxt_) hashtxt.close() md5 = runapp(["md5sum", "hashdis.txt"], stdout=PIPE) md5 = md5.stdout.decode() sha1 = runapp(["sha1sum", "hashdis.txt"], stdout=PIPE) sha1 = sha1.stdout.decode() sha256 = runapp(["sha256sum", "hashdis.txt"], stdout=PIPE) sha256 = sha256.stdout.decode() sha512 = runapp(["sha512sum", "hashdis.txt"], stdout=PIPE) runapp(["rm", "hashdis.txt"], stdout=PIPE) sha512 = sha512.stdout.decode() ans = ("Text: `" + hashtxt_ + "`\nMD5: `" + md5 + "`SHA1: `" + sha1 + "`SHA256: `" + sha256 + "`SHA512: `" + sha512[:-1] + "`") if len(ans) > 4096: hashfile = open("hashes.txt", "w+") hashfile.write(ans) hashfile.close() resultm = builder.document("hashes.txt",title="Really",description="A FILE",text=f"`{JAVES_NNAME}:` **Output too large sended as doc ,can also use !hash**",buttons=[[Button.switch_inline("Search Again", query="hash ", same_peer=True)],], ) await event.answer([resultm]) runapp(["rm", "hashes.txt"], stdout=PIPE) return else: resultm = builder.article(title="Haha",description="Click Me",text=ans,buttons=[[Button.switch_inline("Search Again", query="hash ", same_peer=True)],], ) await event.answer([resultm]) return if not event.query.user_id == me.id: resultm = builder.article(title="me not your bot",description="Mind Your Business",text="Hey U Must Use https://github.com/Sh1vam/javes-3.0 ",buttons=[[Button.switch_inline("Search Again", query="hash ", same_peer=True)],], ) await event.answer([resultm]) return