📦 Oxgram
from Oxgram.functions import Pyrogram
dcid = await Pyrogram.get01(update)
print(dcid)
from pyrogram import Client, filters
from pyrogram.types import (InlineKeyboardMarkup, InlineKeyboardButton)
from Oxgram.pyromod.types import ListenerTypes
from Oxgram.pyromod.exceptions import ListenerStopped
app = Client(
"my_bot",
api_id=123456,
api_hash="YOUR_API_HASH",
bot_token="YOUR_BOT_TOKEN"
)
@app.on_message(filters.command("start"))
async def start(client, message):
keyboard = InlineKeyboardMarkup(
[
[
InlineKeyboardButton(
"❌ Cancel",
callback_data="cancel_listen"
)
]
]
)
msg = await message.reply("Send me a message:", reply_markup=keyboard)
try:
result = await client.listen(
listener_type=ListenerTypes.MESSAGE,
chat_id=message.chat.id,
user_id=message.from_user.id,
)
await msg.edit_text(f"✅ Received:\n\n{result.text}")
except ListenerStopped:
await msg.edit_text("❌ Listening cancelled.")
@app.on_callback_query(filters.regex("^cancel_listen$"))
async def cancel_listen(client, callback_query):
await callback_query.answer("Cancelling...")
await client.stop_listening(
listener_type=ListenerTypes.MESSAGE,
chat_id=callback_query.message.chat.id,
user_id=callback_query.from_user.id,
)
app.run()
Metadata
Release files for oxgram 0.0.17
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| oxgram-0.0.17.tar.gz | 7.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| oxgram-0.0.17-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.0 kB
Release files / oxgram-0.0.17.tar.gz
| Download URL | oxgram-0.0.17.tar.gz |
|---|---|
| Size | 7.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8e9dad9085999062c954ee3a8b09474957a72a0777bf1cd124a061f211945895
|
|
BLAKE2b-256 checksum How to use checksums |
283c674db7db0006474abc9b7546443522b8428e1a92d65ae43083a0f1d44784
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / oxgram-0.0.17-py3-none-any.whl
| Download URL | oxgram-0.0.17-py3-none-any.whl |
|---|---|
| Size | 9.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
776775c4996e352601bfcabf3bea0b64e3982fb510d602716792d88463da93a4
|
|
BLAKE2b-256 checksum How to use checksums |
2d51bdbf88b0d1a98c30bb1374c6f5debe0ee725a78d11e3d599f8b096b4bdae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|