Giter Club home page Giter Club logo

telegram-paperplane's Introduction

Paperplane userbot project

logo

#include <std/disclaimer.h>
/**
    Your Telegram account may get banned.
    We are not responsible for any improper use of Paperplane.
    Paperplane is intended for the purpose of effective group management,
    PM control as well as having fun with memes.
    You ended up spamming groups, getting reported left and right,
    and you ended up in a Finale Battle with Telegram and at the end
    Telegram Team deleted your account?
    And after that, then you pointed your fingers at us
    for getting your acoount deleted?
    We will be rolling on the floor laughing at you.
/**

What is it?

Paperplane is a modular Telegram userbot running on Python3, which can be coupled up with MongoDB and a Redis backend to bring you features such as PMPermit (auto blocking strangers on PM), AFK messages, group management features (ban/mute/kick/etc, notes, filters, welcomes and so on), different scrapers making every daily and rare task easier, integration with different services and more! You can check the list of features with the .help command after installing Paperplane, or you can check the source code!

Originally created by baalajimaestro, Paperplane started as a simple userbot, with group management features inspired from Marie, memes from SkittBot and a ton of other modules. Paperplane has evolved to become a project with dozens of contributors. Paperplane is currently owned and maintained by @zakaryan2004 as a side project, with the help of all contributors.

How do I use it?

For configuring Paperplane, you can check out our Wiki. Please, before asking us in our groups, make sure you have followed the Wiki and all the steps required. Before clicking the Deploy to Heroku button without thinking, please go ahead and read the wiki, which has a lot of important stuff you need to know about and things you should prepare for Paperplane.

Deploy Paperplane to Heroku:

Deploy to Heroku

Groups and support

If you'd just like to know about new features, or announcements, you can join our news channel.

For discussion, bug reporting, and help, you can join our discussion group.

If you find a bug, don't hesitate to report it in our Telegram group or open an issue on this repository. As for unofficial forks of Paperplane, we will only assist with issues affecting our central repository, found on this repo. So, before asking help for setting up the bot or reporting a bug you found, MAKE SURE you are using this repo, and not a fork you found somewhere else. You may get ignored if you ask for help with a fork.

Credits

Over the years, Paperplane evolved thanks to the dozens of contributors who have contributed, large or small, to the project. Listing all of them here would be impossible, as even the person in the group who reported a small bug has made their share of contribution to the project. We thank all of our contributors who have done and are doing even the slightest for the project.

The code contributors can be found at the Contributors page. This page will obviously not list all code contributions correctly, as some contributors attributed their commits with emails not associated with a GitHub account or maybe a guy just made a small snippet of code, posted it on the Internet and it got used by us, in Paperplane. Paperplane could of course not become what it is now without the dependencies, which you can find in the requirements.txt file in the root of the repo. We are thankful to everyone who made Paperplane better.

telegram-paperplane's People

Contributors

akianonymus avatar aragon12 avatar argraur avatar avinashreddy3108 avatar baalajimaestro avatar bottest123 avatar gotenksin avatar hugwalk avatar kandnub avatar mactavishao avatar mryacha avatar nitanmarcel avatar nyancrimew avatar penn5 avatar raphielscape avatar realakito avatar rupansh avatar shanuflash avatar skittles9823 avatar spechide avatar stickler-ci[bot] avatar stricted avatar the-blank-x avatar vrumger avatar yash-garg avatar yash089610 avatar yasir-siddiqui avatar yshalsager avatar zainarbani avatar zakaryan2004 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

telegram-paperplane's Issues

When am trying to approve some one then show there non-sqnl mode

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Python Version
Provide exact python version used

Additional context
Add any other context about the problem here.

Telegram New policy

telegram New policy ban this userbot try to remove some offensive features

.img command always errors

Describe the bug
Everytime I use the .img command it returns an error.

To Reproduce
Steps to reproduce the behavior:
Send .img donald trump meme or any other query

Expected behavior
Images should be returned with no error

Python Version
Using baalajimaestro/userbot_python:latest, so the version in there

Additional context
It seems as though there are two types of errors. One looks like this

Traceback info:
Traceback (most recent call last):
  File "/app/userbot/events.py", line 80, in wrapper
    await func(check)
  File "/app/userbot/modules/scrapers.py", line 66, in img_sampler
    os.rmdir(os.path.dirname(os.path.abspath(lst[0])))
OSError: [Errno 39] Directory not empty: '/app/downloads'

The other occurs when adding a limit to the number of images using lim=5 in the query

Traceback info:
Traceback (most recent call last):
  File "/app/userbot/events.py", line 80, in wrapper
    await func(check)
  File "/app/userbot/modules/scrapers.py", line 65, in img_sampler
    os.remove(lst[1])
IndexError: list index out of range

URGENT: Error log spam on groups

Describe the bug
Whenever the Telegram database made changes, or is down, the bot will flood errors in every chat possible. This is a serious problem that shall be fixed ASAP

To Reproduce

  • Wait for your Telegram Datacenter to be down or made changes, at that time, bot will generate tons of errors and flood it on every chats that have new "events"

Expected behavior

  • Error log shall be put on BOTLOG group instead of putting it on chat where errors happen, BASICALLY better error handling

Python Version
Arch Linux Python 3.8.2

I am havent any error but Database not working.

Describe the bug
Mongo db working but not working on userbot. I havent any error because does not error.
My url: MONGO_DB_URI="mongodb://yusuf:[email protected]:27017/userbot"
Its mongodb error or userbot? which one?

Python Version
3.6.8
Additional context
I am using ubuntu 16.04 and google cloud.

Heroku Push failing

Describe the bug
Heroku push fails, stating some file is missing from /var/lib/docker

To Reproduce
Steps to reproduce the behavior:

  1. Follow normal setup
  2. Try to push to heroku

Expected behavior
Pushes successfully

Screenshots
N/A

Python Version
3.8.1

Additional context

remote: Step 5/6 : COPY ./userbot.session ./config.env* ./client_secrets.json* ./secret.json* /app/
remote: COPY failed: stat /var/lib/docker/tmp/docker-builder304893055/userbot.session: no such file or directory

I did run generate_session.py and userbot.session exists locally

Having issues getting the bot to properly connect to mongo db

Describe the bug
mongo db issues

To Reproduce
i followed the steps on the readme... and mongodb atlas says i am connected to the database but the bot says i am not

Your bot is running

Telethon version: 1.8.0
Python: 3.7.3
User: BeeldBox
Database Status: Either Mongo or Redis Database seems to be failing!

Expected behavior
Database Status: to not say there is error.... no commands that use the database seem to work either

Screenshots
If applicable, add screenshots to help explain your problem.
image
image

Python Version
3.7.3

Additional context
Add any other context about the problem here.

po

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Additional context
Add any other context or screenshots about the feature request here.

Direct link cloudmailru error

Describe the bug

ERROR:telethon.client.updates:Unhandled exception on direct_link_generator
Traceback (most recent call last):
 File "/app/.heroku/python/lib/python3.7/site-packages/telethon/client/updates.py", line 416, in _dispatch_update
await callback(event)
File "stdplugins/direct_link.py", line 49, in direct_link_generator
  reply += cm_ru(link)
   File "stdplugins/direct_link.py", line 197, in cm_ru
     result = result.splitlines()[-1]
 IndexError: list index out of range

Screenshots
image

Python Version
3.7.3

[Pull Request] Help module as list

Current help module is like this right?: Admins, memes, and, other, stuff,
This type will be better i guess:

  • Admins
  • memes
  • and
  • other
  • stuff

PMing users for the first time should auto-accept them for PM.

As one of the people not using this userbot, I find that when someone using it PMs me first, I'll get the "bleep blop I'm a bot" message as soon as I reply.

steps to reproduce:

userbot user: starts conversation with a first message
me: replies
userbot: "bleep blop I'm a bot"
-> now the user has to accept me for pm.

Is this intended behaviour?
Shouldn't a user be automatically accepted to PM if the userbot owner initiated the conversation?

[DV-SA] Remote Privilege Elevation in Event Register

Identifier for the advisory (mandatory). Will be assigned a "DV-SA-[NO][STATE]" identifier e.g. DV-SA-00-ST.
DV-SA-36CA

Name of the affected project (mandatory)
Paperplane

Disclosure date of the advisory as an RFC 3339 date (mandatory)
2020-04-28

Single-line description of a vulnerability (mandatory)
A flaw in Event Register allows Remote Privilege Elevation

URL to a long-form description of this issue, e.g. a GitHub issue/PR, a changelog entry, or a blog post announcing the release (optional)
Pull Request #237

Optional: Categories this advisory falls under. Valid categories are: "code-execution", "crypto-failure", "denial-of-service", "file-disclosure" "format-injection", "memory-corruption", "memory-exposure", "privilege-escalation"
privilege-escalation code-execution

Optional: a Common Vulnerability Scoring System score. More information can be found on the CVSS website, https://www.first.org/cvss/.
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H

Vulnerability aliases, e.g. CVE IDs (optional but recommended)
[ Unassigned ]

References to related vulnerabilities (optional)
[ Unassigned ]

Enter a short-form description of the vulnerability here (mandatory)
Telegram allows for messages in a channel to be edited by all of the admins. The attacker edits a message the user posted on a channel and can fully use every command and have full privileges.

The flaw was corrected by @penn5

Optional: metadata which narrows the scope of what this advisory affects
[ Unassigned ]

CPU architectures impacted by this vulnerability (optional). Only use this if the vulnerability is specific to a particular CPU architecture.
all-arch

Operating systems impacted by this vulnerability (optional)
all-os

Versions which include fixes for this vulnerability (mandatory)
master

staging

compose

Versions which were never vulnerable (optional)
[ Unassigned ]

[CRITICAL]: A Person can mute himself

A person is able to apply a userbot mute on himself/herself, and it cant be unmuted at all without messing with the database. He/She has to delete the entry from the database manually

DOCKERFILE: userbot.session needs to exist or else the build fails

Describe the bug
Dockerbuild fails if userbot.session does not exist.
Possible fix- touch userbot.session

To Reproduce
Steps to reproduce the behavior:

  1. Go to docker build . -t userbot
  2. Click on N/A
  3. Scroll down to Step 12/15 : COPY ./userbot.session ./config.env* /home/userbot/userbot/
  4. See error

Expected behavior
Ignore copying userbot.session if it does not exist

Screenshots
N/A

Python Version
N/A

Additional context
N/A

[halp me]

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
any functions needing database connections are failing on 3.0 alpha
Expected behavior
things to work

Screenshots
https://i.imgur.com/IRReewQ.png this was trying to use the .mute command
.alive also shows this https://i.imgur.com/65iRxU4.png

Python Version
3.7.3

[DV-SA] Remote Privilege Elevation in Evaluation Module

Identifier for the advisory (mandatory). Will be assigned a "DV-SA-[NO][STATE]" identifier e.g. DV-SA-00-ST.

DV-SA-35CA

Name of the affected project (mandatory)

Paperplane

Disclosure date of the advisory as an RFC 3339 date (mandatory)

2020-04-03

Single-line description of a vulnerability (mandatory)

Flaw in Evaluation Module allows Remote Privilege Elevation

URL to a long-form description of this issue, e.g. a GitHub issue/PR, a changelog entry, or a blog post announcing the release (optional)

Pull Request 221

Optional: Categories this advisory falls under. Valid categories are: "code-execution", "crypto-failure", "denial-of-service", "file-disclosure" "format-injection", "memory-corruption", "memory-exposure", "privilege-escalation"

privilege-escalation

Optional: a Common Vulnerability Scoring System score. More information can be found on the CVSS website, https://www.first.org/cvss/.

CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:H/A:H

Vulnerability aliases, e.g. CVE IDs (optional but recommended)

[ Unassigned ]

References to related vulnerabilities (optional)

[ Unassigned ]

Enter a short-form description of the vulnerability here (mandatory)
Evaluation module allows inline bot to interacting with the userbot directly.
This allows an attacker to do priviliege elevation to user's account.

The flaw was corrected by Penn5.

Optional: metadata which narrows the scope of what this advisory affects

[ Unassigned ]

CPU architectures impacted by this vulnerability (optional). Only use this if the vulnerability is specific to a particular CPU architecture.

all-arch

Operating systems impacted by this vulnerability (optional)

all-os

Versions which include fixes for this vulnerability (mandatory)

master

compose

Versions which were never vulnerable (optional)

[ Unassigned ]

Android : codename, device command is broken

Describe the bug
codename, device, and specs command is broken in Android module

To Reproduce
Use codename, device or specs command from Android module

Expected behavior
codename - Get codename from a brand and a device name
device - Get device info from codename
specs - Same usage as codename, but get the device specs instead

Python Version
Arch Linux Python 3.8.2

Files cannot be saved as notes

Describe the bug
Whenever saving a file as a note no error is given; however retrieving the note always fails.

To Reproduce
Steps to reproduce the behavior:

  1. Save file as note
  2. Try to retrieve note
  3. Fails

Expected behavior
File is re-given in response to the note

Screenshots
N/A

Python Version
3.7.5

Additional context
Userbot is running on ubuntu 18.04 (because setting up heroku fails)

[TO-DO] Your general TO-DO list

Project's Current TO-DO

  • BETTER WIKI
  • A new Help implementation
  • Integrate Kantek with Paperplane Not planned
  • Make the mute command check if the user can delete messages in a group before saying they are not an admin
  • Save alive username in DB
  • Check if config properties like botlog_chatid are valid when starting Paperplane
  • Don't say "kicking away" in welcome mute when not admin
  • .weather command API Key NoneType has no len()
  • Improve sleep
  • Make welcome mute check if there was a report command(or @ admin) before reporting someone
  • Check the shit happening with .download, test link: here
  • Proper error checking, less editing in .block
  • Fix .restart not restarting when not being run in Docker
  • Fix some of the Lists module's commands logger messages
  • Files cannot be saved as notes [#218]
  • Fix bugs in Android-related modules
  • Tweak optional env vars logic
  • Exclude Paperplane from a group feature

This TO-DO list will be kept updated. Please always take a look at this post.

if creator (or a bot) joins a group, WELCOME_MUTE thinks that they are a spammer

I joined my group, but other users who were using userbot, thought I was a spammer from your WELCOME_MUTE function.

Please see the screenshot here:

https://t.me/ThankTelegram/206456

To Reproduce
Steps to reproduce the behavior:

  1. Creator enables welcome messages, from https://github.com/pyrogram/plugins/blob/master/plugins/welcome/welcome.py
  2. Creator leaves the group.
  3. Some other user who is using this userbot has WELCOME_MUTE enabled
  4. Check ¯_(ツ)_/¯

.delusers command is broken

this command can't find any deleted accounts in a group

Fixed command here:

@register(outgoing=True, group_only=True, pattern="^.delusers(?: |$)(.*)")
@grp_exclude()
async def rm_deletedacc(show):
""" For .delusers command, clean deleted accounts. """
con = show.pattern_match.group(1)
del_u = 0
del_status = "No deleted accounts found, Group is cleaned as Hell"

if con != "clean":
    await show.edit("`Searching for zombie accounts...`")
    async for user in show.client.iter_participants(show.chat_id):
        if user.deleted:
            del_u += 1
            await sleep(1)

    if del_u > 0:
        del_status = f"Found **{del_u}** deleted account(s) in this group,\
        \nclean them by using `.delusers clean`"

    await show.edit(del_status)
    return

# Here laying the sanity check
chat = await show.get_chat()
admin = chat.admin_rights
creator = chat.creator

# Well
if not admin and not creator:
    await show.edit("`You aren't an admin here!`")
    return

await show.edit("`Cleaning deleted accounts...`")
del_u = 0
del_a = 0

async for user in show.client.iter_participants(show.chat_id):
    if user.deleted:
        try:
            await show.client(
                EditBannedRequest(show.chat_id, user.id, BANNED_RIGHTS))
        except ChatAdminRequiredError:
            await show.edit("`You don't have enough rights.`")
            return
        except UserAdminInvalidError:
            del_u -= 1
            del_a += 1
        await show.client(
            EditBannedRequest(show.chat_id, user.id, UNBAN_RIGHTS))
        del_u += 1
        await sleep(1)
if del_u > 0:
    del_status = f"cleaned **{del_u}** deleted account(s)"

if del_a > 0:
    del_status = f"cleaned **{del_u}** deleted account(s) \

\n**{del_a}** deleted admin accounts are not removed"

await show.edit(del_status)

please GIVE PROPER AUTHORSHIP, in MPL license, to MY PLUGINS

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.