Skip to content

Commit

Permalink
Dev (UsergeTeam#1)
Browse files Browse the repository at this point in the history
* added reacts

Signed-off-by: rking32 <[email protected]>

* fixed help!

fixed help shit :|

fixed reacts to working without dot

fixed notes for new help

added new plugins called convert and type

fixed header for more clean

Signed-off-by: rking32 <[email protected]>

* add admin moduel

* so far no fixes FFS

* fix promote func + added more bugs to fix

* added demote func + more bugs

* Added gdrive plugin beta XD

small fixes

added gdrive.py

fixed gdrive progress

fixed gdrive (bit stable)

Optimized Gdive

added .gdel and .gempty commands

added Custom Exception

added .gset and .greset commands

added .gget commend

added permission commands

added .gcopy

fixed creds.refresh error

added .gdown command ( support files and folders )

added Aptfile

added .gls command

set logging level

added .gmove and make .gcopy can copy folders

fixed get_file_id :p

added force search option

* small fixes XD

Signed-off-by: rking32 <[email protected]>

* updated dev ;p

is CREDS object ?

small fixes

added zip plugin

* added channel logger shit :B

fixed NoneType error

added channel logger

fixed channel logger and rebuild base class :P

Signed-off-by: rking32 <[email protected]>

* edited README.md

Signed-off-by: rking32 <[email protected]>

Co-authored-by: K-E-N-W-A-Y <[email protected]>
  • Loading branch information
rking32 and K-E-N-W-A-Y authored Apr 10, 2020
1 parent f98e562 commit ab260fd
Show file tree
Hide file tree
Showing 26 changed files with 2,677 additions and 159 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,5 @@ config.env
*.session
rn
log.txt
gen
unknown_errors.txt
1 change: 1 addition & 0 deletions Aptfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tree
90 changes: 82 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,87 @@
<p align="center">
<a href="https://github.com/uaudith/Userge">
<img src="resources/userge(8).png" alt="Userge">
</a>
<br>
<b>Pluggable Telegram UserBot</b>
<br>
<a href="https://github.com/uaudith/Userge#inspiration">Inspiration</a>
&nbsp•&nbsp
<a href="https://github.com/uaudith/Userge#features">Features</a>
&nbsp•&nbsp
<a href="https://github.com/uaudith/Userge#example-plugin">Example</a>
&nbsp•&nbsp
<a href="https://github.com/uaudith/Userge#requirements">Requirements</a>
&nbsp•&nbsp
<a href="https://github.com/uaudith/Userge#project-credits">Project Credits</a>
&nbsp•&nbsp
<a href="https://github.com/uaudith/Userge#copyright--license">Copyright & License</a>
</p>

# Userge
Yet another telegram `userbot`

![userge](resources/userge(8).png)
> **Userge** is a Powerful , _Pluggable_ Telegram UserBot written in _Python_ using [Pyrogram](https://github.com/pyrogram/pyrogram).
## Inspiration

> This project is inspired by the following projects :)
* [tg_userbot](https://github.com/watzon/tg_userbot) (heavily)
* [PyroGramUserBot](https://github.com/SpEcHiDe/PyroGramUserBot)
* [Telegram-Paperplane](https://github.com/RaphielGang/Telegram-Paperplane)
* [UniBorg](https://github.com/SpEcHiDe/UniBorg)

> Special Thanks to all of you !!!.
## Features

* Powerful and Very Usefull build in plugins
* Channel log support
* Database support
* Easy to setup
* Easy to use
* Easy to add plugins
* Improved user friendliness of plugins

## Example Plugin

```python
from userge import userge, Message

LOG = userge.getLogger(__name__) # logger object
CHANNEL = userge.getCLogger(__name__) # channel logger object

@userge.on_cmd("test", about="help text to this command") # adding handler and help text to .test command
async def testing(message: Message):
LOG.info("starting test command...") # log to console
await message.edit("testing...", del_in=5) # this will be automatically deleted after 5 sec
CHANNEL.log("testing completed!") # log to channel
```

## Requirements

* Python 3.8 or Higher
* Telegram [API Keys](https://my.telegram.org/apps)
* MongoDB [Database URL](https://cloud.mongodb.com/)
* Google Drive [API Keys](https://console.developers.google.com/)

## How To Deploy

> If you are using [HEROKU](https://www.heroku.com/) simply click the button below.
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/uaudith/Userge)

> TODO: add Docker Support.
### Project Credits

## How to deploy ?
- something
- blah blah
### project credits
[@gotstc](https://t.me/gotstc), [@uaudIth](https://t.me/uaudIth), [@kenway](https://t.me/K_E_N_W_A_Y) and [@nawwa](https://t.me/nawwasl)
* [Specially these projects](https://github.com/uaudith/Userge#inspiration)
* [@uaudIth](https://t.me/uaudIth)
* [@K_E_N_W_A_Y](https://t.me/K_E_N_W_A_Y)
* [@nawwasl](https://t.me/nawwasl)
* [@gotstc](https://t.me/gotstc)

### Copyright & License

[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/uaudith/Userge)
* Copyright (C) 2020 [@SLBOTS](https://t.me/slbotsupdates)
* Licensed under the terms of the [GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007](https://github.com/uaudith/Userge/LICENSE)
26 changes: 22 additions & 4 deletions config.env.sample
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Remove this line first before doing anything else
_____REMOVE_____THIS_____LINE_____=True
_____REMOVE_____THIS_____LINE_____ = True


# Get them from https://my.telegram.org/
Expand All @@ -15,11 +15,29 @@ HU_STRING_SESSION = ""
DATABASE_URL = ""


# Your Languge ( ex: if english => 'en' )
PREFERRED_LANGUAGE = ""
# Googel Drive API Keys from https://console.developers.google.com/
G_DRIVE_CLIENT_ID = ""
G_DRIVE_CLIENT_SECRET = ""


# Set True if it is TeamDrive
G_DRIVE_IS_TD = False


# ----------- OPTIONAL ----------- #


# Your Languge ( ex: if english => 'en' )
PREFERRED_LANGUAGE = ""


# api key from 'https://screenshotlayer.com'
SCREENSHOT_API = ""
SCREENSHOT_API = ""


# GDrive Folder ID
G_DRIVE_PARENT_ID = ""


# Telegram Log Channel ID
LOG_CHANNEL_ID = ""
6 changes: 5 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@ wget
nest_asyncio
requests
pySmartDL
selenium
selenium
google-api-python-client
google-auth-httplib2
google-auth-oauthlib
oauth2client
34 changes: 5 additions & 29 deletions userge/core/_userge/base.py
Original file line number Diff line number Diff line change
@@ -1,34 +1,10 @@
from typing import Dict
from pyrogram import Message
import nest_asyncio
from userge.utils import logging
from pyrogram import Client


class Base:
class Base(Client):
"""
Base Class for Client and Message.
Base Class for Userge.
"""

_MAIN_STRING = "<<<! ##### ___{}___ ##### !>>>"
_SUB_STRING = "<<<! {} !>>>"
_LOG = logging.getLogger(__name__)
_NST_ASYNC = nest_asyncio

def _msg_to_dict(self,
message: Message) -> Dict[str, object]:

kwargs_ = vars(message)
del message

del kwargs_['_client']

if '_Message__filtered_input_str' in kwargs_:
del kwargs_['_Message__filtered_input_str']

if '_Message__flags' in kwargs_:
del kwargs_['_Message__flags']

if '_Message__kwargs' in kwargs_:
del kwargs_['_Message__kwargs']

return kwargs_
def getCLogger(self, name: str):
pass
Loading

0 comments on commit ab260fd

Please sign in to comment.