Skip to main content

📦 Oxgram

telegram badge telegram badge telegram badge

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.19

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for oxgram 0.0.19
File Size Uploaded
oxgram-0.0.19.tar.gz 7.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for oxgram 0.0.19
File Interpreter ABI Platform
oxgram-0.0.19-py3-none-any.whl Python 3 none any Details

Total release size: 17.4 kB

Release files / oxgram-0.0.19.tar.gz

Download URL oxgram-0.0.19.tar.gz
Size 7.3 kB
Tags Source
SHA-256 checksum
How to use checksums
ce82246f2caa31a7ffe4b63952675a4022108913592832c0e8d1f5a915025857
BLAKE2b-256 checksum
How to use checksums
08c4192ec2763f5c64c80c26217c65a634196ff4b6269aecd34e69210101c4c9
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.19-py3-none-any.whl

Download URL oxgram-0.0.19-py3-none-any.whl
Size 10.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ebde817426a3f21b84b70b42b54192a24f8d3735788ec45e8dd0b251d0ed9ca9
BLAKE2b-256 checksum
How to use checksums
e7113af3435d7ef448bc3dbf4112c370203db9bbcfb8b501fc90c0c8fb4982dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

0.0.25

2 release files

0.0.24

2 release files

0.0.23

2 release files

0.0.22

2 release files

0.0.21

2 release files

0.0.20

2 release files

This release

0.0.19 This release

2 release files

0.0.16

2 release files

0.0.15

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page