An incomplete add-on extension to Pyrogram, to create telegram bots a bit more easily

Overview

PyStark

A star from you means a lot

An incomplete add-on extension to Pyrogram, to create telegram bots a bit more easily.

Intended for personal use

I do NOT 'especially' recommend you to use it.

Installation (using pip)

Available on PyPI

pip3 install pystark

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.

  1. 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.

    To know more about postgres and redis usage in pystark - Click Here

  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.

  4. Easier - There are multiple things that make it easier.

  • Start the bot using 2-lines of code.
from pystark import Stark

Stark().activate()
  • Easier to use methods and decorators

Usage

  • Creating Boilerplate Code

You can generate a boilerplate to set up the common files you need. You can also choose to have added heroku support which will create app.json, Procfile, etc. This can be done using the command-line utility.

Run below command

pystark

cd into the directory where you want to create the boilerplate folder. Then run below command.

pystark --boilerplate

To create boilerplate with Heroku Support

pystark --boilerplate-heroku

Boilerplate folder will be created with a plugins directory and some other necessary files

  • Making Basic Changes to the folder

  1. Filling variables - Fill the mandatory values in .env file. (Step only if non-heroku boilerplate is created)
  2. Changing Text for Messages - Go to 'data.py' and change string values as it suits you.
  • Create your own plugins

You can create plugins and add it in plugins folder, and it'll be automatically loaded while starting the bot. Of course, you need Python knowledge to create awesome plugins.

# Import class 'Stark' in top of every plugin
from pystark import Stark, Message


# use 'Stark.cmd' decorator to create commands
# @Stark.cmd('name', owner_only=False, extra_filters=None, group=0) - defaults

@Stark.cmd('sample')  # or @Stark.command('sample')
async def sample_function(bot: Stark, msg: Message):
    # 'msg.react()' is 'msg.reply()' with del_in added argument
    await msg.react('This will be the reply when /sample is sent to the bot.')
  • Run the bot

Heroku - Create a repository and tap on Deploy Heroku Button. Fill the values, click deploy and wait for 2 minutes and done.

Local Deploy - Make sure you filled variables in .env as told above. Run the bot.py file using command python3 bot.py and there you go.

Credits and Library

  • Dan for his Pyrogram Library on top of which pystark works.

Community and Support

Telegram Channel - StarkBots

Telegram Chat - StarkBotsChat

Copyright and License

You might also like...
Discord spam bots with multiple account support and more
Discord spam bots with multiple account support and more

Discord spam bots with multiple account support and more. PLEASE READ EVERYTHING BEFORE WRITING AN ISSUE!! Server Messages Text Image Dm Messages Text

Pure Python 3 MTProto API Telegram client library, for bots too!

Telethon ⭐️ Thanks everyone who has starred the project, it means a lot! Telethon is an asyncio Python 3 MTProto library to interact with Telegram's A

A Telegram Repo For Devs To Controll The Bots Under Maintenance.This Bot Is For Developers, If Your Bot Is Down, Use This Repo To Give Your Dear Subscribers Some Support By Providing Them Response.
A Telegram Repo For Devs To Controll The Bots Under Maintenance.This Bot Is For Developers, If Your Bot Is Down, Use This Repo To Give Your Dear Subscribers Some Support By Providing Them Response.

Maintenance Bot A Telegram Repo For Devs To Controll The Bots Under Maintenance About This Bot This Bot Is For Developers, If Your Bot Is Down, Use Th

A Telegram Repo For Devs To Controll The Bots Under Maintenance.This Bot Is For Developers, If Your Bot Is Down, Use This Repo To Give Your Dear Subscribers Some Support By Providing Them Response.
A Telegram Repo For Devs To Controll The Bots Under Maintenance.This Bot Is For Developers, If Your Bot Is Down, Use This Repo To Give Your Dear Subscribers Some Support By Providing Them Response.

Maintenance Bot A Telegram Repo For Devs To Controll The Bots Under Maintenance About This Bot This Bot Is For Developers, If Your Bot Is Down, Use Th

Easy & powerful bot to check if your all Telegram bots are working or not. This bot status bot updates every 45 minutes & runs for 24x7 hours.
Easy & powerful bot to check if your all Telegram bots are working or not. This bot status bot updates every 45 minutes & runs for 24x7 hours.

PowerfulBotStatus-IDN-C-X Easy & powerful bot to check if your all Telegram bots are working or not. This bot status bot updates every 45 minutes & ru

Powerful spammer bots for telegram made with python and telethon.
Powerful spammer bots for telegram made with python and telethon.

Powerful spammer bots for telegram made with python and telethon. We can deploy upto 70 bots at a time.

Telegram bot to host python bots

Host-Bot Setup the api Upload the flask api on your host #its not important to do #i used it just for simple captcha system + save ids on your host!

Telegram Voice Chat Music Player UserBot Written with Pyrogram Smart Plugin and tgcalls

Telegram Voice Chat UserBot A Telegram UserBot to Play Audio in Voice Chats. This is also the source code of the userbot which is being used for playi

Telegram Voice Chat UserBot made with Pyrogram and MarshalX/tgcalls with playlist and Heroku support

Telegram Voice Chat UserBot A Telegram UserBot to Play Audio in Voice Chats. This is also the source code of the userbot which is being used for playi

Comments
  • Message.react clashes with pyrogram's Message.react

    Message.react clashes with pyrogram's Message.react

    Message.react should be renamed as it clashes with pyrogram's new method Message.react which uses Telegram new reactions thus more meaningless for pystark.

    • Come up with "meaningful" name
    • Update documentation
    enhancement 
    opened by ShivangKakkar 0
Releases(v1.1.0)
Owner
Stark Bots
You can’t cling to the past, because no matter how tightly you hold on, it’s already gone.
Stark Bots
A frame to create discord bots (for myself) that uses cogs, JSON, activities, and more.

dpy-frame A frame to create discord bots (for myself) that uses cogs, JSON, activities, and more. NOTE: Documentation is incomplete, so please wait un

Apple Discord 1 Nov 6, 2021
A Python script that exports users from one Telegram group to another using one or more concurrent user bots.

ExportTelegramUsers A Python script that exports users from one Telegram group to another using one or more concurrent user bots. Make sure to set all

Fasil Minale 17 Jun 26, 2022
Add Me To Your Group Enjoy With Me. Pyrogram bot. https://t.me/TamilSupport

SongPlayRoBot 3X Fast Telethon Based Bot ⚜ Open Source Bot ????‍?? Demo : SongPlayRoBot ???? Easy To Deploy ?? Click Below Image to Deploy DEPLOY Grou

IMVETRI 850 Dec 30, 2022
Throttle and debounce add-on for Pyrogram

pyrothrottle Throttle and debounce add-on for Pyrogram Quickstart implementation on decorators from pyrogram import Client, filters from pyrogram.type

null 7 Oct 1, 2022
This is telegram bot to generate string session for using user bots. You can see live bot in https://telegram.dog/string_session_Nsbot

TG String Session Generate Pyrogram String Session Using this bot. Demo Bot: Configs: API_HASH Get from Here. API_ID Get from Here. BOT_TOKEN Telegram

Anonymous 27 Oct 28, 2022
A Telegram bot to send messages in Telegram groups or Channels using bots anonymously.

Group-chatting-bot A bot to send messeges to group using bot telegram bot ❤️ Support Made with Python3

Pyrogramers 16 Nov 6, 2022
Telegram PHub Bot using ARQ Api and Pyrogram. This Bot can Download and Send PHub HQ videos in Telegram using ARQ API.

Tg_PHub_Bot Telegram PHub Bot using ARQ Api and Pyrogram. This Bot can Download and Send PHub HQ videos in Telegram using ARQ API. OS Support All linu

TheProgrammerCat 13 Oct 21, 2022
Telegram bot for stream music on telegram, powered by py-tgcalls and Pyrogram

Telegram Streamer Bot Telegram bot for stream music on telegram, powered by py-tgcalls and Pyrogram ✨ Features Coming soon, help me to improve it ?? C

Shohih Abdul 11 Oct 21, 2022
TgMusicBot is a telegram userbot for playing songs in telegram voice calls based on Pyrogram and PyTgCalls.

TgMusicBot [Stable] TgMusicBot is a telegram userbot for playing songs in telegram voice calls based on Pyrogram and PyTgCalls. Commands !start / !hel

Kürşad 21 Dec 25, 2022
A telegram bot script for generating session string using pyrogram and telethon on Telegram bot

String-session-Bot Telegram Bot to generate Pyrogram and Telethon String Session. A star ⭐ from you means a lot to us! Usage Deploy to Heroku Tap on a

Wahyusaputra 8 Oct 28, 2022