KeralaBots / TGramBot

TGramBot is a partially auto-generated and asynchronous Minimal Telegram Bot API framework in Python for bots

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TGramBot

TGramBot is a partially auto-generated and asynchronous Minimal Telegram Bot API framework in Python for bots

This library is inspired by a number of other libraries:

Special thanks to Paul Larsen for his libraries

This Library is still in its Alpha phase

Most of the methods and types using in this library are auto-generated by scraping the official documentation of Telegram Bot Api

So the chance of getting bugs and errors are high. So please let us know through the issue section about the bug you have encountered.

Installing..

pip3 install tgrambot

Example

import asyncio

from tgrambot import Bot
from tgrambot.filters import Filters
from tgrambot.types import Message
from tgrambot.text import Italic


bot = Bot("token", workers=50, parse_mode='MarkdownV2')

@bot.on_message(Filters.command('start'))
async def start_bot(c: Bot, m: Message):
    await c.send_message(m.chat.id, Italic("Hola Amigo!"))

async def main():
    await bot.run()

if __name__ == '__main__':
    loop = asyncio.get_event_loop()
    loop.run_until_complete(main())

Examples

More examples are published in the example directory

About

TGramBot is a partially auto-generated and asynchronous Minimal Telegram Bot API framework in Python for bots

License:GNU General Public License v3.0


Languages

Language:Python 100.0%