Telegram Voice Chat UserBot made with Pyrogram and MarshalX/tgcalls with playlist and Heroku support

Overview

Telegram Voice Chat UserBot

A Telegram UserBot to Play Audio in Voice Chats.

This is also the source code of the userbot which is being used for playing DJ/Live Sets music in VC DJ/Live Sets group.

Made with tgcalls and Pyrogram Smart Plugin

It's recommended to use tgmusicbot along with this userbot.

Deploy to Heroku

Deploy

  • Session string can be exported by using Pyrogram
    # pip install Pyrogram TgCrypto
    from pyrogram import Client
    
    api_id = 1234567
    api_hash = "0123456789abcdef0123456789abcdef"
    
    with Client(":memory:", api_id, api_hash) as app, open("session.txt", "w+") as s_file:
        session_string = app.export_session_string()
        s_file.write(session_string)
        print("Session string has been saved to session.txt")
        print(session_string)
    
  • Enable the worker after deploy the project to Heroku
  • Send !join to a voice chat enabled group chat from userbot account itself or its contacts
  • Reply to an audio with /play to start playing it in the voice chat, every member of the group can use the !play and other common commands now, check !help for more commands

There are some other branchs for other plugins, you can press the "Deploy to Heroku" button there to deploy it as well.

Introduction

Features

  • Playlist, queue
  • Loop one track when there is only one track in the playlist
  • Automatically downloads audio for the first two tracks in the playlist to ensure smooth playing
  • Automatically pin the current playing track
  • Show current playing position of the audio

How to Use the Player plugin

  1. Start the userbot
  2. send !join to a voice chat enabled group chat from userbot account itself or its contacts, be sure to make the userbot account as group admin and give it at least the following permissions:
    • Delete messages
    • Manage voice chats (optional)
  3. reply to an audio with /play to start playing it in the voice chat, every member of the group can use common commands such like /play, /current and !help now.
  4. check !help for more commands

Commands

The main plugin is vc.player which has the following command commands and admin commands. After start the bot, send !join to a voice chat enabeld group chat from userbot account itself or its contacts, and then common commands like /play and /current will be available to every member of the group. send !help to check more commands.

  • Common commands, available to group members of current voice chat
  • starts with / (slash) or ! (exclamation mark)
Common Commands Description
/play reply with an audio to play/queue it, or show playlist
/current show current playing time of current track
/repo show git repository of the userbot
!help show help for commands
  • Admin commands, available to userbot account itself and its contacts
  • starts with ! (exclamation mark)
Admin Commands Description
!skip [n] ... skip current or n where n >= 2
!join join voice chat of current group
!leave leave current voice chat
!vc check which VC is joined
!stop stop playing
!replay play from the beginning
!clean remove unused RAW PCM files
!pause pause playing
!resume resume playing
!mute mute the VC userbot
!unmute unmute the VC userbot
  • Commands from other plugins, available only to userbot account itself
Plugin Commands Description
ping !ping show ping time
uptime !uptime show userbot uptime
sysinfo !sysinfo show system info

Requirements

  • Python 3.6 or higher
  • A Telegram API key and a Telegram account
  • Choose plugins you need, install dependencies which listed above and run pip install -U -r requirements.txt to install python package dependencies as well
  • FFmpeg

Run

Choose one of the two methods and run the userbot with python userbot.py, stop with CTRL+c. The following example assume that you were going to use vc.player and ping plugin, replace api_id, api_hash to your own value.

Method 1: use config.ini

Create a config.ini file

[pyrogram]
api_id = 1234567
api_hash = 0123456789abcdef0123456789abcdef

[plugins]
root = plugins
include =
    vc.player
    ping
    sysinfo

Method 2: write your own userbot.py

Replace the file content of userbot.py

from pyrogram import Client, idle

api_id = 1234567
api_hash = "0123456789abcdef0123456789abcdef"

plugins = dict(
    root="plugins",
    include=[
        "vc.player",
        "ping"
    ]
)

app = Client("tgvc", api_id, api_hash, plugins=plugins)
app.start()
print('>>> USERBOT STARTED')
idle()
app.stop()
print('\n>>> USERBOT STOPPED')

Notes

  • Read module docstrings of plugins/ you are going to use at the beginning of the file for extra notes

License

AGPL-3.0-or-later

Owner
Calls Music
A team of developers focusing on Telegram group call-related projects.
Calls Music
Embed the Duktape JS interpreter in Python

Introduction Pyduktape is a python wrapper around Duktape, an embeddable Javascript interpreter. On top of the interpreter wrapper, pyduktape offers e

Stefano 78 Dec 15, 2022
Twitter FakeNFT With Python

This project is a server that fetches your Twitter profile picture and applies the hexagonal transparency mask displayed on the profiles of users who have an NFT profile picture.

Mathis HAMMEL 29 Apr 23, 2022
:snake: A simple library to fetch data from the iTunes Store API made for Python >= 3.5

itunespy itunespy is a simple library to fetch data from the iTunes Store API made for Python 3.5 and beyond. Important: Since version 1.6 itunespy no

Fran González 56 Dec 22, 2022
Python bindings for swm-core client REST API

Python bindings for swm-core client REST API Description Sky Port is an universal bus between user software and compute resources. It can also be cons

Sky Workflows 1 Jan 01, 2022
A Superfast SMS & Call bomber for Linux And Termux

PSKR_BOMBER 💣 📱 💀 A Superfast SMS & Call bomber for Linux And Termux ! Disclaimer This tool is for educational purposes only ! Don't use this to ta

1 Dec 20, 2021
troposphere - Python library to create AWS CloudFormation descriptions

troposphere - Python library to create AWS CloudFormation descriptions

4.8k Jan 06, 2023
Advance Anonymous Sender bot with Caption Editor

AnonyMous Sender 👨‍💻 Advanced Anonymous Sender with Caption Editor Join @DaisySupport_Official 🎵 for help Features Get forwarded messages without f

Inuka Asith 13 Oct 09, 2022
Spotify Top Lists - get the current top lists of a user from the Spotify API and display them in a Flask app

Spotify Top Lists This is a simple script that will get the current top lists of a user from the Spotify API and display them in a Flask app. Requirem

Yasin 0 Oct 16, 2022
Most Simple & Powefull web3 Trade Bot (WINDOWS LINUX) Suport BSC ETH

Most Simple & Powefull Trade Bot (WINDOWS LINUX) What Are Some Pros And Cons Of Owning A Sniper Bot? While having a sniper bot is typically an advanta

GUI BOT 4 Jan 25, 2022
Python binding to the OneTimeSecret API

Thin Python binding for onetimesecret.com API. Unicode-safe. Description of API itself you can find here: https://onetimesecret.com/docs/api Usage:

Vladislav Stepanov 10 Jun 12, 2022
A fast and expressive Craigslist API wrapper

pycraigslist A fast and expressive Craigslist API wrapper. ⚠ As of September 2021, it is believed that Craigslist added a rate-limiter. It is advised

Ira Horecka 24 Dec 28, 2022
A multipurpose Telegram Bot writen in Python for mirroring files

Deepak Clouds Mirror Deepak Clouds Torrent is a multipurpose Telegram Bot writen in Python for mirroring files on the Internet to our beloved Google D

MR.SHAGGY 0 Dec 19, 2021
A Python wrapper for the tesseract-ocr API

tesserocr A simple, Pillow-friendly, wrapper around the tesseract-ocr API for Optical Character Recognition (OCR). tesserocr integrates directly with

Fayez 1.7k Jan 03, 2023
THE BEST INSTAGRAM AUTO LIKER GET MORE FOLLOWERS WITH THIS AUTOMATION

Hi 👋 , I'm Anandhu Ashok Developer making awesome things for awesome people 🚀 Connect with me: THE BEST INSTAGRAM AUTO LIKER GET MORE FOLLOWERS WITH

Anandhu Ashok 3 Jul 26, 2022
📦 Opensource Python wrapper for Hiven's REST and WebSocket API

hiven.py 📦 Opensource Python wrapper for Hiven's REST and WebSocket API Installation pip install -U hiven.py Usage hiven.py is currently under devel

Kevin Thomas 3 Sep 03, 2021
⚡TIKTOK BOT - FAST OPTIMIZED ZEFOY SCRIPT

⚡ ZEFOY [ TikTok Zefoy Bot ] Get the script in: discord.gg/onlp !! Official shop: onlp.sellix.io Newest version v.9.0.0 Requirements pip install p

Tekky 186 Dec 31, 2022
Mandatory join to channel using pyTelegramBotAPI

Running set your bot token to config.py set channel username to config.py set channel url to config.py $ python join.py Attention Bot must be administ

Abdulatif 6 Oct 08, 2022
Slack->DynamDB->Some applications

slack-event-subscriptions About The Project Do you want to get simple attendance checks? If you are using Slack, participants can just react on a spec

UpstageAI 26 May 28, 2022
Automation application was made by me using Google, Sheet and Slack APIs with Python.

README This application is used to transfer the data in the xlsx document we have to the Google Drive environment and calculate the "total budget" wit

3 Apr 12, 2022
CryptoBar - A simple MenuBar app that shows the price of 3 cryptocurrencies

CryptoBar A very simple MenuBar app that shows the price of the following crypto

4 Jul 04, 2022