מודולים ראשיים
תיעוד מפורט של המודולים הראשיים בפרויקט.
File Management
- class file_manager.BackupInfo(backup_id, user_id, created_at, file_count, total_size, backup_type, status, file_path, repo, path, metadata)[source]
Bases:
objectמידע על גיבוי
- Parameters:
- __init__(backup_id, user_id, created_at, file_count, total_size, backup_type, status, file_path, repo, path, metadata)[source]
- class file_manager.BackupManager[source]
Bases:
objectמנהל גיבויים
- __init__()[source]
- cleanup_expired_backups(retention_days=None, *, max_per_user=None, budget_seconds=None)[source]
ניקוי גיבויים ישנים ממערכת הקבצים ומ‑GridFS באופן מבוקר.
פרמטרים: - retention_days: ימים לשמירת גיבוי לפני מחיקה (ברירת מחדל: BACKUPS_RETENTION_DAYS או 30) - max_per_user: כמות מקסימלית של גיבויים לשמירה לכל משתמש (ברירת מחדל: BACKUPS_MAX_PER_USER או None) - budget_seconds: תקציב זמן לניקוי כדי לא לחסום את ה־worker (ברירת מחדל: BACKUPS_CLEANUP_BUDGET_SECONDS או 3)
החזרה: dict עם counters לסריקה/מחיקות ושגיאות.
- save_backup_bytes(data, metadata)[source]
שומר ZIP של גיבוי בהתאם למצב האחסון ומחזיר backup_id או None במקרה כשל.
אם storage==mongo: שומר ל-GridFS עם המטאדטה. אם storage==fs: שומר לקובץ תחת backup_dir.
- save_backup_file(file_path)[source]
שומר קובץ ZIP קיים לאחסון היעד (Mongo/FS) ומחזיר backup_id אם הצליח.
- list_backups(user_id)[source]
מחזירה רשימת קבצי ZIP ששייכים למשתמש המבקש בלבד.
כל פריט חייב להיות מסווג כשייך ל-user_id דרך אחד מהבאים: - metadata.json בתוך ה-ZIP עם שדה user_id תואם - דפוס מזהה בשם: backup_<user_id>_*
ZIPים ללא שיוך ברור למשתמש לא ייכללו כדי למנוע זליגת מידע.
- Return type:
- Parameters:
user_id (int)
- restore_from_backup(user_id, backup_path, overwrite=True, purge=False, extra_tags=None)[source]
משחזר קבצים מ-ZIP למסד הנתונים.
purge=True: מסמן את כל הקבצים הקיימים של המשתמש כלא פעילים לפני השחזור
overwrite=True: שמירה תמיד כגרסה חדשה עבור אותו שם (כברירת מחדל)
החזרה: dict עם restored_files ו-errors
- delete_backups(user_id, backup_ids)[source]
מוחק מספר גיבויי ZIP לפי backup_id ממערכת הקבצים ומ-GridFS (אם בשימוש).
החזרה: {“deleted”: int, “errors”: [str, …]}
GitHub Integration
- async github_upload_fix.github_upload_new_file(update, context)[source]
בקשה להעלאת קובץ חדש לגיטהאב
- async github_upload_fix.handle_document_fixed(update, context)[source]
טיפול בקובץ שהתקבל
- Parameters:
update (telegram.Update)
context (telegram.ext.ContextTypes.DEFAULT_TYPE)
- async github_upload_fix.upload_to_github_fixed(update, context, status_message)[source]
העלאה מתוקנת לגיטהאב
- async github_upload_fix.setup_minimal_commands(application)[source]
מחיקת כל הפקודות והשארת רק stats למנהל
- Return type:
- Parameters:
application (telegram.ext.Application)
- async github_upload_fix.stats_command_secured(update, context)[source]
הצג סטטיסטיקות - רק לאמיר בירון
- Parameters:
update (telegram.Update)
context (telegram.ext.ContextTypes.DEFAULT_TYPE)
- async github_upload_fix.check_commands(update, context)[source]
בדיקת הפקודות הזמינות (רק לאמיר)
- Parameters:
update (telegram.Update)
context (telegram.ext.ContextTypes.DEFAULT_TYPE)
Backup System
- backup_menu_handler.emit_event(event, severity='info', **fields)[source]
- class backup_menu_handler.BackupMenuHandler[source]
Bases:
objectתפריט גיבוי ושחזור מלא + נקודות שמירה בגיט
- __init__()[source]
- async show_backup_menu(update, context)[source]
- Parameters:
update (telegram.Update)
context (telegram.ext.ContextTypes.DEFAULT_TYPE)
- async handle_callback_query(update, context)[source]
- Parameters:
update (telegram.Update)
context (telegram.ext.ContextTypes.DEFAULT_TYPE)
- async send_rating_prompt(update, context, backup_id)[source]
שולח הודעת תיוג עם 3 כפתורים עבור גיבוי מסוים.
- Parameters:
update (telegram.Update)
context (telegram.ext.ContextTypes.DEFAULT_TYPE)
backup_id (str)
Code Processing
מנהל תצוגה מקדימה של קוד Code Preview Manager
Search Engine
Repository Analysis
- repo_analyzer.emit_event(event, severity='info', **fields)[source]
- class repo_analyzer.RepoAnalyzer(github_token=None)[source]
Bases:
objectמנתח ריפוזיטורי GitHub ומציע שיפורים
- Parameters:
github_token (str | None)
- MAX_FILE_SIZE = 102400
- MAX_FILES = 50
- LARGE_FILE_LINES = 500
- LONG_FUNCTION_LINES = 50
- CODE_EXTENSIONS = {'.c', '.cpp', '.cs', '.go', '.java', '.js', '.jsx', '.kt', '.m', '.php', '.py', '.r', '.rb', '.rs', '.scala', '.swift', '.ts', '.tsx'}
- CONFIG_FILES = {'Cargo.toml', 'Gemfile', 'Package.swift', 'Pipfile', 'build.gradle', 'composer.json', 'go.mod', 'package.json', 'pom.xml', 'pyproject.toml', 'requirements.txt'}
- IMPORTANT_FILES = {'.dockerignore', '.github/workflows', '.gitignore', '.gitlab-ci.yml', 'Dockerfile', 'LICENSE', 'LICENSE.md', 'LICENSE.txt', 'README', 'README.md', 'README.rst', 'README.txt', 'azure-pipelines.yml', 'docker-compose.yaml', 'docker-compose.yml'}
- parse_github_url(url)[source]
מחלץ owner ו-repo מ-URL של GitHub
- async fetch_and_analyze_repo(repo_url)[source]
שולף ומנתח ריפוזיטורי מ-GitHub
Batch Processing
Large Files Handling
טיפול בקבצים גדולים עם ממשק כפתורים מתקדם Large Files Handler with Advanced Button Interface
- class large_files_handler.LargeFilesHandler[source]
Bases:
objectמנהל קבצים גדולים עם ממשק מתקדם
- __init__()[source]
- async show_large_files_menu(update, context, page=1)[source]
מציג תפריט קבצים גדולים עם ניווט בין עמודים
- Return type:
- Parameters:
update (telegram.Update)
context (telegram.ext.ContextTypes.DEFAULT_TYPE)
page (int)
- async handle_file_selection(update, context)[source]
טיפול בבחירת קובץ גדול
- Return type:
- Parameters:
update (telegram.Update)
context (telegram.ext.ContextTypes.DEFAULT_TYPE)
- async view_large_file(update, context)[source]
הצגת קובץ גדול - תצוגה מקדימה או שליחה כקובץ
- Return type:
- Parameters:
update (telegram.Update)
context (telegram.ext.ContextTypes.DEFAULT_TYPE)
- async download_large_file(update, context)[source]
הורדת קובץ גדול
- Return type:
- Parameters:
update (telegram.Update)
context (telegram.ext.ContextTypes.DEFAULT_TYPE)
- async delete_large_file_confirm(update, context)[source]
אישור מחיקת קובץ גדול
- Return type:
- Parameters:
update (telegram.Update)
context (telegram.ext.ContextTypes.DEFAULT_TYPE)
- async delete_large_file(update, context)[source]
מחיקת קובץ גדול
- Return type:
- Parameters:
update (telegram.Update)
context (telegram.ext.ContextTypes.DEFAULT_TYPE)
- async show_file_info(update, context)[source]
הצגת מידע מפורט על קובץ גדול
- Return type:
- Parameters:
update (telegram.Update)
context (telegram.ext.ContextTypes.DEFAULT_TYPE)
- async edit_large_file(update, context)[source]
התחלת תהליך עריכת קובץ גדול
- Return type:
- Parameters:
update (telegram.Update)
context (telegram.ext.ContextTypes.DEFAULT_TYPE)
Cache Management
מנהל Cache מתקדם עם Redis Advanced Cache Manager with Redis
- class cache_manager.DynamicTTL[source]
Bases:
objectניהול TTL דינמי לפי סוג תוכן וקונטקסט.
הערכים כאן מייצגים TTL בסיסי בשניות עבור סוגי תוכן שכיחים.
-
BASE_TTL:
Dict[str,int] = {'bookmarks': 120, 'collections_detail': 30, 'collections_items': 180, 'collections_list': 60, 'file_content': 3600, 'file_list': 300, 'markdown_render': 1800, 'public_stats': 600, 'search_results': 180, 'settings': 60, 'sticky_summary': 60, 'tags': 300, 'user_stats': 600}
-
BASE_TTL:
- cache_manager.build_cache_key(*parts)[source]
בניית מפתח cache יעיל ומובנה מהחלקים הנתונים.
מסנן חלקים ריקים
ממיר לתווים בטוחים (רווחים/סלאשים)
מגביל אורך ומוסיף hash קצר במידת הצורך
- class cache_manager.CacheManager[source]
Bases:
objectמנהל Cache מתקדם עם Redis
- __init__()[source]
- enable_debug_for(seconds)[source]
הפעל/הארך חלון דיבאג זמני ללוגים של HIT/MISS/SET.
אם seconds <= 0: מכבה דיבאג (debug_until=0)
אחרת: מאריך (לא מקצר) את החלון כך שיסתיים לפחות בעוד seconds שניות מהעכשיו
מחזיר את timestamp החדש של debug_until.
- connect()[source]
התחברות ל-Redis
- set(key, value, expire_seconds=300)[source]
שמירת ערך ב-cache
- set_dynamic(key, value, content_type, context=None)[source]
שמירה ב-cache עם TTL דינמי ותיעוד מינימלי במטריקות/לוגים.
- get_with_refresh(key, refresh_func, *, content_type, context=None)[source]
קריאה מ-cache; אם חסר – מחשב, שומר דינמית ומחזיר.
- delete_pattern(pattern)[source]
מחיקת כל המפתחות שמתאימים לתבנית
- invalidate_user_cache(user_id)[source]
מחיקת כל ה-cache של משתמש ספציפי
- clear_all()[source]
ניקוי כל המטמון באופן מבוקר.
אם Redis מושבת – מחזיר 0.
אם Redis פעיל – מוחק את כל המפתחות באמצעות SCAN+DEL (best-effort).
- Return type:
- invalidate_file_related(file_id, user_id=None)[source]
ביטול קאש לפי קובץ: תוכן/רינדור/רשימות.
דפוסים נפוצים מעוגנים לאחור בהתאם למפתחות הקיימים בקוד.
- clear_stale(max_scan=1000, ttl_seconds_threshold=60)[source]
מחיקת מפתחות שכבר עומדים לפוג (“stale”) בצורה עדינה.
היגיון: - אם Redis מושבת – החזר 0. - סריקה מדורגת (SCAN) של עד max_scan מפתחות. - מחיקה רק למפתחות עם TTL חיובי קטן מ-ttl_seconds_threshold, או TTL שלילי המציין שאינו קיים. - לא מוחקים מפתחות ללא TTL (ttl == -1) כדי להימנע מפגיעה בקאש ארוך-חיים.
- cache_manager.dynamic_cache(content_type, key_prefix=None)[source]
דקורטור ל-caching דינמי ל-Flask endpoints.
בונה מפתח קאש יציב הכולל משתמש/נתיב/פרמטרים
שומר רק טיפוסים serializable; עבור Response עם JSON שומר את ה-data בלבד
Fail-open: לעולם לא מפיל endpoint על בעיות קאש
- cache_manager.cached(expire_seconds=300, key_prefix='default')[source]
דקורטור לcaching פונקציות
- cache_manager.async_cached(expire_seconds=300, key_prefix='default')[source]
דקורטור לcaching פונקציות async
פקודות ניהול Cache לבוט Cache Management Commands for Bot
- async cache_commands.cache_stats_command(update, context)[source]
הצגת סטטיסטיקות cache
- Parameters:
update (telegram.Update)
context (telegram.ext.ContextTypes.DEFAULT_TYPE)
- async cache_commands.clear_cache_command(update, context)[source]
ניקוי cache של המשתמש
- Parameters:
update (telegram.Update)
context (telegram.ext.ContextTypes.DEFAULT_TYPE)
- cache_commands.setup_cache_handlers(application)[source]
הוספת handlers לפקודות cache
- async cache_commands.cache_warm_command(update, context)[source]
חימום קאש מהיר לסטטיסטיקות משתמש (/cache_warm).
- Parameters:
update (telegram.Update)
context (telegram.ext.ContextTypes.DEFAULT_TYPE)
- async cache_commands.debug_cache_command(update, context)[source]
/debug_cache <seconds> – הפעלת לוגים זמניים של HIT/MISS/SET (מנהלים בלבד).
שימוש: - /debug_cache 300 (5 דקות) - /debug_cache 0 (כיבוי)
- Parameters:
update (telegram.Update)
context (telegram.ext.ContextTypes.DEFAULT_TYPE)
User Statistics
- class user_stats.UserStats[source]
Bases:
object- __init__()[source]
- log_user(user_id, username=None, weight=1)[source]
רישום משתמש ב-MongoDB עם משקל לדגימה (weight).
- Parameters:
weight (int)
- get_weekly_stats()[source]
סטטיסטיקת שבוע אחרון מ-MongoDB
- get_all_time_stats()[source]
סטטיסטיקות כלליות מ-MongoDB
Activity Reporting
קובץ פשוט לדיווח פעילות - העתק את הקובץ הזה לכל בוט
- activity_reporter.get_mongo_client(mongodb_uri)[source]
החזרת מופע MongoClient יחיד (singleton) לכל האפליקציה.
בכל קריאה מחזיר את אותו אובייקט, ויוצר רק בפעם הראשונה.
- Parameters:
mongodb_uri (str)
- activity_reporter.close_mongo_client()[source]
סגירת החיבור הגלובלי בבטחה בזמן כיבוי השירות.
- Return type:
- class activity_reporter.SimpleActivityReporter(mongodb_uri, service_id, service_name=None)[source]
Bases:
object- __init__(mongodb_uri, service_id, service_name=None)[source]
mongodb_uri: חיבור למונגו (אותו מהבוט המרכזי) service_id: מזהה השירות ב-Render service_name: שם הבוט (אופציונלי)
- report_activity(user_id)[source]
דיווח פעילות פשוט
- activity_reporter.create_reporter(mongodb_uri, service_id, service_name=None)[source]
יצירת reporter פשוט
Utilities
פונקציות עזר כלליות לבוט שומר קבצי קוד General Utility Functions for Code Keeper Bot
- class utils.CodeErrorLogger[source]
Bases:
objectמערכת לוגים ייעודית לשגיאות עיבוד קוד
- __init__()[source]
- log_code_processing_error(user_id, error_type, error_message, context=None)[source]
רישום שגיאות עיבוד קוד
- log_code_activity(user_id, activity_type, details=None)[source]
רישום פעילות עיבוד קוד
- log_validation_failure(user_id, code_length, error_reason)[source]
רישום כשל באימות קוד
- class utils.TimeUtils[source]
Bases:
objectכלים לעבודה עם זמן ותאריכים
- static format_relative_time(dt)[source]
פורמט זמן יחסי (לפני 5 דקות, אתמול וכו’)
- static parse_date_string(date_str)[source]
פרסור מחרוזת תאריך לאובייקט datetime
- class utils.TextUtils[source]
Bases:
objectכלים לעבודה עם טקסט
- static truncate_text(text, max_length=100, suffix='...')[source]
קיצור טקסט עם סיומת
- static escape_markdown(text, version=2)[source]
הגנה על תווים מיוחדים ב-Markdown
- static clean_filename(filename)[source]
ניקוי שם קובץ מתווים לא חוקיים
- static extract_hashtags(text)[source]
חילוץ תגיות מטקסט
- static highlight_text(text, query, tag='**')[source]
הדגשת מילות חיפוש בטקסט
- static format_file_size(size_bytes)[source]
פורמט גודל קובץ (bytes -> KB/MB/GB)
- class utils.SecurityUtils[source]
Bases:
objectכלים אמינות ובטיחות
- static generate_secure_token(length=32)[source]
יצירת טוקן מאובטח
- static hash_content(content, algorithm='sha256')[source]
יצירת hash לתוכן
- static validate_user_input(text, max_length=10000, forbidden_patterns=None)[source]
בדיקת קלט משתמש
- class utils.TelegramUtils[source]
Bases:
objectכלים לעבודה עם Telegram
- async static send_typing_action(update, context)[source]
שליחת אקשן ‘כותב…’
- Parameters:
update (telegram.Update)
context (telegram.ext.ContextTypes.DEFAULT_TYPE)
- async static send_document_action(update, context)[source]
שליחת אקשן ‘שולח מסמך…’
- Parameters:
update (telegram.Update)
context (telegram.ext.ContextTypes.DEFAULT_TYPE)
- async static safe_answer(query, text=None, show_alert=False, cache_time=None)[source]
מענה בטוח ל-CallbackQuery: מתעלם משגיאות ‘Query is too old’/’query_id_invalid’.
- static get_user_mention(user)[source]
קבלת מנשן למשתמש
- Return type:
- Parameters:
user (telegram.User)
- static split_long_message(text, max_length=4096)[source]
חלוקת הודעה ארוכה לחלקים
- async static safe_edit_message_text(query, text, reply_markup=None, parse_mode=None)[source]
עריכת טקסט הודעה בבטיחות: מתעלם משגיאת ‘Message is not modified’.
תומך גם במימושי בדיקות שבהם edit_message_text היא פונקציה סינכרונית שמחזירה None (לא awaitable), וגם במימושים אסינכרוניים רגילים.
- async static safe_edit_message_reply_markup(query, reply_markup=None)[source]
עריכת מקלדת הודעה בבטיחות: מתעלם משגיאת ‘Message is not modified’.
- Return type:
- static extract_message_text_preserve_markdown(message, *, reconstruct_from_entities=True)[source]
שחזור טקסט ההודעה תוך ניסיון להחזיר את מה שהמשתמש התכוון מבחינת תווי Markdown.
עקרונות:
ברירת מחדל: נשתמש ב-
text/caption(התוכן הגולמי כפי שנשלח לשרת לאחר עיבוד Markdown). זאת כדי לא לשמור מחרוזת “מרונדרת” (למשל*_name_*), שאינה משקפת קלט משתמש.במידה ו-
reconstruct_from_entities=Trueויש ישויות עיצוב (bold/italic), ננסה לשחזר תווי Markdown שהיוו כנראה את מקור העיצוב ע”י הוספת תחיליות/סיומות סביב הטקסט שסומן. מיפוי פשוט:bold→"__",italic→"_". שאר ישויות נשמרות כפי שהן.אם יש כיתוב (caption), נשתמש במקבילות
caption_entities.
- Return type:
- Parameters:
message (telegram.Message)
reconstruct_from_entities (bool)
- class utils.CallbackQueryGuard[source]
Bases:
objectGuard גורף ללחיצות כפולות על כפתורי CallbackQuery.
מבוסס על טביעת אצבע של המשתמש/הודעה/הנתון (callback_data) כדי לחסום את אותה פעולה בחלון זמן קצר, בלי לחסום פעולות שונות.
-
DEFAULT_WINDOW_SECONDS:
float= 1.2
- static should_block(update, context, window_seconds=None)[source]
בודק האם יש לחסום את העדכון כלחיצה כפולה.
אם זו אותה טביעת אצבע בתוך חלון הזמן – נחסום; אחרת נסמן ונאפשר.
- Return type:
- Parameters:
update (telegram.Update)
context (telegram.ext.ContextTypes.DEFAULT_TYPE)
window_seconds (float | None)
- async static should_block_async(update, context, window_seconds=None)[source]
בודק בצורה אטומית (עם נעילה) אם לחסום לחיצה כפולה של אותו משתמש.
חסימה מבוססת חלון זמן פר-משתמש ועל אותה טביעת אצבע (משתמש/צ׳אט/הודעה/הנתון), כדי למנוע כפילויות אמיתיות בלי לחסום לחיצות שונות ברצף מהיר (UX).
- Return type:
- Parameters:
update (telegram.Update)
context (telegram.ext.ContextTypes.DEFAULT_TYPE)
window_seconds (float | None)
-
DEFAULT_WINDOW_SECONDS:
- class utils.AsyncUtils[source]
Bases:
objectכלים לעבודה אסינכרונית
- class utils.PerformanceUtils[source]
Bases:
objectכלים למדידת ביצועים
- static timing_decorator(func)[source]
דקורטור למדידת זמן ביצוע
- class utils.ValidationUtils[source]
Bases:
objectכלים לוולידציה
- static is_valid_filename(filename)[source]
בדיקת תקינות שם קובץ
- class utils.FileUtils[source]
Bases:
objectכלים לעבודה עם קבצים
- async static download_file(url, max_size=10485760)[source]
הורדת קובץ מ-URL
- static get_file_extension(filename)[source]
קבלת סיומת קובץ
- static get_mime_type(filename)[source]
קבלת MIME type של קובץ
- class utils.ConfigUtils[source]
Bases:
objectכלים לקונפיגורציה
- static load_json_config(file_path, default=None)[source]
טעינת קונפיגורציה מקובץ JSON
- class utils.CacheUtils[source]
Bases:
objectכלים לקאש זמני
- classmethod set(key, value, ttl=300)[source]
שמירה בקאש עם TTL (שניות)
- classmethod get(key, default=None)[source]
קבלה מהקאש
- classmethod clear()[source]
ניקוי כל הקאש
- utils.setup_logging(level='INFO', log_file=None)[source]
הגדרת לוגים
- utils.generate_summary_stats(files_data)[source]
יצירת סיכום סטטיסטיקות
- utils.detect_language_from_filename(filename)[source]
זיהוי שפת תכנות לפי סיומת הקובץ (Filename-only). נסה קודם את הדטקטור הדומייני כדי לשמור אחידות, ונפילה למיפוי מקומי לתאימות.
- utils.get_language_emoji(language)[source]
מחזיר אימוג’י מתאים לשפת התכנות
- class utils.SensitiveDataFilter(name='')[source]
Bases:
Filterמסנן שמטשטש טוקנים ונתונים רגישים בלוגים.
- utils.install_sensitive_filter()[source]
התקנת המסנן על כל ה-handlers הקיימים.
- utils.normalize_code(text, *, strip_bom=True, normalize_newlines=True, replace_nbsp=True, replace_all_space_separators=True, remove_zero_width=True, remove_directional_marks=True, trim_trailing_whitespace=True, remove_other_format_chars=True, remove_escaped_format_escapes=True, remove_variation_selectors=False)[source]
נרמול קוד לפני שמירה.
פעולות עיקריות:
הסרת BOM בתחילת הטקסט
המרת CRLF/CR ל-LF
החלפת רווחים לא-שוברים (NBSP/NNBSP) לרווח רגיל
הסרת תווי רוחב-אפס וסימוני כיוון (LRM/RLM/LRE/RLE/PDF/RLO/LRO/LRI/RLI/FSI/PDI)
הסרת תווי בקרה (Cc) פרט ל-t, n, r
הסרת רווחי סוף שורה
- Return type:
- Parameters:
text (str)
strip_bom (bool)
normalize_newlines (bool)
replace_nbsp (bool)
replace_all_space_separators (bool)
remove_zero_width (bool)
remove_directional_marks (bool)
trim_trailing_whitespace (bool)
remove_other_format_chars (bool)
remove_escaped_format_escapes (bool)
remove_variation_selectors (bool)
Lazy Loading
Integrations
Terminal Commands
Terminal commands: sandboxed command execution via Docker containers.
- terminal_commands.emit_event(event, severity='info', **fields)[source]
- async terminal_commands.run_in_sandbox(command, timeout_sec=10, max_output_chars=3500)[source]
Run a shell command inside a locked-down Docker container and return (rc, output).
- async terminal_commands.terminal_enter(update, context)[source]
Enter terminal mode if Docker is available.
- Return type:
- Parameters:
update (telegram.Update)
context (telegram.ext.ContextTypes.DEFAULT_TYPE)
- async terminal_commands.terminal_exit(update, context)[source]
Exit terminal mode.
- Return type:
- Parameters:
update (telegram.Update)
context (telegram.ext.ContextTypes.DEFAULT_TYPE)
- async terminal_commands.terminal_run_command(update, context)[source]
Run a command string inside the sandbox and send the output.
- Return type:
- Parameters:
update (telegram.Update)
context (telegram.ext.ContextTypes.DEFAULT_TYPE)
- async terminal_commands.terminal_command(update, context)[source]
/terminal command to enter terminal mode.
- Return type:
- Parameters:
update (telegram.Update)
context (telegram.ext.ContextTypes.DEFAULT_TYPE)
- terminal_commands.setup_terminal_handlers(application)[source]
Register terminal conversation handlers and commands (disabled on Render).
- Parameters:
application (telegram.ext.Application)