Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Forichok/TelegramOnlineSpy
Simple telegram online spy logger bot
https://github.com/Forichok/TelegramOnlineSpy
bot logger monitoring online spy telegram telethon tracker
Last synced: about 1 month ago
JSON representation
Simple telegram online spy logger bot
- Host: GitHub
- URL: https://github.com/Forichok/TelegramOnlineSpy
- Owner: Forichok
- License: mpl-2.0
- Created: 2019-11-06T14:44:56.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-05-22T06:08:00.000Z (over 2 years ago)
- Last Synced: 2024-08-03T01:16:15.013Z (4 months ago)
- Topics: bot, logger, monitoring, online, spy, telegram, telethon, tracker
- Language: Python
- Homepage:
- Size: 148 KB
- Stars: 368
- Watchers: 25
- Forks: 82
- Open Issues: 28
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- Awesome-Telegram-OSINT - TelegramOnlineSpy
README
# Telegram online status logger bot.
> "I solemnly swear that I am up to no good."
>
> ~ Harry Potter UniverseUses Telethon library to check online status and if it was changed.
If changes are detected, a bot will send you a message.---
## How it works
The `spy.py` will host a bot that you can interact with.
On Telegram you chat with the bot and through the bot commands you add/remove users on the monitoring list.![bot-screenshot-1.png](bot-screenshot-1.png)
The bot will message you, if any of the users on the list changed their online status.
![bot-screenshot-2.png](bot-screenshot-2.png)
## Install
` pip install telethon`
## SetupCreate your telegramm application on https://my.telegram.org/apps and replace API_HASH, API_ID with yours.
```
API_HASH = 'your api hash'
API_ID = 'yuor api id'
BOT_TOKEN = "your bot token"
USER_NAME = "your user name"
```Create bot in your telegram client (write a message to @BotFather) and copy bot token into app.
## Run
`python3 spy.py`
Then input **your telegram account number** which will be sending requests to get users online status. Do not enter a bot token as this will not work.
Input code in console from telegram.
### Commands
Write /help to your bot to see usage information.```
/start - start online monitoring
/stop - stop online monitoring
/help - show help
/add - add user to monitoring list "/add +79991234567 UserName"
/list - show added users
/clear - clear user list
/remove - remove user from list with position in list (to show use /list command)"/remove 1"
/setdelay - set delay between user check in seconds
/logs - display command log
/clearlogs - clear the command log file
/cleardata - reset configuration
/disconnect - disconnect bot
/getall - status
```---
### Crontjob
Handy cronjob makros
- start background process:
#!/bin/bash
cd /home/DIRECTORY/TelegramOnlineSpy
nohup python3 spy.py > nohupper.log &- check if background process is still running
```bash
#!/bin/bash
cd /home/DIRECTORY/TelegramOnlineSpy
minimum_finds=2
found=$(ps aux | grep "python3 spy.py" | wc -l)
if ((found < minimum_finds)); then
# DO SOMETHING WHEN YOUR SPY IS OFFLINE
# eg. alert the user or restart the spy
fi
```check if spy is running every hour
```bash
32 * * * * /home/DIRECTORY/TelegramOnlineSpy/checkrunning.sh
```