Telethon-Patch
- A Wrap over Telethon (Telegram MtProto Library) with additional features.
Installation
pip install telethon-patch
Usage
- To make telethon-patch to do it's work, add this lines before creating TelegramClient
import telethonpatch
Features
Use any Function without Import
await client.SendReactionRequest("chat", msg.id, reaction="👍")
# or (Without 'Request' prefix)
await client.SendReaction(chat, msg.id, reaction="👍")
Send Button linked to User's profile
from telethon.tl.types import Button
user = await client.get_input_entity("me")
button = Button.mention("Open Profile", user)
await client.send_message("username", "Hey!, Message with mention Button", buttons=button)
Chat Join Requests (In Detail)
from telethon import events
@client.on(events.JoinRequest())
async def example(event):
## Approve - User
await event.approve()
## Disapprove user
await event.reject()
# or print Info of the user.
print(await event.get_user())
Group Call Event (In Detail)
@client.on(events.GroupCall())
async def groupcall(group_call):
if group_call.started:
print("Group Call Started!")
return
if group_call.ended:
print("Group Call Ended!")
Message Extensions
message.message_link-Message link of message.message.comment()- Bound method to comment on channel or thread message.message.react()- Bound method to react on messages.
Friendly Methods like
Group call
- client.start_group_call
- client.join_group_call
- client.leave_group_call
- client.discard_group_call
- client.get_group_call
Reaction
- client.send_reaction
(Topics)
- client.create_topic
- client.edit_topic
- client.get_topics
- client.join_chat
(misc)
- client.toggle_hidden
- client.read (instead of send_read_acknowledge)
(Photos)
- client.set_profile_photo
- client.set_contact_photo
Events
events.GroupCall
- Occurs when certain action related to group call happens.
started- Group call started.ended- Group call ended.scheduled- Whether a Group call has been scheduled.
Methods
.start(title, rtmp_stream, schedule)- Start a group call.discard()- End group call..toggle_record(start, video, video_portrait, title)- Toggle group call record.
events.JoinRequest
- Occurs when new chat join request is sent.
.invite- ExportedChatInvite related to join request.about- User's about.
Methods
.approve()- Approve chat join request of user..reject()- Reject chat join request..get_user()- Get user sending request.
Example of full functioning bot can be find in examples
Metadata
Release files for telethon-patch 0.3.1
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 |
|---|---|---|---|---|
| telethon-patch-0.3.1.tar.gz | 18.3 kB | Without provenance | Details for telethon-patch-0.3.1.tar.gz |
Release files / telethon-patch-0.3.1.tar.gz
| Download URL | telethon-patch-0.3.1.tar.gz |
|---|---|
| Size | 18.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2c779b82db559e7e7b098bb5a5310d6e67db57fbaeda50b1b53ba4c5cef7afed
|
|
BLAKE2b-256 checksum How to use checksums |
3384cb53302acc807f846283305c4c4b529a448dd82987704e8391b5ee9f1eb3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.2
|
Security for telethon-patch 0.3.1
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.