No project description provided
Project description
Remote Command Bot
A Telegram bot for remote command execution with optional user authorization, customizable command validation, and customizable messages.
Installation
pip install teleser
Usage
With custom messages and user authorization:
from teleser import TeleSerBot
AUTHORIZED_USERS = [123456789, 987654321] # Replace with actual Telegram user IDs
CUSTOM_DANGEROUS_PATTERNS = [r"your_custom_pattern"]
CUSTOM_ALLOWED_COMMANDS = ["your_custom_command"]
CUSTOM_MESSAGES = {
"start": "Welcome! You can use these commands: {allowed_commands}",
"unauthorized": "Access denied. You are not authorized.",
"command_result": "Here's the output:\n{result}",
}
def main():
bot = TeleSerBot(
"TELEGRAM_BOT_TOKEN",
authorized_users=AUTHORIZED_USERS,
dangerous_patterns=CUSTOM_DANGEROUS_PATTERNS,
allowed_commands=CUSTOM_ALLOWED_COMMANDS,
custom_messages=CUSTOM_MESSAGES
)
bot.run_sync()
if __name__ == '__main__':
main()
Without customization (default settings):
from teleser import TeleSerBot
def main():
bot = TeleSerBot("TELEGRAM_BOT_TOKEN")
bot.run_sync()
if __name__ == '__main__':
main()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
teleser-0.1.1.tar.gz
(3.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file teleser-0.1.1.tar.gz.
File metadata
- Download URL: teleser-0.1.1.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.3 Linux/6.5.0-44-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0adf0521bf0ca02c92012a4b7cb6a15e614ca3768c07e3ae334edbad13ba355f
|
|
| MD5 |
3b5382bac02d9456a9e295b7d2ebd478
|
|
| BLAKE2b-256 |
c039d94d0ae5d837d19b33c3bc57121c91704e68802376844cfadccd2565cc54
|
File details
Details for the file teleser-0.1.1-py3-none-any.whl.
File metadata
- Download URL: teleser-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.3 Linux/6.5.0-44-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
99030ae3a96fd49e97b3ff69179215c196f3ea0f2c032b151350fc40f3093ff2
|
|
| MD5 |
82fce9b2505d42127affcf38af0003c4
|
|
| BLAKE2b-256 |
68049c4720569916a8070a55978985187cfd35f09c575884e04aa2740e15f41e
|