43 |
44 |
45 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Byte-compiled / optimized / DLL files
2 | __pycache__/
3 | *.py[cod]
4 | *$py.class
5 |
6 | # C extensions
7 | *.so
8 |
9 | # Distribution / packaging
10 | .Python
11 | build/
12 | develop-eggs/
13 | dist/
14 | downloads/
15 | eggs/
16 | .eggs/
17 | lib/
18 | lib64/
19 | parts/
20 | sdist/
21 | var/
22 | wheels/
23 | pip-wheel-metadata/
24 | share/python-wheels/
25 | *.egg-info/
26 | .installed.cfg
27 | *.egg
28 | MANIFEST
29 |
30 | # PyInstaller
31 | # Usually these files are written by a python script from a template
32 | # before PyInstaller builds the exe, so as to inject date/other infos into it.
33 | *.manifest
34 | *.spec
35 |
36 | # Installer logs
37 | pip-log.txt
38 | pip-delete-this-directory.txt
39 |
40 | # Unit test / coverage reports
41 | htmlcov/
42 | .tox/
43 | .nox/
44 | .coverage
45 | .coverage.*
46 | .cache
47 | nosetests.xml
48 | coverage.xml
49 | *.cover
50 | *.py,cover
51 | .hypothesis/
52 | .pytest_cache/
53 |
54 | # Translations
55 | *.mo
56 | *.pot
57 |
58 | # Django stuff:
59 | *.log
60 | local_settings.py
61 | db.sqlite3
62 | db.sqlite3-journal
63 |
64 | # Flask stuff:
65 | instance/
66 | .webassets-cache
67 |
68 | # Scrapy stuff:
69 | .scrapy
70 |
71 | # Sphinx documentation
72 | docs/_build/
73 |
74 | # PyBuilder
75 | target/
76 |
77 | # Jupyter Notebook
78 | .ipynb_checkpoints
79 |
80 | # IPython
81 | profile_default/
82 | ipython_config.py
83 |
84 | # pyenv
85 | .python-version
86 |
87 | # pipenv
88 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89 | # However, in case of collaboration, if having platform-specific dependencies or dependencies
90 | # having no cross-platform support, pipenv may install dependencies that don't work, or not
91 | # install all needed dependencies.
92 | #Pipfile.lock
93 |
94 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow
95 | __pypackages__/
96 |
97 | # Celery stuff
98 | celerybeat-schedule
99 | celerybeat.pid
100 |
101 | # SageMath parsed files
102 | *.sage.py
103 |
104 | # Environments
105 | .env
106 | .venv
107 | env/
108 | venv/
109 | ENV/
110 | env.bak/
111 | venv.bak/
112 | bot-env/
113 |
114 | # Spyder project settings
115 | .spyderproject
116 | .spyproject
117 |
118 | # Rope project settings
119 | .ropeproject
120 |
121 | # mkdocs documentation
122 | /site
123 |
124 | # mypy
125 | .mypy_cache/
126 | .dmypy.json
127 | dmypy.json
128 |
129 | # Pyre type checker
130 | .pyre/
131 |
--------------------------------------------------------------------------------
/.dockerignore:
--------------------------------------------------------------------------------
1 | ### Python template
2 | # Byte-compiled / optimized / DLL files
3 | __pycache__/
4 | *.py[cod]
5 | *$py.class
6 |
7 | # C extensions
8 | *.so
9 |
10 | # Distribution / packaging
11 | .Python
12 | build/
13 | develop-eggs/
14 | dist/
15 | downloads/
16 | eggs/
17 | .eggs/
18 | lib/
19 | lib64/
20 | parts/
21 | sdist/
22 | var/
23 | wheels/
24 | share/python-wheels/
25 | *.egg-info/
26 | .installed.cfg
27 | *.egg
28 | MANIFEST
29 |
30 | # PyInstaller
31 | # Usually these files are written by a python script from a template
32 | # before PyInstaller builds the exe, so as to inject date/other infos into it.
33 | *.manifest
34 | *.spec
35 |
36 | # Installer logs
37 | pip-log.txt
38 | pip-delete-this-directory.txt
39 |
40 | # Unit test / coverage reports
41 | htmlcov/
42 | .tox/
43 | .nox/
44 | .coverage
45 | .coverage.*
46 | .cache
47 | nosetests.xml
48 | coverage.xml
49 | *.cover
50 | *.py,cover
51 | .hypothesis/
52 | .pytest_cache/
53 | cover/
54 |
55 | # Translations
56 | *.mo
57 | *.pot
58 |
59 | # Django stuff:
60 | *.log
61 | local_settings.py
62 | db.sqlite3
63 | db.sqlite3-journal
64 |
65 | # Flask stuff:
66 | instance/
67 | .webassets-cache
68 |
69 | # Scrapy stuff:
70 | .scrapy
71 |
72 | # Sphinx documentation
73 | docs/_build/
74 |
75 | # PyBuilder
76 | .pybuilder/
77 | target/
78 |
79 | # Jupyter Notebook
80 | .ipynb_checkpoints
81 |
82 | # IPython
83 | profile_default/
84 | ipython_config.py
85 |
86 | # pyenv
87 | # For a library or package, you might want to ignore these files since the code is
88 | # intended to run in multiple environments; otherwise, check them in:
89 | # .python-version
90 |
91 | # pipenv
92 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
93 | # However, in case of collaboration, if having platform-specific dependencies or dependencies
94 | # having no cross-platform support, pipenv may install dependencies that don't work, or not
95 | # install all needed dependencies.
96 | #Pipfile.lock
97 |
98 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow
99 | __pypackages__/
100 |
101 | # Celery stuff
102 | celerybeat-schedule
103 | celerybeat.pid
104 |
105 | # SageMath parsed files
106 | *.sage.py
107 |
108 | # Environments
109 | .env
110 | .venv
111 | env/
112 | venv/
113 | ENV/
114 | env.bak/
115 | venv.bak/
116 |
117 | # Spyder project settings
118 | .spyderproject
119 | .spyproject
120 |
121 | # Rope project settings
122 | .ropeproject
123 |
124 | # mkdocs documentation
125 | /site
126 |
127 | # mypy
128 | .mypy_cache/
129 | .dmypy.json
130 | dmypy.json
131 |
132 | # Pyre type checker
133 | .pyre/
134 |
135 | # pytype static type analyzer
136 | .pytype/
137 |
138 | # Cython debug symbols
139 | cython_debug/
140 |
141 |
--------------------------------------------------------------------------------
/pastebin-bot/love_quotes.py:
--------------------------------------------------------------------------------
1 | happy_love_quotes = [
2 | """ "For small creatures such as we, the vastness is bearable only through love." – Carl Sagan """,
3 | """ "When you're a kid, you assume your parents are soulmates. My kids are gonna be right about that." – The Office """,
4 | """ "So excuse me forgetting
5 | But these things, I do
6 | You see, I've forgotten
7 | If they're green or they're blue.
8 | Anyway, the thing is, what I really mean
9 | Yours are the sweetest eyes I've ever seen."
10 | – Elton John, "Your Song" """,
11 | """ "Nobody has ever measured, not even poets, how much the heart can hold."
12 | – Zelda Fitzgerald """,
13 | """ "Two people in love, alone, isolated from the world, that's beautiful." – Milan Kundera
14 | """,
15 | """ "True love stories never have endings." – Richard Bach """,
16 | """ "The best and most beautiful things in the world cannot be seen or even touched—they must be felt with the heart." – Helen Keller """,
17 | """ "Deep within us — no matter who we are — there lives a feeling of wanting to be lovable, of wanting to be the kind of person that others like to be with. And the greatest thing we can do is to let people know that they are loved and capable of loving." – Fred Rogers """,
18 | """ "The greatest thing you'll ever learn is just to love and be loved in return." – Nat King Cole, "Nature Boy" lyrics """,
19 | """ "Laughter is holier than piety, freedom is sweeter than fame, and in the end it's love and love alone that really matters." – Tom Robbins """,
20 | """ "You know you're in love when you can't fall asleep because reality is finally better than your dreams." – Dr. Seuss """,
21 | """ She had blue skin,
22 | And so did he.
23 | He kept it hid
24 | And so did she.
25 | They searched for blue
26 | Their whole life through,
27 | Then passed right by-
28 | And never knew."
29 | – Shel Silverstein, "Masks" """,
30 | """ "You're my one in five billion." – The X-Files """,
31 | """ "Happiness is anyone and anything at all that's loved by you." – You're a Good Man, Charlie Brown """,
32 | """ "A friend is someone who knows all about you and still loves you." – Elbert Hubbard""",
33 | """ "Maybe you don't need the whole world to love you, you know. Maybe you just need one person." – The Muppets """,
34 | """ "That's why they call them crushes. If they were easy, they'd call them something else." – Sixteen Candles """,
35 | """ "Once upon a time there was a boy who loved a girl, and her laughter was a question he wanted to spend his whole life answering." – Nicole Krauss, The History of Love """,
36 | """ "Love is an irresistible desire to be irresistibly desired." – Robert Frost """,
37 | """ "At the touch of love everyone becomes a poet." – Plato """,
38 | """ "Love is the condition in which the happiness of another person is essential to your own." – Robert A. Heinlein, Stranger in a Strange Land """,
39 | """ "But the heart's not like a box that gets filled up. It expands in size the more you love." – Her """,
40 | """ "There is no remedy for love, but to love more." – Thoreau """,
41 | ]
42 |
43 | sad_love_quotes = [
44 | """
45 | Duniya mai ab ishq baaki nahi hai,
46 | Bus ek shakhs inke liye kaafi nahi hai.
47 | """,
48 | """
49 | Tum khud hi khud ko satate ho,
50 | Dil kyu itni jaldi kisi se lagate ho.
51 | """,
52 | """
53 | Sath hokar Phir bhi fikar karte hai,
54 | Ab har kahi hum unka zikar karte hai.
55 | """,
56 | """
57 | Kitno ne tujhse sawal kia hai,
58 | Kya Kisi ne tera khayal bhi kiya hai?
59 | """,
60 | ]
61 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Pastebin-Telegram 📺
2 |
3 | Open-Bot for Telegram
4 |
5 |
6 | [](https://github.com/Mr-Sunglasses/pastebin-telegram/issues)
7 | [](https://github.com/Mr-Sunglasses/pastebin-telegram/network)
8 | [](https://github.com/Mr-Sunglasses/pastebin-telegram/stargazers)
9 | [](https://github.com/Mr-Sunglasses/pastebin-telegram/blob/main/LICENSE)
10 | [](https://github.com/ellerbrock/open-source-badges/) [](http://makeapullrequest.com)  
11 |
12 |
13 |
14 |
15 |
16 |
17 | ### BROWSER USAGE
18 |
19 | https://paste.rs/web
20 |
21 | ### API USAGE
22 | `POST https://paste.rs/`
23 |
24 | Send the raw data along. Will respond with a link to the paste.
25 |
26 | - **Response code 201 (Created):**
27 | The entire paste was uploaded.
28 | - **Response code 206 (Partial):**
29 | The paste exceeded the maximum upload size, only part of the paste was uploaded.
30 | - **Other response codes:**
31 | An error occurred.
32 |
33 | Pasting is heavily rate limited.
34 |
35 | ---
36 | `GET https://paste.rs/`
37 |
38 | Retrieve the paste with the given id as plain-text.
39 |
40 | ---
41 |
42 | `GET https://paste.rs/.`
43 |
44 | Retrieve the paste with the given id. If ext is a known code file extension, the paste is syntax highlighted and returned as HTML. If ext is a known file extension, the paste is returned with the extension's corresponding Content-Type. Otherwise, the paste is returned as plain text.
45 |
46 | ---
47 |
48 | `DELETE https://paste.rs/`
49 |
50 | Delete the paste with the given id.
51 |
52 | ### Examples
53 |
54 | - **Paste a file named 'file.txt' using PowerShell:**
55 |
56 | `Invoke-RestMethod -Uri "https://paste.rs" -Method Post -InFile .\file.txt`
57 |
58 | - **Paste from stdin using PowerShell:**
59 |
60 | `echo "Hi!" | Invoke-RestMethod -Uri "https://paste.rs" -Method Post`
61 |
62 | - **Delete an existing paste with id using PowerShell:**
63 |
64 | `Invoke-RestMethod -Uri "https://paste.rs/" -Method Delete`
65 |
66 | - **A PowerShell function that can be used for quick pasting from the command line. The command takes a filename or reads from stdin if none was supplied and outputs the URL of the paste to stdout: 'Paste file.txt' or 'echo hi" | Paste'.**
67 |
68 | ```
69 | function Paste([string]$file) {
70 | $Data = if ($file) {Get-Content $file} else {$input}
71 | Invoke-RestMethod -Uri "https://paste.rs" -Method Post -Body $Data
72 | }
73 | ```
74 |
75 | Run Through Docker
76 |
77 | docker build -t container_name .
78 |
79 | docker run -e TOKEN=TELEGRAM_BOT_TOKEN -e username=INTA_USER-NAME -e password=INSTA_PASSWORD container_name:latest
80 |
81 | ## 💪 Thanks to all Wonderful Contributors
82 |
83 | Thanks a lot for spending your time helping Pastebin-Telegram grow.
84 | Thanks a lot! Keep rocking 🍻
85 |
86 | [](https://github.com/Mr-Sunglasses/pastebin-telegram/graphs/contributors)
87 |
88 | ## 🙏 Support++
89 |
90 | This project needs your shiny star ⭐.
91 | Don't forget to leave a star ⭐️
92 |
93 | [](https://www.python.org/) [](https://forthebadge.com)
94 |
95 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Code of Conduct - Pastebin-telegram
2 |
3 | ## Our Pledge
4 |
5 | In the interest of fostering an open and welcoming environment, we as
6 | contributors and maintainers pledge to make participation in our project and
7 | our community a harassment-free experience for everyone, regardless of age, body
8 | size, disability, ethnicity, sex characteristics, gender identity and expression,
9 | level of experience, education, socio-economic status, nationality, personal
10 | appearance, race, religion, or sexual identity and orientation.
11 |
12 | ## Our Standards
13 |
14 | Examples of behavior that contributes to a positive environment for our
15 | community include:
16 |
17 | * Demonstrating empathy and kindness toward other people
18 | * Being respectful of differing opinions, viewpoints, and experiences
19 | * Giving and gracefully accepting constructive feedback
20 | * Accepting responsibility and apologizing to those affected by our mistakes,
21 | and learning from the experience
22 | * Focusing on what is best not just for us as individuals, but for the
23 | overall community
24 |
25 | Examples of unacceptable behavior include:
26 |
27 | * The use of sexualized language or imagery, and sexual attention or
28 | advances
29 | * Trolling, insulting or derogatory comments, and personal or political attacks
30 | * Public or private harassment
31 | * Publishing others' private information, such as a physical or email
32 | address, without their explicit permission
33 | * Other conduct which could reasonably be considered inappropriate in a
34 | professional setting
35 |
36 | ## Our Responsibilities
37 |
38 | Project maintainers are responsible for clarifying and enforcing our standards of
39 | acceptable behavior and will take appropriate and fair corrective action in
40 | response to any behavior that they deem inappropriate,
41 | threatening, offensive, or harmful.
42 |
43 | Project maintainers have the right and responsibility to remove, edit, or reject
44 | comments, commits, code, wiki edits, issues, and other contributions that are
45 | not aligned to this Code of Conduct, and will
46 | communicate reasons for moderation decisions when appropriate.
47 |
48 | ## Scope
49 |
50 | This Code of Conduct applies within all community spaces, and also applies when
51 | an individual is officially representing the community in public spaces.
52 | Examples of representing our community include using an official e-mail address,
53 | posting via an official social media account, or acting as an appointed
54 | representative at an online or offline event.
55 |
56 | ## Enforcement
57 |
58 | Instances of abusive, harassing, or otherwise unacceptable behavior may be
59 | reported to the community leaders responsible for enforcement at .
60 | All complaints will be reviewed and investigated promptly and fairly.
61 |
62 | All community leaders are obligated to respect the privacy and security of the
63 | reporter of any incident.
64 |
65 | ## Enforcement Guidelines
66 |
67 | Community leaders will follow these Community Impact Guidelines in determining
68 | the consequences for any action they deem in violation of this Code of Conduct:
69 |
70 | ### 1. Correction
71 |
72 | **Community Impact**: Use of inappropriate language or other behavior deemed
73 | unprofessional or unwelcome in the community.
74 |
75 | **Consequence**: A private, written warning from community leaders, providing
76 | clarity around the nature of the violation and an explanation of why the
77 | behavior was inappropriate. A public apology may be requested.
78 |
79 | ### 2. Warning
80 |
81 | **Community Impact**: A violation through a single incident or series
82 | of actions.
83 |
84 | **Consequence**: A warning with consequences for continued behavior. No
85 | interaction with the people involved, including unsolicited interaction with
86 | those enforcing the Code of Conduct, for a specified period of time. This
87 | includes avoiding interactions in community spaces as well as external channels
88 | like social media. Violating these terms may lead to a temporary or
89 | permanent ban.
90 |
91 | ### 3. Temporary Ban
92 |
93 | **Community Impact**: A serious violation of community standards, including
94 | sustained inappropriate behavior.
95 |
96 | **Consequence**: A temporary ban from any sort of interaction or public
97 | communication with the community for a specified period of time. No public or
98 | private interaction with the people involved, including unsolicited interaction
99 | with those enforcing the Code of Conduct, is allowed during this period.
100 | Violating these terms may lead to a permanent ban.
101 |
102 | ### 4. Permanent Ban
103 |
104 | **Community Impact**: Demonstrating a pattern of violation of community
105 | standards, including sustained inappropriate behavior, harassment of an
106 | individual, or aggression toward or disparagement of classes of individuals.
107 |
108 | **Consequence**: A permanent ban from any sort of public interaction within
109 | the community.
110 |
111 | ## Attribution
112 |
113 | This Code of Conduct is adapted from the [Contributor Covenant](https://contributor-covenant.org/), version
114 | [1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct/code_of_conduct.md) and
115 | [2.0](https://www.contributor-covenant.org/version/2/0/code_of_conduct/code_of_conduct.md),
116 | and was generated by [contributing-gen](https://github.com/bttger/contributing-gen).
117 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Creative Commons Legal Code
2 |
3 | CC0 1.0 Universal
4 |
5 | CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
6 | LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
7 | ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
8 | INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
9 | REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
10 | PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
11 | THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
12 | HEREUNDER.
13 |
14 | Statement of Purpose
15 |
16 | The laws of most jurisdictions throughout the world automatically confer
17 | exclusive Copyright and Related Rights (defined below) upon the creator
18 | and subsequent owner(s) (each and all, an "owner") of an original work of
19 | authorship and/or a database (each, a "Work").
20 |
21 | Certain owners wish to permanently relinquish those rights to a Work for
22 | the purpose of contributing to a commons of creative, cultural and
23 | scientific works ("Commons") that the public can reliably and without fear
24 | of later claims of infringement build upon, modify, incorporate in other
25 | works, reuse and redistribute as freely as possible in any form whatsoever
26 | and for any purposes, including without limitation commercial purposes.
27 | These owners may contribute to the Commons to promote the ideal of a free
28 | culture and the further production of creative, cultural and scientific
29 | works, or to gain reputation or greater distribution for their Work in
30 | part through the use and efforts of others.
31 |
32 | For these and/or other purposes and motivations, and without any
33 | expectation of additional consideration or compensation, the person
34 | associating CC0 with a Work (the "Affirmer"), to the extent that he or she
35 | is an owner of Copyright and Related Rights in the Work, voluntarily
36 | elects to apply CC0 to the Work and publicly distribute the Work under its
37 | terms, with knowledge of his or her Copyright and Related Rights in the
38 | Work and the meaning and intended legal effect of CC0 on those rights.
39 |
40 | 1. Copyright and Related Rights. A Work made available under CC0 may be
41 | protected by copyright and related or neighboring rights ("Copyright and
42 | Related Rights"). Copyright and Related Rights include, but are not
43 | limited to, the following:
44 |
45 | i. the right to reproduce, adapt, distribute, perform, display,
46 | communicate, and translate a Work;
47 | ii. moral rights retained by the original author(s) and/or performer(s);
48 | iii. publicity and privacy rights pertaining to a person's image or
49 | likeness depicted in a Work;
50 | iv. rights protecting against unfair competition in regards to a Work,
51 | subject to the limitations in paragraph 4(a), below;
52 | v. rights protecting the extraction, dissemination, use and reuse of data
53 | in a Work;
54 | vi. database rights (such as those arising under Directive 96/9/EC of the
55 | European Parliament and of the Council of 11 March 1996 on the legal
56 | protection of databases, and under any national implementation
57 | thereof, including any amended or successor version of such
58 | directive); and
59 | vii. other similar, equivalent or corresponding rights throughout the
60 | world based on applicable law or treaty, and any national
61 | implementations thereof.
62 |
63 | 2. Waiver. To the greatest extent permitted by, but not in contravention
64 | of, applicable law, Affirmer hereby overtly, fully, permanently,
65 | irrevocably and unconditionally waives, abandons, and surrenders all of
66 | Affirmer's Copyright and Related Rights and associated claims and causes
67 | of action, whether now known or unknown (including existing as well as
68 | future claims and causes of action), in the Work (i) in all territories
69 | worldwide, (ii) for the maximum duration provided by applicable law or
70 | treaty (including future time extensions), (iii) in any current or future
71 | medium and for any number of copies, and (iv) for any purpose whatsoever,
72 | including without limitation commercial, advertising or promotional
73 | purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
74 | member of the public at large and to the detriment of Affirmer's heirs and
75 | successors, fully intending that such Waiver shall not be subject to
76 | revocation, rescission, cancellation, termination, or any other legal or
77 | equitable action to disrupt the quiet enjoyment of the Work by the public
78 | as contemplated by Affirmer's express Statement of Purpose.
79 |
80 | 3. Public License Fallback. Should any part of the Waiver for any reason
81 | be judged legally invalid or ineffective under applicable law, then the
82 | Waiver shall be preserved to the maximum extent permitted taking into
83 | account Affirmer's express Statement of Purpose. In addition, to the
84 | extent the Waiver is so judged Affirmer hereby grants to each affected
85 | person a royalty-free, non transferable, non sublicensable, non exclusive,
86 | irrevocable and unconditional license to exercise Affirmer's Copyright and
87 | Related Rights in the Work (i) in all territories worldwide, (ii) for the
88 | maximum duration provided by applicable law or treaty (including future
89 | time extensions), (iii) in any current or future medium and for any number
90 | of copies, and (iv) for any purpose whatsoever, including without
91 | limitation commercial, advertising or promotional purposes (the
92 | "License"). The License shall be deemed effective as of the date CC0 was
93 | applied by Affirmer to the Work. Should any part of the License for any
94 | reason be judged legally invalid or ineffective under applicable law, such
95 | partial invalidity or ineffectiveness shall not invalidate the remainder
96 | of the License, and in such case Affirmer hereby affirms that he or she
97 | will not (i) exercise any of his or her remaining Copyright and Related
98 | Rights in the Work or (ii) assert any associated claims and causes of
99 | action with respect to the Work, in either case contrary to Affirmer's
100 | express Statement of Purpose.
101 |
102 | 4. Limitations and Disclaimers.
103 |
104 | a. No trademark or patent rights held by Affirmer are waived, abandoned,
105 | surrendered, licensed or otherwise affected by this document.
106 | b. Affirmer offers the Work as-is and makes no representations or
107 | warranties of any kind concerning the Work, express, implied,
108 | statutory or otherwise, including without limitation warranties of
109 | title, merchantability, fitness for a particular purpose, non
110 | infringement, or the absence of latent or other defects, accuracy, or
111 | the present or absence of errors, whether or not discoverable, all to
112 | the greatest extent permissible under applicable law.
113 | c. Affirmer disclaims responsibility for clearing rights of other persons
114 | that may apply to the Work or any use thereof, including without
115 | limitation any person's Copyright and Related Rights in the Work.
116 | Further, Affirmer disclaims responsibility for obtaining any necessary
117 | consents, permissions or other rights required for any use of the
118 | Work.
119 | d. Affirmer understands and acknowledges that Creative Commons is not a
120 | party to this document and has no duty or obligation with respect to
121 | this CC0 or use of the Work.
122 |
--------------------------------------------------------------------------------
/pastebin-bot/bot.py:
--------------------------------------------------------------------------------
1 | import time
2 |
3 | from API import API_KEY
4 | import telebot
5 | import os, subprocess, threading
6 | from request import file_writer, file_remover
7 | from insta_profile import profile_downloader, profile_delete
8 | from insta_all_pictures import fetch_posts, profile_delete
9 | from qr_generator import generate_qr, delete_qr
10 | from quotes import preload_quotes, quotes
11 | from random import randint
12 | from love_quotes import happy_love_quotes, sad_love_quotes
13 | from yt_download_shorts import download_video, get_title
14 | import instaloader
15 | from link_shortner import short
16 |
17 | bot = telebot.TeleBot(API_KEY)
18 |
19 | # TBD
20 | # def handle_message(update, context):
21 | # user_first_name = update.message.chat.first_name
22 | # user_last_name = update.message.chat.last_name
23 | # username = update.message.chat.username
24 | # update.message.reply_text(
25 | # f"Hey👋 {user_first_name} {user_last_name} aka @{username} welcome to the Open-Bot type: /help to explore options."
26 | # )
27 | #
28 | #
29 |
30 |
31 | # This Decorator handle's the message with and /start
32 | @bot.message_handler(commands=["start"])
33 | def handle_start(message):
34 | bot.reply_to(
35 | message,
36 | "Welcome to Open-Bot Powered by Open-Source and Developed by @thisiskanishkP",
37 | )
38 | bot.send_photo(chat_id=message.chat.id, photo=open("images/octocat.png", "rb"))
39 |
40 |
41 | # This Decorator helps in handling the message with /help
42 | @bot.message_handler(commands=["help"])
43 | def handle_help(message):
44 | bot.reply_to(
45 | message,
46 | """\
47 | The Following Commands can we user
48 |
49 | /start - to say welcome message
50 | /help - to get help
51 | /paste - to push content to paste.rs
52 | /pic - to download a profile pic of the user
53 | /post - to download all pictures posted by the user
54 | /qr - to generate qr code
55 | /quote - for getting random quotes
56 | /love_quote_happy - for romantic quotes [happy]
57 | /love_quote_sad - for romantic quotes [sad]
58 | /yt_dl - to download a youtube video.......[it may take sometime to download a youtube video so chill]
59 | /short - To shorten the link\
60 | """,
61 | )
62 |
63 |
64 | # This Decorator helps in handling the message with /paste
65 | @bot.message_handler(commands=["paste"])
66 | def handle_paste(message):
67 | chat_id = message.chat.id
68 | data = message.text
69 | send_data = data[7::]
70 | file_writer(text=send_data)
71 | output = subprocess.check_output(
72 | "curl --data-binary @file.txt https://paste.rs/", shell=True
73 | )
74 | bot.send_message(chat_id, f"{output.decode('utf-8')}")
75 | file_remover()
76 |
77 |
78 | # This Decorator helps in handling the message with /pic
79 | @bot.message_handler(commands=["pic"])
80 | def handle_pic(message):
81 | chat_id = message.chat.id
82 | data = message.text
83 | username = data[5::]
84 | print(username)
85 | try:
86 | profile_downloader(username=username)
87 | bot.reply_to(
88 | message,
89 | f"Please wait while we are sending you the profile pic of {username} \n Don't worry it will take a minute or so 🤝",
90 | )
91 | for root, subdirs, files in os.walk(username):
92 | for file in files:
93 | if os.path.splitext(file)[1].lower() in (".jpg", ".jpeg"):
94 | bot.send_photo(
95 | chat_id, photo=open(f"{os.path.join(root, file)}", "rb")
96 | )
97 | profile_delete(username=username)
98 | except:
99 | bot.reply_to(message, f"{username} is not found")
100 |
101 |
102 | # This Decorator helps in handling the message with /post
103 | @bot.message_handler(commands=["post"])
104 | def handle_insta(message):
105 | chat_id = message.chat.id
106 | data = message.text
107 | username = data[6::]
108 | try:
109 | task = threading.Thread(target=fetch_posts, args=(username,))
110 | task.start()
111 | bot.reply_to(
112 | message, f"Getting posts of {username} for you. \nPlease wait for a moment."
113 | )
114 | task.join()
115 | for root, subdirs, files in os.walk(username, topdown=False):
116 | for file in files:
117 | if os.path.splitext(file)[1].lower() in (".jpg", ".jpeg"):
118 | bot.send_photo(
119 | chat_id, photo=open(f"{os.path.join(root, file)}", "rb")
120 | )
121 |
122 | profile_delete(username=username)
123 |
124 | except FileNotFoundError:
125 | bot.reply_to(message, f"{username} is not found")
126 |
127 |
128 | # This Decorator helps in handling the message with /qr
129 | @bot.message_handler(commands=["qr"])
130 | def handle_qr(message):
131 | chat_id = message.chat.id
132 | text = message.text
133 | link = text[4::]
134 | try:
135 | generate_qr(link=link)
136 | bot.send_photo(chat_id=chat_id, photo=open("myqr.png", "rb"))
137 | delete_qr()
138 | except:
139 | bot.reply_to(message, f"QR of this {link} can't be generated")
140 | delete_qr()
141 |
142 |
143 | # This Decorator helps in handling the message with /quote
144 | @bot.message_handler(commands=["quote"])
145 | def handle_quote(message):
146 | chat_id = message.chat.id
147 | preload_quotes()
148 | bot.reply_to(message, f"{quotes[0]}")
149 |
150 |
151 | # This Decorator helps in handling the message with /love_quote_happy
152 | @bot.message_handler(commands=["love_quote_happy"])
153 | def handle_love_quote_happy(message):
154 | bot.reply_to(message, f"❤️ {happy_love_quotes[randint(0, 22)]}")
155 |
156 |
157 | # This Decorator helps in handling the message with /love_quote_sad
158 | @bot.message_handler(commands=["love_quote_sad"])
159 | def handle_love_quote_sad(message):
160 | bot.reply_to(message, f"❤️ {sad_love_quotes[randint(0, 22)]}")
161 |
162 |
163 | # This Decorator helps in handling the message with /yt_dl
164 | @bot.message_handler(commands=["yt_dl"])
165 | def handle_video_download_yt(message):
166 | chat_id = message.chat.id
167 | data = message.text
168 | link_video = data[7::]
169 | try:
170 | bot.send_message(
171 | chat_id,
172 | "Please wait while the Video is Downloading, It may take 3-5 minutes to download a 20 mb video 🙏",
173 | )
174 | download_video(link_video)
175 | bot.send_video(chat_id, video=open("output.mp4", "rb"), supports_streaming=True)
176 | time.sleep(
177 | 50
178 | ) # Alternate way, the problem occurs when file deletion, Better way to use Async await for this task
179 | if os.path.exists("output.mp4"):
180 | os.remove("output.mp4")
181 | except instaloader.ProfileNotExistsException:
182 | bot.reply_to(message, f"{link_video} is not Found")
183 | except instaloader.ConnectionException:
184 | bot.reply_to(message, "IP is Blocked Please Try After Some Time")
185 |
186 |
187 | # This Decorator Deals with /short
188 | @bot.message_handler(commands=["short"])
189 | def handle_short(message):
190 | chat_id = message.chat.id
191 | data = message.text
192 | payload_link_data = data[7::]
193 | try:
194 | bot.reply_to(message, f"{short(payload_link_data)}")
195 | except:
196 | bot.reply_to(message, f"We can't abel to short{payload_link_data}")
197 |
198 |
199 | if __name__ == "__main__":
200 | bot.infinity_polling()
201 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 |
2 | # Contributing to Pastebin-telegram
3 |
4 | First off, thanks for taking the time to contribute! ❤️
5 |
6 | All types of contributions are encouraged and valued. See the [Table of Contents](#table-of-contents) for different ways to help and details about how this project handles them. Please make sure to read the relevant section before making your contribution. It will make it a lot easier for us maintainers and smooth out the experience for all involved. The community looks forward to your contributions. 🎉
7 |
8 | > And if you like the project, but just don't have time to contribute, that's fine. There are other easy ways to support the project and show your appreciation, which we would also be very happy about:
9 | > - Star the project
10 | > - Tweet about it
11 | > - Refer this project in your project's readme
12 | > - Mention the project at local meetups and tell your friends/colleagues
13 |
14 |
15 | ## Table of Contents
16 |
17 | - [Code of Conduct](#code-of-conduct)
18 | - [I Have a Question](#i-have-a-question)
19 | - [I Want To Contribute](#i-want-to-contribute)
20 | - [Reporting Bugs](#reporting-bugs)
21 | - [Suggesting Enhancements](#suggesting-enhancements)
22 | - [Your First Code Contribution](#your-first-code-contribution)
23 | - [Improving The Documentation](#improving-the-documentation)
24 | - [Styleguides](#styleguides)
25 | - [Commit Messages](#commit-messages)
26 | - [Join The Project Team](#join-the-project-team)
27 |
28 |
29 | ## Code of Conduct
30 |
31 | This project and everyone participating in it is governed by the
32 | [Pastebin-telegram Code of Conduct](https://github.com/Mr-Sunglasses/pastebin-telegramblob/master/CODE_OF_CONDUCT.md).
33 | By participating, you are expected to uphold this code. Please report unacceptable behavior
34 | to .
35 |
36 |
37 | ## I Have a Question
38 |
39 | > If you want to ask a question, we assume that you have read the available [Documentation]().
40 |
41 | Before you ask a question, it is best to search for existing [Issues](https://github.com/Mr-Sunglasses/pastebin-telegram/issues) that might help you. In case you have found a suitable issue and still need clarification, you can write your question in this issue. It is also advisable to search the internet for answers first.
42 |
43 | If you then still feel the need to ask a question and need clarification, we recommend the following:
44 |
45 | - Open an [Issue](https://github.com/Mr-Sunglasses/pastebin-telegram/issues/new).
46 | - Provide as much context as you can about what you're running into.
47 | - Provide project and platform versions (nodejs, npm, etc), depending on what seems relevant.
48 |
49 | We will then take care of the issue as soon as possible.
50 |
51 |
65 |
66 | ## I Want To Contribute
67 |
68 | > ### Legal Notice
69 | > When contributing to this project, you must agree that you have authored 100% of the content, that you have the necessary rights to the content and that the content you contribute may be provided under the project license.
70 |
71 | ### Reporting Bugs
72 |
73 |
74 | #### Before Submitting a Bug Report
75 |
76 | A good bug report shouldn't leave others needing to chase you up for more information. Therefore, we ask you to investigate carefully, collect information and describe the issue in detail in your report. Please complete the following steps in advance to help us fix any potential bug as fast as possible.
77 |
78 | - Make sure that you are using the latest version.
79 | - Determine if your bug is really a bug and not an error on your side e.g. using incompatible environment components/versions (Make sure that you have read the [documentation](). If you are looking for support, you might want to check [this section](#i-have-a-question)).
80 | - To see if other users have experienced (and potentially already solved) the same issue you are having, check if there is not already a bug report existing for your bug or error in the [bug tracker](https://github.com/Mr-Sunglasses/pastebin-telegramissues?q=label%3Abug).
81 | - Also make sure to search the internet (including Stack Overflow) to see if users outside of the GitHub community have discussed the issue.
82 | - Collect information about the bug:
83 | - Stack trace (Traceback)
84 | - OS, Platform and Version (Windows, Linux, macOS, x86, ARM)
85 | - Version of the interpreter, compiler, SDK, runtime environment, package manager, depending on what seems relevant.
86 | - Possibly your input and the output
87 | - Can you reliably reproduce the issue? And can you also reproduce it with older versions?
88 |
89 |
90 | #### How Do I Submit a Good Bug Report?
91 |
92 | > You must never report security related issues, vulnerabilities or bugs including sensitive information to the issue tracker, or elsewhere in public. Instead sensitive bugs must be sent by email to .
93 |
94 |
95 | We use GitHub issues to track bugs and errors. If you run into an issue with the project:
96 |
97 | - Open an [Issue](https://github.com/Mr-Sunglasses/pastebin-telegram/issues/new). (Since we can't be sure at this point whether it is a bug or not, we ask you not to talk about a bug yet and not to label the issue.)
98 | - Explain the behavior you would expect and the actual behavior.
99 | - Please provide as much context as possible and describe the *reproduction steps* that someone else can follow to recreate the issue on their own. This usually includes your code. For good bug reports you should isolate the problem and create a reduced test case.
100 | - Provide the information you collected in the previous section.
101 |
102 | Once it's filed:
103 |
104 | - The project team will label the issue accordingly.
105 | - A team member will try to reproduce the issue with your provided steps. If there are no reproduction steps or no obvious way to reproduce the issue, the team will ask you for those steps and mark the issue as `needs-repro`. Bugs with the `needs-repro` tag will not be addressed until they are reproduced.
106 | - If the team is able to reproduce the issue, it will be marked `needs-fix`, as well as possibly other tags (such as `critical`), and the issue will be left to be [implemented by someone](#your-first-code-contribution).
107 |
108 |
109 |
110 |
111 | ### Suggesting Enhancements
112 |
113 | This section guides you through submitting an enhancement suggestion for Pastebin-telegram, **including completely new features and minor improvements to existing functionality**. Following these guidelines will help maintainers and the community to understand your suggestion and find related suggestions.
114 |
115 |
116 | #### Before Submitting an Enhancement
117 |
118 | - Make sure that you are using the latest version.
119 | - Read the [documentation]() carefully and find out if the functionality is already covered, maybe by an individual configuration.
120 | - Perform a [search](https://github.com/Mr-Sunglasses/pastebin-telegram/issues) to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one.
121 | - Find out whether your idea fits with the scope and aims of the project. It's up to you to make a strong case to convince the project's developers of the merits of this feature. Keep in mind that we want features that will be useful to the majority of our users and not just a small subset. If you're just targeting a minority of users, consider writing an add-on/plugin library.
122 |
123 |
124 | #### How Do I Submit a Good Enhancement Suggestion?
125 |
126 | Enhancement suggestions are tracked as [GitHub issues](https://github.com/Mr-Sunglasses/pastebin-telegram/issues).
127 |
128 | - Use a **clear and descriptive title** for the issue to identify the suggestion.
129 | - Provide a **step-by-step description of the suggested enhancement** in as many details as possible.
130 | - **Describe the current behavior** and **explain which behavior you expected to see instead** and why. At this point you can also tell which alternatives do not work for you.
131 | - You may want to **include screenshots and animated GIFs** which help you demonstrate the steps or point out the part which the suggestion is related to. You can use [this tool](https://www.cockos.com/licecap/) to record GIFs on macOS and Windows, and [this tool](https://github.com/colinkeenan/silentcast) or [this tool](https://github.com/GNOME/byzanz) on Linux.
132 | - **Explain why this enhancement would be useful** to most Pastebin-telegram users. You may also want to point out the other projects that solved it better and which could serve as inspiration.
133 |
134 |
135 |
136 | ### Your First Code Contribution
137 |
141 |
142 | ### Improving The Documentation
143 |
147 |
148 | ## Styleguides
149 | ### Commit Messages
150 |
153 |
154 | ## Join The Project Team
155 |
156 |
157 |
--------------------------------------------------------------------------------
/.idea/workspace.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |