A simple example of a bot that will repeat after the user
from aiotele import Bot
from aiotele.types import MessageObject, CommandObject
import asyncio
TOKEN = "YOU_TOKEN"
bot = Bot(TOKEN)
@bot.message_handler()
async def repeat(msg: MessageObject, command: CommandObject):
await msg.reply(f"I don't know such a command!")
async def main():
await bot.run()
asyncio.run(main())
deleting webhook
async def main():
await bot.delete_webhook(True)
await bot.run()
To check whether a new user has joined or not
from aiotele import JOIN_TRANSITION
from aiotele.types import NewChatMember
@bot.chat_member(JOIN_TRANSITION)
async def new_chat_member(new_member: NewChatMember):
await new_member.answer(f"Hello {new_member.new_member.full_name}! Added you {new_member.old_member.full_name}!")
To check whether a user has logged out or not
from aiotele import LEAVE_TRANSITION
from aiotele.types import LeaveChatMember
@bot.chat_member(LEAVE_TRANSITION)
async def leave_chat_member(leave_member: LeaveChatMember):
await leave_member.reply(f"Bye {leave_member.leave_member.full_name}!")
Check whether the bot has been added to the group or not
from aiotele import JOIN_TRANSITION
from aiotele.types import NewChatMember
@bot.my_chat_member(JOIN_TRANSITION)
async def bot_join_chat_member(new_member: NewChatMember):
await new_member.answer(f"Thank you for adding me to the chat. {new_member.old_member.full_name}!")
Metadata
Release files for AioTele 0.1.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aiotele-0.1.8.tar.gz | 12.2 kB | Without provenance | Details for aiotele-0.1.8.tar.gz |
Release files / aiotele-0.1.8.tar.gz
| Download URL | aiotele-0.1.8.tar.gz |
|---|---|
| Size | 12.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e137cbc17ae13fc180f62b0f80fd9b3a85a3f1609e7d90d791feac3420b5eb3a
|
|
BLAKE2b-256 checksum How to use checksums |
566ca39ecfe5e7d893b68d8917ff747046e32baf5f01778a7bca97de5a55aae6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.1
|
Security for AioTele 0.1.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.