Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
.. |logo| image:: https://github.com/Disk6969/Telethon/raw/master/logo.svg :width: 60pt :height: 60pt
↗️ Updated tl.telethon.dev <https://disk6969.github.io/Telethon>
_
.. code-block:: py
+-----------------------+ | Telethon 1.24.0 | +-----------------------+ | layer: 148 | +-----------------------+
A simple clone of the awesome Telegram MTproto client version 1.24.0 but with up to date components, You do not have to change previous code with telethon, as there are no breaking changes.
install: (if any issues, try uninstalling telethon first):
.. code-block:: py
pip install -U newthon
Added email_code
argument to client.sign_in()
to login via code if sent to mail.
Added client.set_status(document_id, until)
for premium accounts' CustomEmoji
in profile.
Added add_to_recent
argument for reactions.
About reactions:
.. code-block:: py
client.send_reaction(chat, message, "😢")
or shorter:
.. code-block:: py
message.react("😁", big=True)
Reactions with large animation (for pms) big=True
.
To remove a reaction use message.react(remove=True)
, and, to add a react to recents too, use add_to_recent
as True.
Use ||Text||
to create spoilers, for HTML use <tg-spoiler>Text</tg-spoiler>
to create a customEmoji markdown use <emoji id="5373101475679443553">😉</emoji>
.
the id being the document id of any CustomEmoji Document.id in its pack.
.. code-block:: py
@bot.on(events.ChatAction(func=lambda e : e.new_join_request))
async def _(event):
event.approve_user(approved=True or False)
.. code-block:: py
@client.on(events.ChatAction(func=lambda e : e.new_approve))
async def _(event):
event.approve_user(approved=True/False)
.. code-block:: py
result = client(functions.messages.GetChatInviteImportersRequest(
peer="chat",
offset_date=None,
offset_user=telethon.tl.types.InputUserEmpty(),
limit=1000
))
.. code-block:: py
for a in result:
client(functions.messages.HideChatJoinRequestRequest(
peer='chat or username',
user_id='To-approve',
approved=True or False
))
.. code-block:: py
client(functions.messages.HideAllChatJoinRequestsRequest(
peer=entity,
approved=True or False
))
You can input a web bot button as an inline button or a keyboard button, sine it can be both. the default is inline button, you can use the inline=False to use it in a keyboard button
.. code-block:: py
from telethon import Button
client.send_message(chat, "Open Google", buttons=Button.web("google", "https://google.com")
.. code-block:: py
client.send_message(chat, "YouTube", buttons=Button.web("google", "https://YouTube.com", inline=False)
chat.noforwards
will return True for chats with forward restriction enabled, same applies to bot messages with message.noforwards
You can use the argument noforwards=True
in sender methods.
.. code-block:: py
client.send_message(chat, "lonami is god", noforwards=True)
You can now get a single message using the link in get/iter_messages.
client.get_messages("https://t.me/username/1")
The message object will also have .link attribute, which will return link of the message
Added client.get_gallery(message), which fetches all the grouped messages belonging to it.
.. code-block:: py
client.get_participant(chat, aggressive=True, sleep=2)
FAQs
An edited 1.24.0 version of the full-featured Telegram client library for Python 3
We found that newthon demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.