Skip to content

PythonNoob999/EasyTGCalls

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Easy Telegram Calls

Easy Telegram Calls is a Python library designed to simplify making calls using the Telegram API. It abstracts the complexity of interacting with Telegram's API, allowing developers to easily integrate voice and video calls into their applications.

Features

  • Simple interface to initiate/join voice and video calls on Telegram.
  • Easily configure call parameters.
  • Asynchronous.
  • Minimal dependencies for easy integration.

Installation

Not Yet Finished

Usage

Here’s an example of how to initiate a Telegram call:

from EasyTGCalls import Caller, Media, Video
from pyrogram import Client
import asyncio

async def main():
    chat_id = -1002416874723
    app = Client(":memory:", ...)
    client = Caller(app)

    # media is optional
    await client.join_call(
        chat_id=chat_id,
        media=Media(
            video=Video("video.mp3")
        )
    )

    # calls pyrogram idle
    await client.run()

asyncio.run(main())

Getting Started

Prerequisites

Calls Example

Joining voice chat

from EasyTGCalls import Caller, Media, Video
from pyrogram import Client
import asyncio

async def main():
    chat_id = -1002416874723
    app = Client(":memory:", ...)
    client = Caller(app)

    # media is optional
    await client.join_call(
        chat_id=chat_id,
        media=Media(
            video=Video("video.mp3")
        )
    )

    # calls pyrogram idle
    await client.run()

asyncio.run(main())

playing a youtube video (yt-dlp required)

from EasyTGCalls import Caller, youtube_video
from pyrogram import Client
import asyncio

async def main():
    chat_id = -1002416874723
    app = Client(":memory:", ...)
    client = Caller(app)
    video = await youtube_video("https://www.youtube.com/watch?v=xvFZjo5PgG0")

    # join & play a youtube video
    await client.join_call(
        chat_id=chat_id,
        media=video
    )

    # calls pyrogram idle
    await client.run()

asyncio.run(main())

Todo

  1. make a YoutubeVideo class to retrive youtube videos [ ]
  2. make an abstract PyroClient class (for userbot interacting) [ ]
  3. add support for private calls [ ]
  4. private call handlers [ ]
  5. add documention [ ]

Contributing

We welcome contributions! If you'd like to contribute, please fork the repository and create a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages