Skip to content
This repository has been archived by the owner on Jun 8, 2022. It is now read-only.

Commit

Permalink
v0.3.0
Browse files Browse the repository at this point in the history
- Load plugins from multiple directories. Instead of passing a ‘str’ to ‘activate()’ function, pass a list.
- Allow passing other keyword arguments while creating bot client.
- Override the in-built/default plugins automatically as they are loaded later now.

- Added optional argument [‘-v’, ‘–version’] to see currently installed version.
- Removed optional argument [‘-h’, ‘–help’] as passing no argument does the same thing.
- Made unnecessary arguments private.
- Other Improvements and BugFixes.

Took 52 seconds
  • Loading branch information
ShivangKakkar committed Jan 28, 2022
1 parent b61be19 commit 622b8c4
Show file tree
Hide file tree
Showing 5 changed files with 126 additions and 29 deletions.
6 changes: 4 additions & 2 deletions .gitignore
@@ -1,6 +1,8 @@
# IDEs
.idea/
.vscode/

# Git
.gitattributes

# Python
Expand All @@ -19,8 +21,8 @@ MANIFEST
/test.py
/*.env
.log
/info.txt

# Docs
docs/_build
docs/_static
#docs/_templates
docs/source/_local
31 changes: 19 additions & 12 deletions README.md
Expand Up @@ -2,48 +2,55 @@

> A star ⭐ from you means a lot
An incomplete add-on extension to [Pyrogram](https://pypi.org/project/Pyrogram), to create telegram bots a bit more easily.
An add-on extension to [Pyrogram](https://pypi.org/project/Pyrogram) for absolute beginners, to create telegram bots more easily.


## Documentation

Read the Documentation : https://pystark.codes
Read the Documentation : https://pystark.codes/

## What's the main purpose?

There are some things that are common in every bot. This makes it a bit simple to generate a boilerplate and ease overall creation.
There are some things that are common in most of the telegram bots. This library simplifies the development process by generating boilerplate code and easing the overall creation.

1. **Default Plugins** - Any bot created using `pystark` will automatically have some commands like */start*, */help*, */about* and */id*.
## Features

Of course that can be turned off using *default_plugins=False* in the main function.
1. **In-built/Default Plugins** - Any bot created using `pystark` will automatically have some commands like */start*, */help*, */about* and */id*.

Of course that can be turned off using *default_plugins=False* in the main function.

2. **Databases** - Both `postgres` and `redis` are ready to use once the environment variables are present.
2. **Databases** - There are in-built functions that help in using databases. The databases include `postgres`, `redis`, `tinydb` and `telegramdb`

To know more about **postgres** and **redis** usage in pystark - [Click Here](https://github.com/StarkBotsIndustries/PyStark/tree/master/pystark/database#databases)

To know more about using databases in pystark - [Click Here](https://pystark.codes/en/latest/topics/database/)

3. **Boilerplate** - You can generate a boilerplate with all the files you will need using our command line utility. Optionally, you can generate it with Heroku Support (app.json, Procfile, etc). Please scroll down below to `Usage` section to know how.
3. **Boilerplate Code** - You can generate a boilerplate with all the files you will need using our command line utility. Optionally, you can generate it with added Heroku Support (app.json, Procfile, etc.).

To know more, about generating a boilerplate - [Click Here](https://pystark.codes/en/latest/start/boilerplate/)

4. **Easier** - There are multiple things that make it easier.
4. **Easy-To-Use** - There are multiple things that make this library easy-to-use.

- Start the bot using 2-lines of code.
- Start the bot using only 2-lines of code.

```python
from pystark import Stark

Stark().activate()
```
- Easier to use methods and decorators

- Easy-to-use methods and decorators.

- Ability to customize everything.

- And much more.

## Credits

- [Dan](https://github.com/delivrance) for his [Pyrogram](https://github.com/pyrogram/pyrogram) Library on top of which **pystark** works.

## Community and Support

PyStark Telegram Updates - **[pystark](https://t.me/pystark)**

Telegram Channel - **[StarkBots](https://t.me/StarkBots)**

Telegram Chat - **[StarkBotsChat](https://t.me/StarkBotsChat)**
Expand Down
20 changes: 14 additions & 6 deletions requirements.txt
@@ -1,11 +1,19 @@
pyrogram
pyromod~=1.5
# Telegram
pyrogram~=1.3.6
TgCrypto~=1.2.3

# Environment
python-dotenv~=0.19.2
pytz

# Timezone
pytz~=2021.3

# Extend
pyromod~=1.5

# Databases
redis~=4.1.1
redis~=4.1.2
SQLAlchemy~=1.4.31
TgCrypto
TelegramDB==0.1.0
psycopg2
TelegramDB==0.2.0
tinydb~=4.6.1
72 changes: 72 additions & 0 deletions run.bat
@@ -0,0 +1,72 @@
@echo off
TITLE PyStark Batch Script File

@REM HELP
if "%1" == "help" set true=1
if "%1" == "" set true=1
if defined true (
echo Usage: run [[delete^|docs^|test^|main]] [open]
echo.
echo 'test' - upload to test-pypi
echo 'main' - upload to pypi
echo 'docs' - only update docs
echo 'delete' - only delete folders
exit /b 0
)

@REM DELETE
echo [Deleting Unnecessary Folders]
set folder='dist'
rmdir dist /q/s && (
echo Deleted %folder%
) || (
echo Cannot found %folder%
)
set folder2='PyStark.egg-info'
rmdir PyStark.egg-info /q/s && (
echo Deleted %folder2%
) || (
echo Cannot found %folder2%
)
set folder3='docs/_build'
rmdir "docs/_build" /q/s && (
echo Deleted %folder3%
) || (
echo Cannot found %folder3%
)
if "%1" == "delete" exit /b 0
echo.

@REM DOCS
echo [Generating Docs]
call docs/make.bat html
if "%2" == "open" start docs/_build/html/index.html
if "%1" == "docs" exit /b 0
echo.

@REM DIST
echo [Creating Distribution Files]
python setup.py sdist
if "%1" == "dist" exit /b 0
echo.

@REM TEST/MAIN

if "%1" == "test" goto :test
if "%1" == "main" goto :main

:test
echo [Upload to TestPyPI]
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
echo.
echo [All Done]
exit /b 0

:main
echo [Upload to PyPI]
twine upload dist/*
echo.
echo [All Done]
exit /b 0

@REM To-Do : Create command-line tool using Python instead [*python developer lol*]
26 changes: 17 additions & 9 deletions setup.py
Expand Up @@ -18,53 +18,61 @@


from setuptools import setup, find_packages
from pystark import __version__
from pystark import __description__

with open("README.md", encoding="utf-8") as f:
long_description = f.read()
long_description = "\n".join([x for x in f.read().split("\n") if not x.startswith('>')])

with open("requirements.txt", encoding="utf-8") as r:
install_requires = [i.strip() for i in r]

packages = find_packages()
version = __version__
description = __description__

setup(
name='PyStark',
packages=packages,
version='0.2.11', # 0.1.49
version=version,
license='GPLv3+',
description='An incomplete add-on extension to Pyrogram for personal use.',
description=description,
long_description=long_description,
long_description_content_type="text/markdown",
author='StarkBotsIndustries',
author='StarkProgrammer',
author_email='starkbotsindustries@gmail.com',
url='https://github.com/StarkBotsIndustries/PyStark',
download_url='https://github.com/StarkBotsIndustries/PyStark/releases/latest',
keywords=['telegram', 'bot', 'pyrogram', 'python'],
keywords=['telegram', 'bot', 'pyrogram', 'python', 'telegram-bot'],
install_requires=install_requires,
zip_safe=False,
python_requires="~=3.6",
python_requires=">=3.6",
dependency_links=['https://github.com/pyrogram/pyrogram/tarball/master'],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Intended Audience :: Education',
'Intended Audience :: Information Technology',
'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Natural Language :: English',
'Topic :: Communications :: Chat',
'Topic :: Education :: Testing',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: Libraries :: Python Modules'
],
project_urls={
"Documentation": "https://pystark.readthedocs.io/",
"Community": "https://t.me/StarkBots",
"Support": "https://t.me/StarkBotsChat",
"Community": "https://t.me/StarkBots",
"Updates": "https://t.me/pystark",
"Documentation": "https://pystark.codes/",
},
entry_points={
'console_scripts': [
Expand Down

0 comments on commit 622b8c4

Please sign in to comment.