Commit Graph

49 Commits

Author SHA1 Message Date
agessaman
1c204dc389 Add trace command, configuration and documentation
- Introduced `[Trace_Command]` section in `config.ini.example` to enable link diagnostics with customizable parameters such as maximum hops, trace mode, and retry settings.
- Updated `command-reference.md` to include usage instructions and examples for the new `trace` and `tracer` commands, detailing their functionality for manual and round-trip tracing.
- Enhanced `mesh_graph.py` to support 2-byte trace confirmation for improved path weighting.
- Modified `message_handler.py` to update the mesh graph based on trace data, ensuring accurate edge representation in the graph.
- Added translations for the new trace commands in `en.json` to support user interaction in multiple languages.
2026-02-23 14:26:50 -08:00
agessaman
3604125b14 Enhance FAQ and error handling in bot operations
- Added a new FAQ section addressing common issues when moving a database to a new install, including schema mismatches, stale operations, and timeout errors.
- Updated error logging in `feed_manager.py` and `scheduler.py` to use `logger.exception` for better traceback visibility during message queue and channel operation errors.
- Improved command help text generation in `command_manager.py` to ensure proper formatting and context filtering based on message length.
- Enhanced command availability checks in `cmd_command.py` and `help_command.py` to respect channel-specific overrides and improve user experience.
2026-02-22 18:55:35 -08:00
agessaman
04bd004f36 Improve monitor channel handling by adding support for quoted values
- Introduced `strip_optional_quotes` function to handle monitor channel values with optional surrounding quotes.
- Updated `load_monitor_channels` method in `CommandManager` to utilize the new function, ensuring compatibility with quoted and unquoted channel configurations.
- Modified `generate_samples` function to apply the same logic for consistency.
- Added tests for `strip_optional_quotes` to validate behavior with various input cases.
2026-02-15 21:02:48 -08:00
agessaman
ac6c9d8fa0 Enhance help command functionality with message context
- Updated the `get_general_help` method in `CommandManager` to accept a `message` parameter, allowing for context-aware help responses based on the message's channel.
- Modified the `get_available_commands_list` method in `HelpCommand` to filter commands based on the provided message, ensuring only valid commands for the channel are listed.
- Introduced a new method `_is_command_valid_for_channel` to check command validity against the message's channel context, improving command management and user experience.
2026-02-13 09:09:42 -08:00
agessaman
d699ea1cf1 Update configuration handling and validation for bot sections
- Enhanced .gitignore to allow test files in the tests/ directory and committed pytest.ini for test discovery.
- Added checks for missing sections in configuration files, specifically for Admin_ACL and Banned_Users, to prevent errors during bot startup.
- Updated generate_website.py and command_manager.py to handle cases where required sections are absent, returning empty lists instead of raising exceptions.
- Introduced optional dependencies for testing in pyproject.toml, ensuring a smoother development experience.
- Improved localization handling in core.py to default to English when the Localization section is missing, enhancing user experience.
2026-02-12 19:23:35 -08:00
Adam Gessaman
40e30def2c feat: Implement per-user rate limiting for bot responses
- Added per-user rate limiting functionality to control the minimum time between bot replies to the same user, identified by public key or sender name.
- Updated configuration files to include `per_user_rate_limit_seconds` and `per_user_rate_limit_enabled` options for enabling and configuring this feature.
- Enhanced the command manager and message handler to support per-user rate limiting, ensuring efficient message handling and reduced spam.
- Updated documentation to reflect the new rate limiting options and their usage.
2026-02-11 09:13:24 -08:00
Adam Gessaman
ac2825a25d feat: Add channel keyword filtering to configuration
- Introduced `channel_keywords` option in the configuration files to limit bot responses in monitored channels to specified keywords, enhancing control over channel interactions.
- Updated relevant documentation and examples to reflect the new feature, ensuring users understand how to implement keyword restrictions.
- Modified the command manager to support the new keyword filtering logic, allowing for more efficient message handling in channels.
2026-02-09 11:56:43 -08:00
agessaman
e6bec91c2b refactor: Consolidate escape sequence decoding across modules
- Removed the custom `_decode_escape_sequences` method from multiple classes and replaced it with a centralized `decode_escape_sequences` function in the utils module.
- Updated all relevant modules (CommandManager, MessageScheduler, GreeterCommand) to utilize the new function for decoding escape sequences in configuration strings, improving code maintainability and consistency.
- Enhanced the config example to clarify the usage of escape sequences in messages.
2026-02-02 16:18:14 -08:00
agessaman
b50d02aee9 feat: Add command prefix support and enhance message handling
- Introduced a new configuration option for command prefix in config.ini.example, allowing users to customize command invocation.
- Updated CommandManager to load and utilize the command prefix, ensuring commands are processed correctly based on the configured prefix.
- Enhanced message handling logic to check for the command prefix, maintaining backward compatibility with the legacy "!" prefix.
- Improved keyword matching to ensure bot responses are only triggered when the bot is mentioned, refining interaction accuracy.
2026-01-26 21:02:30 -08:00
agessaman
abe8e57ae3 feat: Update banned user handling to support prefix matching
- Modified configuration examples to clarify that banned users are now identified by sender names using prefix matching.
- Implemented a new method in CommandManager to check if a user is banned based on prefix matching, enhancing the bot's ability to ignore messages from banned senders.
- Updated message handling logic to utilize the new prefix matching functionality for improved user management.
2026-01-18 20:04:50 -08:00
agessaman
aa3951827a feat: Implement command queuing for global cooldowns in CommandManager
- Added QueuedCommand dataclass to represent commands waiting for cooldown expiration.
- Enhanced CommandManager to support queuing commands when near global cooldown expiration, allowing for smoother command execution.
- Implemented background task to process queued commands, ensuring they are executed once cooldowns expire.
- Updated BaseCommand to include a method for retrieving queue threshold seconds, improving flexibility in command handling.
- Adjusted core.py to initiate the command queue processor upon bot startup.
2026-01-17 21:12:24 -08:00
agessaman
2b3f3489bd feat: Enhance command help functionality with channel restrictions
- Updated the CommandManager to include channel restrictions for help keyword processing, ensuring that help requests are only handled in monitored channels or DMs when enabled.
- Improved the HTML documentation for commands by adding a new "General Commands" section and refining existing command descriptions.
- Added new CSS styles for better presentation of command subcommands in the website documentation.
2026-01-15 17:56:27 -08:00
agessaman
76ba4f1c0e fix: Refine content matching logic in CommandManager
- Updated the content matching logic in the CommandManager to ensure only exact matches are considered, preventing false positives from substring matches.
- Enhanced comments to clarify the purpose of the changes and the importance of accurate timestamp checks in transmission linking.
2026-01-15 17:10:37 -08:00
Adam Gessaman
f3d33b68c7 feat: Enhance rate limiting flexibility in command responses
- Updated the `CommandManager` and `BaseCommand` classes to include an optional `skip_user_rate_limit` parameter in the `send_response`, `send_dm`, and `send_channel_message` methods, allowing automated responses to bypass user rate limits.
- Adjusted the `GreeterCommand` to utilize the new parameter, ensuring that automated greetings do not trigger user rate limiting checks.
- Enhanced documentation to clarify the purpose of the new parameter and its impact on message sending behavior.
2026-01-13 12:43:30 -08:00
Adam Gessaman
c04ecd9ffd fix: Update escape sequence documentation for consistency
- Revised `config.ini.example` and `README.md` to clarify the usage of escape sequences for newlines, changing from double backslashes (`\\n`) to single backslashes (`\n`).
- Enhanced comments in `CommandManager` and `GreeterCommand` to reflect the updated escape sequence behavior, ensuring accurate processing of newline characters and literal backslashes.
- Improved logging in `GreeterCommand` for better debugging of mesh info formatting.
2026-01-13 10:55:59 -08:00
Adam Gessaman
ce561c18db feat: Enhance keyword response handling with escape sequence support
- Updated `config.ini.example` and `README.md` to document the use of escape sequences for newlines and other formatting in keyword responses.
- Implemented `_decode_escape_sequences` method in `CommandManager` to process escape sequences like `\\n`, `\\t`, and `\\r`, allowing users to format responses more flexibly.
- Modified `load_keywords` and `load_syntax_patterns` methods to decode escape sequences in keyword responses and formats, improving user experience.
2026-01-12 09:16:34 -08:00
agessaman
7984fa3af6 feat: Enhance command messaging with repeat tracking and transmission monitoring
- Updated `send_dm` and `send_channel_message` methods to include an optional `command_id` for tracking message repeats.
- Integrated transmission tracking to record and manage repeat messages, improving message handling and response accuracy.
- Enhanced `capture_command` method in `BotIntegration` to store repeat information for better analysis in the web viewer.
- Added favicon support and improved web viewer templates to display repeat information effectively.
- Implemented JavaScript updates in the web viewer to handle command updates and display repeat counts dynamically.
2026-01-11 20:30:02 -08:00
agessaman
51acebdc1a refactor: Improve async lock handling in InternetStatusCache
- Changed the lock attribute to a private variable and introduced a lazy initialization method for the async lock.
- Updated the CommandManager to use the new _get_lock method, enhancing thread safety and preventing potential RuntimeErrors when the event loop is not running.
2026-01-02 14:42:04 -08:00
agessaman
a32fe0dcfd docs: Add docstrings and type hints across modules for improved clarity and maintainability. 2026-01-01 20:12:49 -08:00
agessaman
e5f98d69e6 Implement internet connectivity caching and enhance command handling in CommandManager
- Introduced a thread-safe InternetStatusCache class to manage internet connectivity status with caching.
- Refactored internet connectivity checks to utilize the new cache, reducing redundant checks.
- Added a unified method for handling message send results, improving error logging and response management.
- Enhanced rate limit checks to streamline command execution and prevent spam.
- Improved plugin loading error handling and validation, ensuring robust plugin management.
2026-01-01 11:42:35 -08:00
agessaman
427b27fee3 Enhance help command to provide a dynamic list of available commands based on usage statistics. Implemented database querying for command usage and improved fallback mechanisms for command listing. Updated CommandManager to utilize the new method for better help text suggestions. 2025-12-29 16:46:57 -08:00
agessaman
afda22f0fe Refactor database path and placeholder handling across modules
- Replaced the validate_safe_path function with a new resolve_path utility to simplify database path resolution in BotDataViewer, BotIntegration, and MapUploaderService.
- Updated the logic to ensure that both relative and absolute paths are handled correctly, enhancing the robustness of database connections.
- Improved code readability and maintainability by centralizing path resolution logic.
- Centralized placeholder handling in utils instead of individual function handlers
2025-12-29 15:42:35 -08:00
lincomatic
2395c0765d add elapsed for test command 2025-12-24 16:10:26 -08:00
agessaman
32929dedad Update CommandManager with internet connectivity checks for commands
- Introduced caching mechanisms for internet connectivity status in CommandManager to optimize performance and reduce redundant checks.
- Updated command execution logic to skip commands requiring internet access when connectivity is unavailable, improving user experience and error handling.
- Added synchronous and asynchronous utility functions for checking internet connectivity in utils.py.
- Marked relevant commands (e.g., AlertCommand, AqiCommand, DadJokeCommand) as requiring internet access to ensure proper execution conditions.
2025-12-17 12:38:54 -08:00
agessaman
f0b4f1e078 Refine command manager logging and enhance weather command alert handling
- Updated CommandManager to log rate limiting warnings only for meaningful wait times, avoiding misleading messages.
- Enhanced WxCommand to support a new "alerts" keyword for fetching weather alerts, with special handling for alert data.
- Improved alert fetching logic to differentiate duplicate special statements and prioritize alerts based on severity and urgency.
- Added methods for compactly formatting alerts and abbreviating city names for better display in responses.
2025-12-16 18:28:26 -08:00
agessaman
c151fba7a5 Enhance configuration and database management for feed and channel operations. Add channel refresh interval setting to config.ini.example, implement feed manager functionality with new database tables for feed subscriptions and activity tracking, and improve greeter command logic with human greeting detection and Levenshtein distance matching for user greetings. Update web viewer to include feed management pages and integrate global template variables for better user experience. 2025-12-06 10:18:12 -08:00
agessaman
99c4dd55e7 Improved success and failure conditions for message delivery, including handling unexpected event types and timeouts. 2025-12-02 20:01:15 -08:00
agessaman
71d157a974 Enhance command execution and analytics features. Update CommandManager to allow DM-only commands in public channels to silently ignore errors if the channel is not configured. Refactor BaseCommand to improve execution checks based on channel permissions. In the web viewer, add time window parameters for analytics in the database stats API, and implement Chart.js for visualizing activity trends over the last 30 days. Update dashboard templates to include time window selectors for top users, commands, paths, and channels, improving user experience and data accessibility. 2025-11-30 20:04:20 -08:00
agessaman
a6d2065379 Enhance command execution logic in CommandManager by adding channel access checks and improved error handling for message sending. Commands that cannot execute due to channel restrictions or cooldowns are now skipped. Additionally, refine error logging to differentiate between timeout warnings and actual failures when sending messages. 2025-11-26 08:38:56 -08:00
agessaman
412883ac67 Enhance weather command functionality by adding support for multi-day and tomorrow forecasts. Updated parsing logic to handle forecast type options and improved response formatting. Integrated new weather data retrieval methods for both local and global commands, ensuring consistent user experience across different locales. Added localization support for new forecast messages in multiple languages. 2025-11-18 18:51:10 -08:00
agessaman
7e2c478662 Implement localization support across various commands and configuration. Added language settings in config.ini.example, integrated translation functionality in command responses, and enhanced error handling with localized messages. Improved fallback mechanisms for missing translations and updated help text for better user guidance. 2025-11-16 20:17:58 -08:00
agessaman
f162336d44 updated documentation about placeholders in responses, improvements to path data in webviewer 2025-11-11 20:18:01 -08:00
agessaman
46f04fbbe5 switched from using the bot's local time instead of the message sent time for keyword replacement 2025-11-11 09:36:29 -08:00
agessaman
9ea71d5414 Add format_keyword_response method to CommandManager for consistent message formatting 2025-11-11 09:13:32 -08:00
agessaman
ee0ceb667b resolve edge case where get_channel_number() would return zero and the bot would respond in the public channel despite being unconfigured. 2025-11-02 16:57:25 -08:00
agessaman
7bb51f219b Web Viewer Integration
- Add Flask + Flask-SocketIO web viewer with dashboard (modules/web_viewer/app.py and related)
- Add web viewer templates: index, realtime, tracking (contacts), cache, purging, stats (modules/web_viewer/templates/)
- Add integration hooks and utility functions for web viewer (modules/web_viewer/integration.py, modules/utils.py)
- Add command to launch web viewer from bot CLI (modules/commands/webviewer_command.py)
- Update .gitignore: ignore db/log files, test scripts, and web viewer artifacts
- Add restart_viewer.sh helper script for standalone web viewer restart/troubleshooting
- Add guidance and documentation for modern viewer in WEB_VIEWER.md and docs/
- Various code structure and import improvements to core bot and command modules to support integration
- Add ACL support for sensitive commands
- Example config updates

Benefits:
- Decouples monitoring/UI from bot core process
- Enables real-time browser dashboard and unified contact/repeater tracking
- Easier integration, dev, and troubleshooting
2025-10-21 21:57:00 -07:00
agessaman
fea21b85bd initial update to include proximity-based path resolution 2025-10-18 14:46:31 -07:00
agessaman
f0b93d80e9 add dice and roll commands, fixed sports command home/away ordering. 2025-09-23 21:18:28 -07:00
agessaman
a2a66006ed fix keyword matching 2025-09-21 11:31:52 -07:00
agessaman
025d3d539f Refactor command syntax and enhance test command functionality
- Updated the test command response format to include optional phrases.
- Removed the at_phrase command and its references from the command manager and help command.
- Adjusted configuration examples to reflect the new syntax for message acknowledgments.
- Enhanced the sports command with additional WNBA team support and improved city mappings for team searches.
2025-09-17 21:12:43 -07:00
agessaman
7445e2ad10 first draft of a sports command using the ESPN endpoints 2025-09-13 13:35:35 -07:00
agessaman
be630c00e6 Enhance joke command with length handling and update configuration settings for jokes. Modify help command to support message context for help text retrieval. 2025-09-09 21:28:07 -07:00
agessaman
948828cf30 Add DM retry settings and improve message sending reliability with meshcore-2.1.6+ integration 2025-09-07 19:52:31 -07:00
agessaman
dec697b087 Add configurable transmission delay to prevent message collisions 2025-09-07 16:17:09 -07:00
agessaman
2206265e10 Update modules with latest development changes
- Enhanced command processing with exclamation mark handling
- Improved message handling and RF data correlation
- Updated repeater management functionality
- Enhanced command implementations across all modules
- Updated database manager and core functionality
- All changes maintain backward compatibility
2025-09-06 11:22:58 -07:00
agessaman
8beede60b1 added aqi command 2025-09-05 22:12:51 -07:00
agessaman
a03ee89fb4 Implement repeater manager and enhance logging configuration in MeshCore Bot. Added repeater database path to config, improved command handling for weather commands, and refined logging setup for better output control. Updated command aliases for consistency and enhanced error handling in geocoding. Adjusted weather command to support city and state formats. 2025-09-05 20:32:57 -07:00
agessaman
04b3542411 Enhance configuration and command structure for MeshCore Bot. Added RF data correlation settings in config.ini, implemented a BotTxRateLimiter for transmission control, and refactored command handling to support plugins. Removed obsolete scripts and improved command metadata for better usability. 2025-09-04 18:48:59 -07:00
agessaman
9fa8b02be6 Initial commit: MeshCore Bot project 2025-09-04 15:33:51 -07:00