Commit Graph

201 Commits

Author SHA1 Message Date
google-labs-jules[bot]
9ab6fd5a44 Fix: Simplify input prompts in setup script
Reverts input functions to a simpler model by separating the
`echo` of the prompt from the `read` command itself.
This avoids using `read -p` with complex, colorized prompt strings,
which can sometimes cause issues in specific terminal emulators or
compatibility layers like those found in MobaXterm.

This change aims to improve robustness of input handling by:
1. Using `echo -e -n` for displaying the prompt with colors.
2. Using a plain `read` or `read -s` for capturing user input.

This is a further attempt to resolve issues where users might be
unable to type or paste into prompts within the MobaXterm environment.
2025-06-20 09:42:11 +00:00
google-labs-jules[bot]
3d433ba1d7 Fix: Ensure setup script reads from /dev/tty for input
When stdin is not a terminal (e.g., in some script execution
contexts or if redirected), the `read` command may fail to capture
user input. This change modifies the input prompting functions
(`_prompt_user` and `_prompt_user_sensitive`) to explicitly
read from `/dev/tty` if stdin is not a terminal but `/dev/tty`
is available.

This should resolve issues where users are unable to type or paste
input during the setup process, particularly when selecting the
Docker approach and being prompted for API hash or other credentials.
2025-06-20 09:25:30 +00:00
google-labs-jules[bot]
10da311d83 refine: Enhance Docker setup and docs for fork usability
- Corrected 'SpeechRecognition' casing in addons/addons.txt.
- Updated ultroid_setup.sh welcome message to specify the fork.
- Modified README.md, README_DOCKER.md, and DOCKER_DEPLOYMENT.md:
  - Pointed clone/curl URLs and repository links to the overspend1/Ultroid-fork.
  - Reinforced ultroid_setup.sh as the primary method for Docker deployment.
  - Ensured documentation clarity regarding building the Docker image from the fork's source.
2025-06-19 22:06:48 +00:00
google-labs-jules[bot]
24d31f09aa feat: Add unified setup script and update README
Introduces `ultroid_setup.sh`, a new unified script to guide users
through installing Ultroid via Docker or a local Python virtual environment.

Key features of the script:
- Interactive prompts for setup type (Docker/Local).
- OS detection for helper messages.
- Prerequisite checks (git, python3, pip).
- Comprehensive environment variable collection and `.env` file generation.
- Automated Docker setup: builds image, starts containers.
- Automated Local Python setup: creates venv, installs dependencies.
- Integrated session string generation options (manual, Docker, Bot instructions).
- Cross-platform compatibility for `.env` updates (sed for Linux/macOS).

Updates `README.md` to feature `ultroid_setup.sh` as the primary
installation method, streamlining the getting started process.
Older setup scripts (`quick-start.sh`, `docker-deploy.sh`) are
now superseded by this unified script.
2025-06-19 21:24:03 +00:00
google-labs-jules[bot]
522cf932ec fix: Address Pylint issues and bugs in pyUltroid/startup/
- Corrected undefined variable 'x' in funcs.py.
- Refactored configuration loading in funcs.py for clarity and to resolve Pylint errors.
- Changed logging f-strings to %-style formatting across multiple files.
- Added encoding='utf-8' to open() calls.
- Replaced list comprehensions used for side-effects with for-loops.
- Made some broad exception catches more specific.
- Added check=True to subprocess.run() calls in loader.py.
- Corrected function signature parameter orders (e.g., *args placement).
- Removed some unused variables and imports.
- Added Pylint disable comments for known false positives (e.g., no-member for psycopg2.errors and base class methods).
- Improved error handling and logging in funcs.py for startup sequences.
- Addressed dependency installation issues by commenting out 'pokedex' (unavailable on PyPI) and correcting case for 'SpeechRecognition' in requirements.txt.
2025-06-19 20:58:47 +00:00
Cursor User
5ae88d2980 Auto-populate Docker .env from existing configuration
Enhanced safe-docker-setup.sh to:
- Auto-detect and copy SESSION, API_ID, API_HASH from existing .env
- Read from environment variables if available
- Show configuration status after setup
- Provide quick start if credentials are found
- Maintain manual setup flow if credentials not found

 Benefits:
- Zero manual configuration if existing setup detected
- Seamless transition from bash startup to Docker
- Immediate ready-to-start Docker environment
- Still preserves existing setup completely
2025-06-18 21:13:19 +02:00
Cursor User
7f1ba3cdc3 Add comprehensive Docker deployment with safety features
Features:
- Complete Ubuntu dependency resolution in requirements.txt
- Safe Docker deployment that preserves existing bash startup setups
- Isolated Docker environment (docker-ultroid/) with different ports
- Automatic detection of existing bot configurations
- Session generation scripts for Docker deployment
- Health check and diagnostic tools
- Comprehensive documentation and deployment guides

 Safety:
- Detects existing 'bash startup' method and creates isolated environment
- Uses different ports (8081) to avoid conflicts
- Separate volumes and configs for Docker deployment
- Both bash startup and Docker can run side by side
- No interference with existing bot setups

 Files added/updated:
- requirements.txt (all missing dependencies)
- Docker setup (Dockerfile, docker-compose.yml, .env.sample)
- Deployment scripts (ubuntu_setup.sh, docker-deploy.sh, quick-start.sh)
- Safety scripts (safe-docker-setup.sh with isolation logic)
- Management tools (Makefile, health_check.sh, generate-session.sh)
- Documentation (SAFE_DOCKER_GUIDE.md, DOCKER_DEPLOYMENT.md, etc.)

Ready for production Ubuntu server deployment!
2025-06-18 20:42:10 +02:00
Cursor User
524a0d2690 Add comprehensive pytest testing suite for Ultroid
- Created Linux-compatible Python test runner (run_tests.py)
- Fixed pytest configuration (removed duplicate addopts)
- Added comprehensive test suites for core, plugins, database, and updates
- Fixed import syntax errors (removed wildcard imports from functions)
- Created proper test fixtures and mocking
- Added Makefile with test commands
- Included GitHub Actions workflow for automated testing
- Added test requirements and documentation
- All tests now pass with proper mocking and fixtures

Test Coverage:
- Core functionality tests (imports, decorators, exceptions)
- Plugin system tests (loading, command structure)
- Database tests (operations, connections)
- Update system tests (git operations, validation)
- 49 total tests: passing/skipping appropriately based on dependencies
2025-06-18 19:33:07 +02:00
Cursor User
7a384c7b14 Add addon import fixer script
- Created fix_addon_imports.py to fix ultroid_cmd imports in addon files
- Handles cases where addons/ directory is in .gitignore and doesn't get updated
- Fixes multiple import patterns automatically
- Can be run on server to fix imports without affecting git tracking
- Provides detailed feedback on files processed and fixed
2025-06-18 18:15:05 +02:00
Cursor User
a527c81c62 Fix addon imports and use startup script for restart
- Fixed ultroid_cmd import in addons/tag.py to use pyUltroid._misc._decorators
- Fixed ultroid_cmd import in addons/snips.py to use correct path
- Fixed ultroid_cmd import in addons/afk.py to use correct path
- Modified update script to use bash startup script for restart instead of direct python
- Added startup script detection and execution for proper bot restart
- This fixes the config error during restart by using the proper startup sequence
2025-06-18 18:10:30 +02:00
Cursor User
b9eded3bce Fix ultroid_cmd import errors in addons
- Fixed import path from 'pyUltroid.fns.decorators' to 'pyUltroid._misc._decorators'
- Updated addons/tag.py, addons/snips.py, and addons/afk.py
- The decorators.py file doesn't exist in fns directory, actual location is _misc/_decorators.py
- This should resolve the ImportError: cannot import name 'ultroid_cmd' from 'pyUltroid'
- All addons should now load properly without import errors
2025-06-18 18:06:36 +02:00
Cursor User
79ebb0b0bd Fix dependency and config validation issues
- Removed invalid 'pip-requirements' line from requirements.txt that was causing pip errors
- Added config validation before bot restart to prevent startup failures
- Check for essential environment variables (API_ID, API_HASH, SESSION) in .env or config.py
- Prevent restart attempts when configuration is incomplete
- Enhanced error logging with specific config issues
- Update script now validates environment before attempting restart
2025-06-18 18:00:38 +02:00
Cursor User
df2c51df16 Fix update script for Ubuntu/Linux compatibility
- Changed Windows commands (copy, del, for loops) to Linux equivalents (cp, rm, find)
- Updated cache cleanup to use find command with proper Linux syntax
- Improved restart mechanism with better error handling and logging
- Added fallback restart method using subprocess.Popen
- Enhanced logging with update_process.log and update_restart.log files
- Added exception handling for restart failures
- Increased shutdown wait time for better process cleanup
2025-06-18 17:54:56 +02:00
Cursor User
fe810e7ad0 Major update script overhaul - robust conflict handling
- Complete rewrite of update script with better error handling
- Added automatic backup/restore of important config files
- Robust cache cleanup (removes all .pyc and __pycache__ files)
- Uses git reset --hard and clean for conflict-free updates
- Force pull strategy prevents merge conflicts entirely
- Preserves session files, config.py, and .env during updates
- Windows-compatible commands for file operations
- More reliable update process that handles any local changes
2025-06-18 17:45:22 +02:00
Cursor User
1e02568f49 Fix update script to handle local changes and conflicts
- Added stashing mechanism to preserve local changes during update
- Handle untracked files that might conflict (like update_script.py itself)
- Restore local changes and moved files after successful update
- Improved error handling with proper cleanup on failure
- Prevents 'local changes would be overwritten' errors during updates
2025-06-18 17:37:22 +02:00
Cursor User
42275fd6c1 Complete Ultroid update system modernization and addon fixes
- Enhanced update_script.py with better error handling and restart logic
- Fixed update command in plugins/bot.py to default to user's fork
- Improved update command help and interactive options
- Fixed import errors in addons/snips.py and addons/tag.py
- All update operations now default to user's fork unless 'original' specified
- Added reliable external script-based update mechanism
- Ensured proper shutdown/restart cycle for updates
2025-06-18 17:30:48 +02:00
Cursor User
7b1d54a866 feat(update): Implement external script-based update system
- Created update_script.py for reliable external updates
- Modified update command to use external script approach
- Bot now shuts down, launches update script, and restarts automatically
- Added proper repository handling and dependency updates
- Improved update UI with better status messages and buttons
- Fixed issues with in-process updates that could cause corruption

This approach is much more reliable as it:
- Avoids updating files while they're in use
- Properly handles git operations without conflicts
- Ensures clean restart after updates
- Provides better error handling and user feedback
2025-06-18 17:06:30 +02:00
Ubuntu
156d79ff32 feat: Add custom addons and flatten repository 2025-06-18 01:22:00 +00:00
Cursor User
d07ff4c694 fix(update): Use correct Heroku environment variables 2025-06-18 02:45:48 +02:00
Cursor User
db92de7a2d feat(update): Overhaul update command for reliability and UX
- Completely rewrote the update logic in plugins/bot.py.
- Introduced a new get_updates helper function for robustly checking for new commits using git.
- The updater command now supports flexible arguments (
ow, original) for more control over the update process.
- Added comprehensive help text, accessible via .help update, to explain the new functionality.
- Instead of auto-updating, the bot now sends a detailed changelog with an 'Update Now' button to the log channel.
- Added callback handlers for the new interactive update buttons.
- Ensured temporary git remotes are properly cleaned up to prevent conflicts.
- Changed the default repository URL in buttons to point to the original ThePrateekBhatia/Ultroid repo.
2025-06-18 02:31:29 +02:00
Cursor User
cc5f0be82e feat: add help text for .update command 2025-06-18 01:58:28 +02:00
Cursor User
34a89b6c03 fix: resolve circular import and NameError 2025-06-18 01:46:46 +02:00
Cursor User
c4c64d3222 feat: Add update-from-fork feature and fix GDrive 2025-06-18 01:28:42 +02:00
Prateek Bhatia
12e01b3f44 fix: handle USERNAME_DB type in uname_stuff to prevent AttributeError
Ensure that USERNAME_DB is a dictionary before calling .get() in the uname_stuff function.
This prevents runtime errors when the database returns a string or unexpected type, improving
the stability of username logging and update handling.
2025-06-09 00:53:21 +05:30
Prateek Bhatia
7ccfda5d23 Removed akipy from optional-requirements (depriciated)
Signed-off-by: Prateek Bhatia <bhatiaprateek111@gmail.com>
2025-06-09 00:37:18 +05:30
github-actions[bot]
e8965cf0c4 format: auto-format code by ruff.
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-06-08 18:53:15 +00:00
Prateek Bhatia
dd82cac7dd Added Ruff Formatter to improve code quality
Signed-off-by: Prateek Bhatia <bhatiaprateek111@gmail.com>
2025-06-09 00:21:47 +05:30
Prateek Bhatia
aa09441014 Temporarily remove Heroku deployment support
Heroku deployment support has been temporarily removed due to recent patches affecting Ultroid deployments.

This change helps prevent accidental bans caused by users unknowingly deploying to Heroku. Support will be re-added once a proper solution is implemented.
2025-06-09 00:18:04 +05:30
Parvshah-01
8bc272cadb Update tools.py (#472) 2025-06-05 20:38:06 +05:30
Parvshah-01
d9a080d854 Added support for extracting IDs and fetching content from Telegram “openmessage” links (#471)
Added support to fetch message content from Telegram “openmessage” links.
2025-06-05 20:20:46 +05:30
Sipak
7d689dd7f1 devtools: fix relative imports inside eval 2025-06-05 11:04:43 +05:30
New-dev0
db7abae627 feat: support storydl from link 2025-06-02 14:49:41 +05:30
New-dev0
b1ee7d9733 fix: eval on python 3.13 and include multi client script 2025-05-31 23:23:48 +05:30
New-dev0
a98f052166 fix: gemini plugin not providing response 2025-05-31 20:32:50 +05:30
New-dev0
dba2b01dcd feat: add stories plugin
fix autopic
2025-05-31 20:15:06 +05:30
Okk Hex
a7cc8ce073 fix gemini dynamic model (#470) 2025-04-01 19:09:23 +00:00
Devesh Pal
c5c7916be6 Bug fixes V2.1 (#467)
* Ultroid 2025 

Co-authored-by: New-dev0 <New-dev0@users.noreply.github.com>
Co-authored-by: Amit Sharma <buddhhu@users.noreply.github.com>
Co-authored-by: TechiError <techierror@users.noreply.github.com>
Co-authored-by: Aditya <me@xditya.me>
Co-authored-by: 1Danish-00 <danish@ultroid.tech> 
Co-authored-by: Arnab Paryali <Arnabxd@users.noreply.github.com>
Co-authored-by: hellboi_atul <hellboi-atul@users.noreply.github.com>
Co-authored-by: sppidy <sppidy@users.noreply.github.com> by Devesh Pal
2025-02-23 09:17:26 +05:30
Spidy
9e7a0cf96e ultroid: docker: remove version
https://github.com/compose-spec/compose-spec/blob/main/spec.md#version-and-name-top-level-elements
2025-02-22 16:51:42 +05:30
Devesh Pal
0afa1ade15 AI wrapper and twitter plugin (#465)
* Ultroid 2025

Co-authored-by: New-dev0 <New-dev0@users.noreply.github.com>
Co-authored-by: Amit Sharma <buddhhu@users.noreply.github.com>
Co-authored-by: TechiError <techierror@users.noreply.github.com>
Co-authored-by: Aditya <me@xditya.me>
Co-authored-by: Arnab Paryali <Arnabxd@users.noreply.github.com>
Co-authored-by: hellboi_atul <hellboi-atul@users.noreply.github.com>
Co-authored-by: sppidy <sppidy@users.noreply.github.com>
2025-02-21 23:05:48 +05:30
TrueSaiyan
dace7972f3 Few fixes and addition (#444) 2025-02-20 18:48:27 +05:30
TrueSaiyan
ab9f0c7254 update get_restricted_message for forwards disabled groups (#454)
Fixed get_restricted_msg function, so you can retrieve messages from public groups that have forwards disabled or private groups if you are in them
2025-02-20 18:43:01 +05:30
Tosu
5f9f4e2367 Update README.md (#446)
* Update README.md

* Update README.md

---------

Co-authored-by: tusarpatel <167279662+tusarpatel@users.noreply.github.com>
2025-02-20 18:41:54 +05:30
TrueSaiyan
1951b1c627 Fix: Rayso (#455)
* Fix: Rayso

Fixed Rayso, with a dynamic selector and updated themes list

* Update beautify.py
2025-02-20 18:41:09 +05:30
HYBRID
f5b788983b disable logging for the TAG_LOG chat (#464) 2025-02-20 18:40:28 +05:30
Atul Kumar Jena
d145554b47 Merge pull request #460 from Qurbonsaid/patch-1
fix: time_int in ban_time remove whitespace
2024-10-26 17:53:32 +05:30
Qurbonsaid
c8d2cdfdfd fix: time_int in ban_time remove whitespace 2024-10-25 19:42:29 +05:00
TrueSaiyan
8d9418eb78 Akinator improve logging (#453) 2024-08-01 22:40:28 +05:30
TrueSaiyan
778ef54541 fix: Akinator game (#452) 2024-07-28 09:56:49 +05:30
HYBRID
01f5fcc2a8 fix chatbot ai (#450) 2024-07-14 17:17:02 +05:30
Devesh Pal
b1b443245a Update requirements.txt 2024-07-09 08:36:24 +05:30