项目作者: athphane

项目描述 :
Telegram Userbot built with Pyrogram
高级语言: Python
项目地址: git://github.com/athphane/userbot.git
创建时间: 2019-10-18T18:23:43Z
项目社区:https://github.com/athphane/userbot

开源协议:GNU General Public License v3.0

下载


Pyrogram Userbot

Python Version
Repo Size
Commit Activity
Codacy Badge
HitCount
Contributors
Last Commit
Issues
Pull Requests
License

A Telegram Userbot based on Pyrogram

This repository contains the source code of a Telegram Userbot and the instructions for running a
copy yourself. Beside its main purpose, the bot is featuring Pyrogram Asyncio and
Smart Plugins; feel free to explore the source code to
learn more about these topics.

I assume you will read this whole README.md file before continuing.

Requirements

You’re gonna need to get the following programs and services either installed on your server
or signed up for. You must do all. It is a cardinal sin if you don’t.

  • Python 3.10 (requirements were generated for 3.10. Python 3.8 is supported from the looks of it.)
  • virtualenv installed so that the packages don’t interfere with other system packages.

  • MongoDB on your server or a free server from
    MongoDB Atlas. (I recommend Atlas as I used it during
    development with no issues.)

  • carbon-now-cli on your server too generate code images for the
    carbon.py module. I use this CLI tool cause I don’t know and couldn’t get selenium
    and chromedriver to work nicely on my server/code. I’ll be nice and even give you the command to install this.
    I assume you already have NPM installed.

    1. Windows: npm install -g carbon-now-cli
    2. Linux: sudo npm install -g carbon-now-cli --unsafe-perm=true --allow-root
    3. MacOS: I assume almost the same as linux ¯\_(ツ)_

Installation and Deployment

The way I deploy

  1. git clone https://github.com/athphane/userbot.git
  2. cd userbot
  3. virtualenv venv
  4. source venv/bin/activate
  5. pip install -r requirements.txt
  6. python -m userbot

Using docker

  • Save the following content as docker-compose.yml
    ```yml
    version: ‘3.5’
    services:
    userbot:
    hostname: userbot
    volumes:
    1. - ./config:/root/userbot/config
    image: ghcr.io/athphane/userbot:latest
  1. - First run:
  2. ```bash
  3. docker compose run --rm userbot python -m userbot
  • Configure userbot and stop container CTRL+C
  • Run the container again de-attached:
    1. docker compose up -d

    Spotify integration

    To get the Spotify commands working on the Userbot, you need to get a CLIENT_ID and CLIENT_SECRET
    form the Spotify Developer Portal and add
    them into your userbot.ini file.

On the Spotify developer portal, make sure to set your application Redirect URI to
http://localhost:8888/callback‘.

Now is a good time
Then go ahead and run the command python spotify.py
in the projects root directory.

This will create a file called .cache-yourusername. You need to transfer this file to the
project root of the server that will be running your userbot. This is a one time setup.

Known issues

Star History





Star History Chart

Credits, and Thanks to


Made with love from the Maldives ❤