Files
plain-ub-overfork/README.md
overspend1 8fe355ed0c Update README and alive command for @overspend1 fork
- Updated README title to show OVERSPEND1 FORK
- Changed maintainer credit to @overspend1
- Updated alive command to show @overspend1 as creator instead of Meliodas
2025-07-25 20:27:05 +02:00

2.4 KiB

PLAIN UB - OVERSPEND1 FORK

Header Image Header Image

A simple Telegram User-Bot.

Forked and maintained by @overspend1

Example Plugins:

  • Basic Plugin:
from app import BOT, bot, Message

@bot.add_cmd(cmd="test")
async def test_function(bot: BOT, message: Message):
    await message.reply("Testing....")
    """Your rest of the code."""
    
  • Plugin with Multiple Commands:
    Instead of stacking @add_cmd you can pass in a list of command triggers.
from app import BOT, bot, Message

@bot.add_cmd(cmd=["cmd1", "cmd2"])
async def test_function(bot: BOT, message: Message):
    if message.cmd=="cmd1":
        await message.reply("cmd1 triggered function")
    """Your rest of the code."""
    
  • Plugin with DB access:
from app import BOT, bot, Message, CustomDB

TEST_COLLECTION = CustomDB["TEST_COLLECTION"]

@bot.add_cmd(cmd="add_data")
async def test_function(bot: BOT, message: Message):
    async for data in TEST_COLLECTION.find():
        """Your rest of the code."""
    # OR
    await TEST_COLLECTION.add_data(data={"_id":"test", "data":"some_data"})
    await TEST_COLLECTION.delete_data(id="test")
  • Conversational Plugin:
    • Bound Method

      from pyrogram import filters
      from app import BOT, bot, Message
      @bot.add_cmd(cmd="test")
      async def test_function(bot: BOT, message: Message):
          response = await message.get_response(
              filters=filters.text&filters.user([1234]), 
              timeout=10,
          )
          # Will return First text it receives in chat where cmd was ran
          """ rest of the code """
      
      
    • Conversational

      from app import BOT, bot, Message, Convo
      from pyrogram import filters
      
      @bot.add_cmd(cmd="test")
      async def test_function(bot: BOT, message: Message):
          async with Convo(
              client=bot, 
              chat_id=1234, 
              filters=filters.text, 
              timeout=10
          ) as convo:
              await convo.get_response(timeout=10)
              await convo.send_message(text="abc", get_response=True, timeout=8)
              # and so on