Code Monkey home page Code Monkey logo

tg-groupmanagerbot's Introduction

[Telegram Bot] Group Manager

A simple telegram bot the can manage a group, it was created for an "Italian Community Group".

I published it on github so everyone can see how it was made and if someone have any suggestion can help implement it.

๐ŸŒŸ How is made ๐ŸŒŸ

It's written in python using Pyrogram, it use MongoDB as main database to store data.

๐Ÿ“š Commands ๐Ÿ“š

Staff Management

Command Args Where Comment
/Staff None Private See list of staffs
/addStaff [username | id] Private Make a user a staffer
/rmStaff [username | id] Private Remove a staffer

Groups Management

Command Arguments Where Comment
/addGroup None Group Add a group into DB
/rmGroup None Group remove a group from the db
/getLink None Group Retrive or generate a private link to the group
/revokelink None Group Revoke a link from a specific group
/revokeAll None Any Revoke all generated links from all groups
/setLog None Channel Set a channel as log channel
/unLog None Channel Remove the log channel
/globalban [Reply | id | username] Any Ban a user from all groups and channels
/globalunban [Reply | id | username] Any Unban a user from all groups and channels

Others

Command Arguments Where Comment
/permissions [Reply] Group Change a member special permission (work only if who use this command has the permission "can_promote_members"
/pin [Reply] Group Pin a message (only who has the permission to use this command, to give or take this permission use /permission)
/broadcast [Reply] Private Send a message or photo with caption to all groups. for now all buttons is in italians, I need to change it

Requirements & environment variables in config.ini

  • Mongo Database

  • Python 3+

After copying this project, create a config.ini file inside TelegramBot directory with:


[pyrogram]

api_id = API_ID

api_hash = API_HASH

bot_token = BOT_TOKEN

  

[plugins]

root = plugins

  

[database]

link = URL_TO_MONGODB

dbname = NAMEOFYOURDB

  

[creator]

id = YOUR_TELEGRAM_ACCOUNT_ID


Run in console

Run the following command outside the TelegramBot directory:


python -m TelegramBot


Run with Docker

Create an image with docker:


docker build -t botimg .

Run the image:


docker run --name TGgroupmanager botimg

Disclamer

This was a project I made a lot of time ago (mid 2020) but right now I haven't much time to continue it or update it. This project was not intended to be used with other groups other than the one is made for it should work for other groups too.

This project is not complete, but it should work, I have updated it to the new version of Pyrogram (1.0.7), and it should keep working until a new big update of Pyrogram.

If you have some problem with this project contact me on telegram @BrioStoCazz

tg-groupmanagerbot's People

Contributors

birostorm avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.