Ankit404butfound / PyWhatKit

Send WhatsApp message at certain time and many other things.
MIT License
1.37k stars 298 forks source link

Text to Handwriting #136

Closed RSR-TG-Info closed 3 years ago

RSR-TG-Info commented 3 years ago

Text to Handwriting converter has error, why?

codewithpom commented 3 years ago

@RSR-TG-Info Thanks for telling us but can you please describe it like what is the error and even send the code.

RSR-TG-Info commented 3 years ago

@RSR-TG-Info Thanks for telling us but can you please describe it like what is the error and even send the code.

We used your code in my Bot, but can't generate Handwriting text, only my Bot give me None, then we put on browser this link https://pywhatkit.herokuapp.com/handwriting?test=%s&rgb=%s,%s,%s and i got error Screenshot_2021-10-20-10-31-39-471_com android chrome

RSR-TG-Info commented 3 years ago

@RSR-TG-Info Thanks for telling us but can you please describe it like what is the error and even send the code.

My code

@pbot.on_message(filters.command(["hwrite"])) async def hwrite(client, message): rsr6 = get_text(message) if not rsr6: await message.reply_text("siam tur thu i dah tel lo") return file_name = f"RSR.jpg" if len(rsr6) < 500: txt = await edit_or_reply(message, "Siam mek...") rgb = [0, 0, 138] # Edit RGB values here to change the Ink color try:

Can directly use pywhatkit module for this

        data = requests.get(
            "https://pywhatkit.herokuapp.com/handwriting?rsr6=%s&rgb=%s,%s,%s"
            % (rsr6, rgb[0], rgb[1], rgb[2])
        ).content
    except Exception as error:
        await txt.edit(f"Ka siam theilo")
        return
    with open(file_name, "wb") as file:
        file.write(data)
        file.close()
    await client.send_chat_action(message.chat.id, "upload_photo")
    await client.send_photo(
        message.chat.id,
        photo=file_name,
        caption="<b>Siamtu</b>: @tereuhtex_bot",
        reply_to_message_id=message.message_id,
        parse_mode=ParseMode.HTML
    )
    await txt.delete()
    os.remove(file_name)
else:
    await client.send_message("Ka siam theilo")
codewithpom commented 3 years ago

@RSR-TG-Info Thanks but actually instead of supplying text param you are sending test named parameter in the url.

RSR-TG-Info commented 3 years ago

@RSR-TG-Info Thanks but actually instead of supplying text param you are sending test named parameter in the url.

Yes, i understand, thanks. Then can you tell me how to make bot can generate after command text? (my code is pyrogram)

codewithpom commented 3 years ago

Your code is already correct you just need to change the url of the request and even I am giving a discord bot repository link that we use the pywhatkit discord server https://github.com/Charanleo25/Drunk_Bot

RSR-TG-Info commented 3 years ago

Your code is already correct you just need to change the url of the request and even I am giving a discord bot repository link that we use the pywhatkit discord server https://github.com/Charanleo25/Drunk_Bot

okay, can you send me url for my code Sir?

RSR-TG-Info commented 3 years ago

i can make Sir, thanks for helping me❤️

codewithpom commented 3 years ago

@RSR-TG-Info No problem and please do not call me Sir and close this issue if your query is done.

RSR-TG-Info commented 3 years ago

Okay