https://github.com/mastercruelty/my-tg-app
Several scripts for a Telegram user bot made in python. Based on Pyrogram
https://github.com/mastercruelty/my-tg-app
commands pyrogram python scripting telegram telegram-bot-api telegram-userbot
Last synced: about 1 year ago
JSON representation
Several scripts for a Telegram user bot made in python. Based on Pyrogram
- Host: GitHub
- URL: https://github.com/mastercruelty/my-tg-app
- Owner: MasterCruelty
- License: mit
- Created: 2020-10-08T13:53:38.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-01-07T23:17:27.000Z (over 1 year ago)
- Last Synced: 2025-03-29T02:51:29.191Z (about 1 year ago)
- Topics: commands, pyrogram, python, scripting, telegram, telegram-bot-api, telegram-userbot
- Language: Python
- Homepage:
- Size: 205 KB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

[](https://github.com/MasterCruelty/my-tg-app/stargazers)
[](https://github.com/MasterCruelty/my-tg-app/network/members)

[](https://github.com/MasterCruelty/my-tg-app/issues)



# my-tg-app
**IT/ENG**
# **[IT]**
# Come impostare
Per un corretto funzionamento è necessario compilare a dovere il file ```config.json```. Quindi è necessario essere in possesso dei seguenti dati:
* Api keys di Telegram: ```api_id``` e ```api_hash```. Puoi generarle da [qui](https://my.telegram.org/apps)
* Api url atm se si vogliono usare le loro api: ```api_url``` e ```api_get```. (Non essendo pubbliche non le condividerò)
* I dati telegram dell'amministratore del bot: ```id_super_admin```.
* Il percorso dove si trova il file .db: ```path_db```.
* Nome della sessione: ```session_name```.
* I nomi dei comandi utente, admin e superadmin: ```user_commands```, ```admin_commands``` e ```super_admin_commands```.
I dati del super admin servono a colui che potrà usare le funzioni di interazione con il database e altre funzioni particolari.
I nomi dei comandi da inserire nel ```config.json``` possono essere ricopiati dal codice oppure possono essere modificati sul codice e poi ricopiati nel file json.
### Come funzionano i comandi utente dello userbot
Il funzionamento dei comandi è spiegato all'interno del file ```help.json```. Si tratta del file che viene usato dallo userbot per rispondere al comando ```/help ```.
Le spiegazioni sono in Italiano, ma volendo si possono tradurre in qualsiasi lingua sostituendo i campi della struttura dati oppure addirittura renderlo multilingua, ma in quel caso c'è da sviluppare la componente che rende possibile il cambio di lingua.
### Come funzionano i comandi admin e super
* registrare un nuovo utente: ```/setuser```
* registrare un nuovo admin: ```/setadmin```
* cancellare un utente: ```/deluser```
* revocare i privilegi admin: ```/deladmin``` (l'utente sarà comunque ancora tra i registrati ma senza i poteri admin)
* mostrare tutti gli utenti registrati: ```/listuser```
* mostrare il numero di utenti registrati: ```/alluser```
* verificare se il bot è online: ```/ping```
* inviare un file dalla macchina locale: ```/send``` 'path'
* eseguire un file bash dalla macchina locale: ```/exec``` 'path'
### Dipendenze
* Pyrogram
* geopy
* bs4
* wikipedia
* wikipedia-api
* utils_config
* openrouteservice
* gtts
* peewee
### Progetti esterni usati
* [Pyrogram](https://github.com/pyrogram/pyrogram)
* [Covid19 dati Italiani sui casi](https://github.com/pcm-dpc/COVID-19)
* [Geopy](https://github.com/geopy/geopy)
* [Wikipedia wrapper](https://github.com/goldsmith/Wikipedia)
* [Another Wikipedia wrapper](https://github.com/martin-majlis/Wikipedia-API)
* [Peewee](https://github.com/coleifer/peewee)
# **[ENG]**
# How to setup
The correct way to setup this bot is to compile the file ```config.json```. So it's necessary to have these data:
* Telegram api keys: ```api_id``` e ```api_hash```. You can generate them [here](https://my.telegram.org/apps)
* Atm api url if you wanna use their api: ```api_url``` e ```api_get```. (The api are not public so I won't share them here)
* Telegram data of the owner of the bot: ```id_super_admin```.
* The path where is the .db file: ```path_db```.
* The session name: ```session_name```.
* Name of user commands, admin commands and super admin commands: ```user_commands```, ```admin_commands``` e ```super_admin_commands```.
Data of super admin is needed because he's the only one who can use db functions and other special functions.
Name of commands to put inside ```config.json``` can be copied from source code or renamed inside source code and then copied in json file.
### How the userbot's commands works
The features of the commands are explained inside ```help.json```. It is the file which is used by the userbot to reply at ```/help ```.
This json file is only in Italian, but you can translate it in every languages by changing the correct fields with your translations or even making the userbot multi-language but in that case you have to develop the component for change the language runtime.
### How the admin/super commands works
* register a new user: ```/setuser```
* register a new admin: ```/setadmin```
* delete a user: ```/deluser```
* delete an admin: ```/deladmin``` (it will just revoke the admin power, it doesn't delete the user)
* How to list all user registered: ```/listuser```
* How to show ho many users are registered: ```/alluser```
* check if the bot is online: ```/ping```
* send a file from local machine: ```/send``` 'path'
* execute a bash file from your local machine: ```/exec``` 'path'
### Dependencies
* Pyrogram
* geopy
* bs4
* wikipedia
* wikipedia-api
* utils_config
* openrouteservice
* gtts
* peewee
### External projects used
* [Pyrogram](https://github.com/pyrogram/pyrogram)
* [Covid19 cases Italian data](https://github.com/pcm-dpc/COVID-19)
* [Geopy](https://github.com/geopy/geopy)
* [Wikipedia wrapper](https://github.com/goldsmith/Wikipedia)
* [Another Wikipedia wrapper](https://github.com/martin-majlis/Wikipedia-API)
* [Peewee](https://github.com/coleifer/peewee)
* [Peewee](https://github.com/coleifer/peewee)