Skip to content

Commit

Permalink
add travis, deepsource and pep8speaks
Browse files Browse the repository at this point in the history
  • Loading branch information
rking32 committed May 26, 2020
1 parent 19aa5af commit c76fe0d
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 9 deletions.
10 changes: 10 additions & 0 deletions .deepsource.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version = 1

[[analyzers]]
name = "python"
enabled = true
dependency_file_paths = ["requirements.txt"]

[analyzers.meta]
runtime_version = "3.x.x"
max_line_length = 100
13 changes: 13 additions & 0 deletions .pep8speaks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# File : .pep8speaks.yml

scanner:
linter: flake8

flake8:
max-line-length: 100

message:
opened:
header: "@{name}, Thanks for opening this PR."
updated:
header: "@{name}, Thanks for updating this PR."
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
language: python
python:
- "3.8"
install:
- pip install -r requirements.txt
script:
- python test.py
22 changes: 13 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

# Userge 🔥

[![Build Status](https://travis-ci.com/UsergeTeam/Userge.svg?branch=dev)](https://travis-ci.com/UsergeTeam/Userge) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/9ff2867320b049b99a4a77285bb03cc4)](https://www.codacy.com/gh/UsergeTeam/Userge?utm_source=github.com&utm_medium=referral&utm_content=UsergeTeam/Userge&utm_campaign=Badge_Grade) [![DeepSource](https://static.deepsource.io/deepsource-badge-light-mini.svg)](https://deepsource.io/gh/UsergeTeam/Userge/?ref=repository-badge)

> **Userge** is a Powerful , _Pluggable_ Telegram UserBot written in _Python_ using [Pyrogram](https://github.com/pyrogram/pyrogram).
## Inspiration 😇
Expand All @@ -36,10 +38,14 @@
## Features 😍

* Powerful and Very Useful **built-in** Plugins
* gdrive ( Team Drives Supported! ) 🤥
* zip / unzip
* telegram upload
* telegram download
* gdrive [ upload / download / etc ] ( Team Drives Supported! ) 🤥
* zip / tar / unzip / untar / unrar
* telegram upload / download
* pmpermit / afk
* notes / filters
* split / combine
* gadmin
* plugin manager
* etc...
* Channel & Group log support
* Database support
Expand All @@ -50,8 +56,6 @@

## Example Plugin 🤨

[![Codacy Badge](https://api.codacy.com/project/badge/Grade/dacadcbabdb74de3903ddae25dc95375)](https://app.codacy.com/gh/UsergeTeam/Userge?utm_source=github.com&utm_medium=referral&utm_content=UsergeTeam/Userge&utm_campaign=Badge_Grade_Dashboard)

```python
from userge import userge, Message

Expand All @@ -70,7 +74,7 @@ async def testing(message: Message):

## Requirements 🥴

* Python 3.6 or Higher 👻
* Python 3.7 or Higher 👻
* Telegram [API Keys](https://my.telegram.org/apps)
* Google Drive [API Keys](https://console.developers.google.com/)
* MongoDB [Database URL](https://cloud.mongodb.com/)
Expand All @@ -89,7 +93,7 @@ async def testing(message: Message):
> Finally turn on the app and check the logs (settings -> view logs) :)
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/UsergeTeam/Userge)
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/UsergeTeam/Userge/tree/master)

* **Other Method** 🔧

Expand All @@ -100,7 +104,7 @@ async def testing(message: Message):

# create virtualenv
virtualenv -p /usr/bin/python3 venv
. ./venv/bin/activate
../venv/bin/activate

# install requirements
pip install -r requirements.txt
Expand Down
40 changes: 40 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Copyright (C) 2020 by UsergeTeam@Github, < https://github.com/UsergeTeam >.
#
# This file is part of < https://github.com/UsergeTeam/Userge > project,
# and is released under the "GNU v3.0 License Agreement".
# Please see < https://github.com/uaudith/Userge/blob/master/LICENSE >
#
# All rights reserved.

import os
import asyncio
from userge import userge

async def worker():
chat_id = int(os.environ.get("CHAT_ID"))
await userge.send_message(chat_id, 'testing_userge')
print('sleeping 3 sec...!')
await asyncio.sleep(3)

async def main():
print('starting client...!')
await userge.start()
tasks = []
print('adding tasks...!')
for task in userge._tasks:
tasks.append(loop.create_task(task()))
print('stating worker...!')
await worker()
print('closing tasks...!')
for task in tasks:
task.cancel()
print('stopping client...!')
await userge.stop()

loop = asyncio.get_event_loop()
print('creating loop...!')
loop.run_until_complete(main())
print('closing loop...!')
loop.close()

print('userge test has been finished!')

0 comments on commit c76fe0d

Please sign in to comment.