GithubHelp home page GithubHelp logo

keralabots / tgrambot Goto Github PK

View Code? Open in Web Editor NEW
22.0 1.0 2.0 421 KB

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

License: GNU General Public License v3.0

Python 100.00%
httpx telegram telegram-bot autogeneration hacktoberfest

tgrambot's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.