Coder Social home page Coder Social logo

sejjax / aiogram Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aiogram/aiogram

0.0 0.0 0.0 4.63 MB

Is a pretty simple and fully asynchronous framework for Telegram Bot API written in Python 3.7 with asyncio and aiohttp.

Home Page: https://aiogram.dev

License: MIT License

Python 99.82% Makefile 0.09% HTML 0.09%

aiogram's Introduction

AIOGram

Financial Contributors on Open Collective [Telegram] aiogram live PyPi Package Version PyPi status Downloads Supported python versions Telegram Bot API Documentation Status Github issues MIT License

aiogram is a pretty simple and fully asynchronous framework for Telegram Bot API written in Python 3.7 with asyncio and aiohttp. It helps you to make your bots faster and simpler.

Examples

๐Ÿ“š Click to see some basic examples

Few steps before getting started...

  • First, you should obtain token for your bot from BotFather.
  • Install latest stable version of aiogram, simply running pip install aiogram

Simple getMe request

import asyncio
from aiogram import Bot

BOT_TOKEN = ""

async def main():
    bot = Bot(token=BOT_TOKEN)

    try:
        me = await bot.get_me()
        print(f"๐Ÿค– Hello, I'm {me.first_name}.\nHave a nice Day!")
    finally:
        await bot.close()

asyncio.run(main())

Poll BotAPI for updates and process updates

import asyncio
from aiogram import Bot, Dispatcher, types

BOT_TOKEN = ""

async def start_handler(event: types.Message):
    await event.answer(
        f"Hello, {event.from_user.get_mention(as_html=True)} ๐Ÿ‘‹!",
        parse_mode=types.ParseMode.HTML,
    )

async def main():
    bot = Bot(token=BOT_TOKEN)
    try:
        disp = Dispatcher(bot=bot)
        disp.register_message_handler(start_handler, commands={"start", "restart"})
        await disp.start_polling()
    finally:
        await bot.close()

asyncio.run(main())

Moar!

You can find more examples in examples/ directory

Official aiogram resources:

Contributors

Code Contributors

This project exists thanks to all the people who contribute. [Code of conduct].

Financial Contributors

Become a financial contributor and help us sustain our community. [Contribute]

Individuals

Organizations

Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]

aiogram's People

Contributors

jrootjunior avatar olegt0rr avatar mahenzon avatar birdi7 avatar gabbhack avatar uburuntu avatar arsnotfound avatar goduni avatar evgfilim1 avatar arwichok avatar kylmakalle avatar mastergroosha avatar senpos avatar uwinx avatar forden avatar whitememory99 avatar darksidecat avatar abstract-x avatar fenicu avatar vasya-polyansky avatar unintended avatar samuelfirst avatar mykolasolodukha avatar limio avatar latand avatar ars2014 avatar bobronium avatar andrew000 avatar monosans avatar monkeywithacupcake avatar

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.