├── runtime.txt ├── Procfile ├── requirements.txt ├── README.md ├── .github └── workflows │ ├── greetings.yml │ ├── label.yml │ └── codeql-analysis.yml ├── app.json ├── LICENSE └── main.py /runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.9.7 2 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | bughunter0: python3 main.py 2 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | pyrogram 2 | tgcrypto 3 | requests 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # HandWriting-Bot 2 | Telegram Bot to convert text to Handwriting using pywhatkit. 3 | -------------------------------------------------------------------------------- /.github/workflows/greetings.yml: -------------------------------------------------------------------------------- 1 | name: Greetings 2 | 3 | on: [pull_request, issues] 4 | 5 | jobs: 6 | greeting: 7 | runs-on: ubuntu-latest 8 | permissions: 9 | issues: write 10 | pull-requests: write 11 | steps: 12 | - uses: actions/first-interaction@v1 13 | with: 14 | repo-token: ${{ secrets.GITHUB_TOKEN }} 15 | issue-message: 'Thanks for your time, I will try my level best to solve this issue' 16 | pr-message: 'Thanks for Your contribution, ' 17 | -------------------------------------------------------------------------------- /.github/workflows/label.yml: -------------------------------------------------------------------------------- 1 | # This workflow will triage pull requests and apply a label based on the 2 | # paths that are modified in the pull request. 3 | # 4 | # To use this workflow, you will need to set up a .github/labeler.yml 5 | # file with configuration. For more information, see: 6 | # https://github.com/actions/labeler 7 | 8 | name: Labeler 9 | on: [pull_request] 10 | 11 | jobs: 12 | label: 13 | 14 | runs-on: ubuntu-latest 15 | permissions: 16 | contents: read 17 | pull-requests: write 18 | 19 | steps: 20 | - uses: actions/labeler@v2 21 | with: 22 | repo-token: "${{ secrets.GITHUB_TOKEN }}" 23 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "PYROGRAMBOT", 3 | "description": "A Modular telegram bot.", 4 | "repository": "https://github.com/bughunter0", 5 | "keywords": [ 6 | 7 | "telegram bot", 8 | "pyrogram" 9 | ], 10 | "env": { 11 | "BOT_TOKEN": { 12 | "description": "Your Bot token from @Botfather" 13 | }, 14 | "API_ID": { 15 | "description": "Your API_ID from https://my.telegram.org/apps" 16 | }, 17 | "API_HASH": { 18 | "description": "Your API_HASH from https://my.telegram.org/apps" 19 | } 20 | }, 21 | "buildpacks": [ 22 | { 23 | "url": "heroku/python" 24 | } 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Nuhman Pk 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | # https://gist.github.com/nuhmanpk/e2e49a30ea0174dd88fbea3be7eeffd0 2 | # © BugHunterCodeLabs ™ 3 | # © bughunter0 4 | # 2021 5 | # Copyright - https://en.m.wikipedia.org/wiki/Fair_use 6 | 7 | import pyrogram 8 | from pyrogram import Client, filters 9 | from pyrogram.types import User, Message 10 | import os 11 | import requests 12 | 13 | bughunter0 = Client( 14 | "Handwriting", 15 | bot_token=os.environ["BOT_TOKEN"], 16 | api_id=int(os.environ["API_ID"]), 17 | api_hash=os.environ["API_HASH"], 18 | ) 19 | 20 | 21 | @bughunter0.on_message(filters.text) 22 | async def text(bot, message): 23 | text = str(message.text) 24 | chat_id = int(message.chat.id) 25 | file_name = f"{message.chat.id}.jpg" 26 | if len(text) < 500: 27 | txt = await message.reply_text("Converting to handwriting...") 28 | rgb = [0, 0, 0] # Edit RGB values here to change the Ink color 29 | try: 30 | # Can directly use pywhatkit module for this 31 | # here is the updated code https://gist.github.com/nuhmanpk/e2e49a30ea0174dd88fbea3be7eeffd0 32 | data = requests.get( 33 | "https://pywhatkit.herokuapp.com/handwriting?text=%s&rgb=%s,%s,%s" 34 | % (text, rgb[0], rgb[1], rgb[2]) 35 | ).content 36 | except Exception as error: 37 | await message.reply_text(f"{error}") 38 | return 39 | with open(file_name, "wb") as file: 40 | file.write(data) 41 | file.close() 42 | await txt.edit("Uploading...") 43 | await bot.send_photo( 44 | chat_id=chat_id, 45 | photo=file_name, 46 | caption="Join @BugHunterBots" 47 | ) 48 | await txt.delete() 49 | os.remove(file_name) 50 | else: 51 | await message.reply_text("Please don't do It") 52 | 53 | bughunter0.run() 54 | -------------------------------------------------------------------------------- /.github/workflows/codeql-analysis.yml: -------------------------------------------------------------------------------- 1 | # For most projects, this workflow file will not need changing; you simply need 2 | # to commit it to your repository. 3 | # 4 | # You may wish to alter this file to override the set of languages analyzed, 5 | # or to provide custom queries or build logic. 6 | # 7 | # ******** NOTE ******** 8 | # We have attempted to detect the languages in your repository. Please check 9 | # the `language` matrix defined below to confirm you have the correct set of 10 | # supported CodeQL languages. 11 | # 12 | name: "CodeQL" 13 | 14 | on: 15 | push: 16 | branches: [ main ] 17 | pull_request: 18 | # The branches below must be a subset of the branches above 19 | branches: [ main ] 20 | schedule: 21 | - cron: '29 19 * * 5' 22 | 23 | jobs: 24 | analyze: 25 | name: Analyze 26 | runs-on: ubuntu-latest 27 | permissions: 28 | actions: read 29 | contents: read 30 | security-events: write 31 | 32 | strategy: 33 | fail-fast: false 34 | matrix: 35 | language: [ 'python' ] 36 | # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] 37 | # Learn more: 38 | # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed 39 | 40 | steps: 41 | - name: Checkout repository 42 | uses: actions/checkout@v2 43 | 44 | # Initializes the CodeQL tools for scanning. 45 | - name: Initialize CodeQL 46 | uses: github/codeql-action/init@v1 47 | with: 48 | languages: ${{ matrix.language }} 49 | # If you wish to specify custom queries, you can do so here or in a config file. 50 | # By default, queries listed here will override any specified in a config file. 51 | # Prefix the list here with "+" to use these queries and those in the config file. 52 | # queries: ./path/to/local/query, your-org/your-repo/queries@main 53 | 54 | # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). 55 | # If this step fails, then you should remove it and run the build manually (see below) 56 | - name: Autobuild 57 | uses: github/codeql-action/autobuild@v1 58 | 59 | # ℹ️ Command-line programs to run using the OS shell. 60 | # 📚 https://git.io/JvXDl 61 | 62 | # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines 63 | # and modify them (or add more) to build your code if your project 64 | # uses a compiled language 65 | 66 | #- run: | 67 | # make bootstrap 68 | # make release 69 | 70 | - name: Perform CodeQL Analysis 71 | uses: github/codeql-action/analyze@v1 72 | --------------------------------------------------------------------------------