A simple Python library for creating telegram bot.
Project description
This library provides interesting opportunities for creating telegram bots. convenient syntax, decorators.
EXAMPLE USE!
import asyncio
from monsgrams import Bot
bot = Bot("")
@bot.command("start")
async def start_command(context):
chat_info = await bot.get_chat(context.chat_id)
chat_id = chat_info['result']['id']
username = chat_info['result']['username']
await bot.send_message(chat_id, f"Hello, {username}!")
@bot.command("avatar")
async def avatar_command(context):
photos_info = await bot.get_user_profile_photos(context.user_id)
print(photos_info)
file_id = photos_info['result']['photos'][-1][-1]['file_id']
print(file_id)
await bot.send_photo(context.chat_id, file_id)
async def main():
await bot.polling_loop()
if __name__ == "__main__":
asyncio.run(main())
DOCS - WRITING.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
monsgrams-1.1.tar.gz
(2.4 kB
view details)
File details
Details for the file monsgrams-1.1.tar.gz.
File metadata
- Download URL: monsgrams-1.1.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d44b23c6b7b2dd3c6a016d961a67980b023d6dbbf5c3d5fd7255c440fca7c55d
|
|
| MD5 |
0a67f2f39cf4b000bcd0a1722da06978
|
|
| BLAKE2b-256 |
1ef93c6f10d0bca8b473a0f6f3814ed34122a987853dd683c4e9ce4d225a6ffa
|