newthon


Namenewthon JSON
Version 1.27.9 PyPI version JSON
download
home_pagehttps://github.com/disk6969/Telethon
SummaryAn edited 1.24.0 version of the full-featured Telegram client library for Python 3
upload_time2022-09-09 21:33:10
maintainer
docs_urlNone
authorLonami Exo
requires_python>=3.5
licenseMIT
keywords telegram api chat client library messaging mtproto
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            Forked Telethon |logo|
======================
.. |logo| image:: https://github.com/LonamiWebs/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: 145       |
  +-----------------------+

About
=====

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

Email login
===========
Added `email_code` argument to `client.sign_in()` to login via code if sent to mail.

Reactions and status
====================
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.

Premium
=======
- You can send files larger that 2GiB through Telegram
- Premium users will have .premium in their user object
- Premium stickers will also have .premium that might need dealing if you don't have subscription.

spoilers and custom emoji
=========================
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.


Requests of join and events for ChatAction events
=================================================
* event.new_invite (only for bot accounts)

.. code-block:: py

    @bot.on(events.ChatAction(func=lambda e : e.new_join_request))
    async def _(event):
        event.approve_user(approved=True or False)


* event.new_approve for user accounts

.. code-block:: py

    @client.on(events.ChatAction(func=lambda e : e.new_approve))
    async def _(event):
        event.approve_user(approved=True/False)


using raw api to accept old requests
------------------------------------

- Getting them

.. code-block:: py

    result = client(functions.messages.GetChatInviteImportersRequest(
        peer="chat",
        offset_date=None, 
        offset_user=telethon.tl.types.InputUserEmpty(),
        limit=1000
    ))

- manual approve

.. code-block:: py

    for a in result:
        client(functions.messages.HideChatJoinRequestRequest(
            peer='chat or username',
            user_id='To-approve',
            approved=True or False
        ))


- batch approve: 

.. code-block:: py 

    client(functions.messages.HideAllChatJoinRequestsRequest(
        peer=entity, 
        approved=True or False
    ))

WebView Button
===============
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")

- note that webapp keyboard can be only a single button, it won't allow others with it.

.. code-block:: py

    client.send_message(chat, "YouTube", buttons=Button.web("google", "https://YouTube.com", inline=False)

Content privacy
===============
``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)

links in get message
====================
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 

iter_participant
================
aggressive True will sleep by default.
its sleep value can be adjusted using the sleep parameter, this will make it sleep for that specified amount before processing next chunk.

.. code-block:: py 

    client.get_participant(chat, aggressive=True, sleep=2)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/disk6969/Telethon",
    "name": "newthon",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.5",
    "maintainer_email": "",
    "keywords": "telegram api chat client library messaging mtproto",
    "author": "Lonami Exo",
    "author_email": "totufals@hotmail.com",
    "download_url": "https://github.com/LonamiWebs/Telethon/releases",
    "platform": null,
    "description": "Forked Telethon |logo|\n======================\n.. |logo| image:: https://github.com/LonamiWebs/Telethon/raw/master/logo.svg\n    :width: 60pt\n    :height: 60pt\n\n`\u2197\ufe0f Updated tl.telethon.dev <https://disk6969.github.io/Telethon>`_\n\n.. code-block:: py\n\n  +-----------------------+\n  |   Telethon 1.24.0     |\n  +-----------------------+\n  |      layer: 145       |\n  +-----------------------+\n\nAbout\n=====\n\nA simple clone of the awesome Telegram MTproto client version 1.24.0 but with up to date components, \nYou do not have to change previous code with telethon, as there are no breaking changes.\n\ninstall: (if any issues, try uninstalling telethon first):\n\n.. code-block:: py\n\n  pip install -U newthon\n\nEmail login\n===========\nAdded `email_code` argument to `client.sign_in()` to login via code if sent to mail.\n\nReactions and status\n====================\nAdded `client.set_status(document_id, until)` for premium accounts' `CustomEmoji` in profile.\nAdded `add_to_recent` argument for reactions.\n\nAbout reactions:\n\n.. code-block:: py\n\n    client.send_reaction(chat, message, \"\ud83d\ude22\")\n\nor shorter:\n\n.. code-block:: py\n\n    message.react(\"\ud83d\ude01\", big=True)\n\nReactions with large animation (for pms) `big=True`.\nTo remove a reaction use `message.react(remove=True)`, and, to add a react to recents too, use `add_to_recent` as True.\n\nPremium\n=======\n- You can send files larger that 2GiB through Telegram\n- Premium users will have .premium in their user object\n- Premium stickers will also have .premium that might need dealing if you don't have subscription.\n\nspoilers and custom emoji\n=========================\nUse `||Text||` to create spoilers, for HTML use `<tg-spoiler>Text</tg-spoiler>`\nto create a customEmoji markdown use `<emoji id=\"5373101475679443553\">\ud83d\ude09</emoji>`.\nthe id being the document id of any CustomEmoji Document.id in its pack.\n\n\nRequests of join and events for ChatAction events\n=================================================\n* event.new_invite (only for bot accounts)\n\n.. code-block:: py\n\n    @bot.on(events.ChatAction(func=lambda e : e.new_join_request))\n    async def _(event):\n        event.approve_user(approved=True or False)\n\n\n* event.new_approve for user accounts\n\n.. code-block:: py\n\n    @client.on(events.ChatAction(func=lambda e : e.new_approve))\n    async def _(event):\n        event.approve_user(approved=True/False)\n\n\nusing raw api to accept old requests\n------------------------------------\n\n- Getting them\n\n.. code-block:: py\n\n    result = client(functions.messages.GetChatInviteImportersRequest(\n        peer=\"chat\",\n        offset_date=None, \n        offset_user=telethon.tl.types.InputUserEmpty(),\n        limit=1000\n    ))\n\n- manual approve\n\n.. code-block:: py\n\n    for a in result:\n        client(functions.messages.HideChatJoinRequestRequest(\n            peer='chat or username',\n            user_id='To-approve',\n            approved=True or False\n        ))\n\n\n- batch approve: \n\n.. code-block:: py \n\n    client(functions.messages.HideAllChatJoinRequestsRequest(\n        peer=entity, \n        approved=True or False\n    ))\n\nWebView Button\n===============\nYou can input a web bot button as an inline button or a keyboard button, sine it can be both.\nthe default is inline button, you can use the inline=False to use it in a keyboard button\n\n.. code-block:: py\n\n    from telethon import Button\n    client.send_message(chat, \"Open Google\", buttons=Button.web(\"google\", \"https://google.com\")\n\n- note that webapp keyboard can be only a single button, it won't allow others with it.\n\n.. code-block:: py\n\n    client.send_message(chat, \"YouTube\", buttons=Button.web(\"google\", \"https://YouTube.com\", inline=False)\n\nContent privacy\n===============\n``chat.noforwards`` will return True for chats with forward restriction enabled, same applies to bot messages with ``message.noforwards``\nYou can use the argument ``noforwards=True`` in sender methods.\n\n.. code-block:: py\n\n    client.send_message(chat, \"lonami is god\", noforwards=True)\n\nlinks in get message\n====================\nyou can now get a single message using the link in get/iter_messages.\n\n``client.get_messages(\"https://t.me/username/1\")``\n\nThe message object will also have .link attribute, which will return link of the message \n\niter_participant\n================\naggressive True will sleep by default.\nits sleep value can be adjusted using the sleep parameter, this will make it sleep for that specified amount before processing next chunk.\n\n.. code-block:: py \n\n    client.get_participant(chat, aggressive=True, sleep=2)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "An edited 1.24.0 version of the full-featured Telegram client library for Python 3",
    "version": "1.27.9",
    "split_keywords": [
        "telegram",
        "api",
        "chat",
        "client",
        "library",
        "messaging",
        "mtproto"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "5719a0836c313c22278b0509efc980b3",
                "sha256": "3861973009474c4fb259109ea54feca7d996dd80a86cf10d52ddeda851abc2c2"
            },
            "downloads": -1,
            "filename": "newthon-1.27.9-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5719a0836c313c22278b0509efc980b3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.5",
            "size": 2729275,
            "upload_time": "2022-09-09T21:33:10",
            "upload_time_iso_8601": "2022-09-09T21:33:10.162885Z",
            "url": "https://files.pythonhosted.org/packages/ef/83/0c280c7044246e2737a94a056cee48ce14939647453c90b76d69385c9957/newthon-1.27.9-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-09-09 21:33:10",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "disk6969",
    "github_project": "Telethon",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "requirements": [],
    "lcname": "newthon"
}
        
Elapsed time: 0.40907s