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

Commit

Permalink
PyStark v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ShivangKakkar committed Apr 6, 2022
1 parent 0d4a853 commit 647ec1e
Show file tree
Hide file tree
Showing 106 changed files with 2,677 additions and 2,292 deletions.
8 changes: 5 additions & 3 deletions .gitignore
Expand Up @@ -7,6 +7,7 @@

# Python
__pycache__/
frozen-requirements.txt

# Virtual Env
venv/
Expand All @@ -21,10 +22,11 @@ MANIFEST
tests/
/test.py
/*.env
.log
/info.txt
examples/

# Docs
docs/_build
docs/source/_local
#old_docs/_build
#old_docs/source/_local
/old_docs/
site/
10 changes: 7 additions & 3 deletions .readthedocs.yaml
Expand Up @@ -7,9 +7,13 @@ build:
tools:
python: "3.10"

sphinx:
configuration: docs/source/conf.py
builder: html
#sphinx:
# configuration: docs/source/conf.py
# builder: html

mkdocs:
configuration: mkdocs.yml
fail_on_warning: false

formats:
- pdf
Expand Down
8 changes: 4 additions & 4 deletions README.md
Expand Up @@ -15,17 +15,17 @@ There are some things that are common in most of the telegram bots. This library

## Features

1. **In-built/Default Plugins** - Any bot created using `pystark` will automatically have some commands like */start*, */help*, */about* and */id*.
1. **Addons** - Any project using `pystark` can enable in-built addons that come with pystark. For example, default addons automatically add some commands like */start*, */help*, */about* and */id*.

Of course that can be turned off using *default_plugins=False* in the main function.
Of course that can be turned off using [project settings](https://pystark.codes/start/settings)

2. **Databases** - There are in-built functions that help in using databases. The databases include `postgres`, `redis`, `tinydb` and `telegramdb`

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

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/)
To know more, about generating a boilerplate - [Click Here](https://pystark.codes/start/boilerplate/)

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

Expand Down
10 changes: 3 additions & 7 deletions boilerplate/.env
@@ -1,13 +1,9 @@
# Only for deploying locally, else delete this file


# Mandatory Vars

API_ID =
API_HASH =
BOT_TOKEN =

# Optional

OWNER_ID =
TIMEZONE = Asia/Kolkata # no need to change if you are from India as it is default

# non-mandatory
SUDO_USERS =
8 changes: 4 additions & 4 deletions boilerplate/app.json
Expand Up @@ -47,10 +47,10 @@
"required": false,
"value": ""
},
"TIMEZONE": {
"description": "Don't change if you are from India",
"SUDO_USERS": {
"description": "Sudo users separated by whitespace (' ')",
"required": false,
"value": "Asia/Kolkata"
"value": ""
}
}
}
}
5 changes: 1 addition & 4 deletions boilerplate/bot.py
@@ -1,8 +1,5 @@
# Main Script
from pystark import Stark


if __name__ == "__main__":
# Use default_plugins=False if you don't want in-built 'start, help, id and about' command.
# Use plugins = PLUGINS_FOLDER_NAME to have plugins folder with name other than 'plugins'.
# Use set_menu = False to disable auto-update of Bot Menu in telegram.
Stark().activate()
2 changes: 1 addition & 1 deletion boilerplate/requirements.txt
@@ -1 +1 @@
PyStark
PyStark==1.0.0
47 changes: 31 additions & 16 deletions boilerplate/settings.py
@@ -1,22 +1,37 @@
# Messages
# Project Configuration

START = """
Start Message
"""
START = "You started the bot" # Start Message

HELP = """
Commands
HELP = "Only you can help yourself" # Help Message

/about - About Bot
/help - Help Message
/start - Start Bot
/id - Get ID
"""
ABOUT = "About This Awesome Bot \nDeveloped using @PyStark" # About Message

ABOUT = """
About This Awesome Bot
PLUGINS = "plugins" or ["plugins"] # Path to plugins directory or List of multiple paths

Developer - @StarkProgrammer
ADDONS = [ # The addons (default plugins) you want to load from pystark

By @StarkBots
"""
"start", # /start command which replies with text in START variable. Only private chats
"help", # /help command which replies with text in HELP variable. Only private chats
"about", # /about command which replies with text in ABOUT variable. Only private chats
"id", # /id command which replies with user id and chat id.
# "sudo", # Use /sudo to show all sudo commands.
# "json", # /json command to get Message JSON and /jsondoc command to get Message JSON as document. Only owner can use them.
# "must_join", # Put usernames or chat ids where users must join in MUST_JOIN variable.
# "bans", # Use /ban to ban people from using the bot. /unban to unban. /banlist to see banned users. Needs postgresql database with table "bans"
# "broadcast", # Use /broadcast to broadcast a message to users. Needs postgresql database with table "users"
# "stats", # Use /stats to get current user stats. Needs postgresql database with table "users"

]

MUST_JOIN = [] # List of usernames or chat ids where users must join

SET_BOT_MENU = True # Set bot menu using command descriptions

CMD_PREFIXES = ["/"] # Prefixes for commands. For multiple prefixes, specify multiple together like ["&", "*", "/", "."]

TIMEZONE = "Asia/Kolkata" # Specify timezone for logging. Defaults to India (Asia/Kolkata)

DATABASE_TABLES = [ # Use them only if postgresql database is used
"users", # Needed for "stats" addon and "broadcast" addon
"bans", # Needed for "bans" addon
]
3 changes: 0 additions & 3 deletions boilerplate_starkbots/.env

This file was deleted.

2 changes: 1 addition & 1 deletion boilerplate_starkbots/.gitignore
Expand Up @@ -2,4 +2,4 @@
__pycache__/
test.py
.env
.gitattributes
.gitattributes
1 change: 1 addition & 0 deletions boilerplate_starkbots/bot.py
@@ -1,4 +1,5 @@
from pystark import Stark


if __name__ == "__main__":
Stark().activate()
21 changes: 0 additions & 21 deletions boilerplate_starkbots/database/chats_sql.py

This file was deleted.

23 changes: 0 additions & 23 deletions boilerplate_starkbots/database/users_sql.py

This file was deleted.

33 changes: 0 additions & 33 deletions boilerplate_starkbots/others/must.py

This file was deleted.

34 changes: 0 additions & 34 deletions boilerplate_starkbots/others/users.py

This file was deleted.

File renamed without changes.
6 changes: 0 additions & 6 deletions boilerplate_starkbots/plugins/stuff.py

This file was deleted.

2 changes: 1 addition & 1 deletion boilerplate_starkbots/requirements.txt
@@ -1 +1 @@
PyStark
PyStark==1.0.0
36 changes: 6 additions & 30 deletions boilerplate_starkbots/settings.py
@@ -1,35 +1,11 @@
START = """
Hey {user}
START = "do this"

Welcome to {bot}
HELP = "Help Message"

I can
Use below buttons to learn more.
ABOUT = "do this"

By @StarkBots
"""
REPO = "pystark"

HELP = """
✨ **Available Commands** ✨
DATABASE_TABLES = ["users"]

/about - About The Bot
/help - This Message
/start - Start the Bot
/id - Get your ID
"""

ABOUT = """
**About This Bot**
A telegram bot to
Source Code : [Click Here](https://github.com/StarkBotsIndustries/)
Framework : [Pyrogram](docs.pyrogram.org)
Language : [Python](www.python.org)
Developer : @StarkProgrammer
"""

BUTTONS = True
STARKBOTS = True
1 change: 1 addition & 0 deletions docs/CNAME
@@ -0,0 +1 @@
pystark.codes
14 changes: 0 additions & 14 deletions docs/Makefile

This file was deleted.

3 changes: 0 additions & 3 deletions docs/README.md

This file was deleted.

0 comments on commit 647ec1e

Please sign in to comment.