Commit Graph

146 Commits

Author SHA1 Message Date
agessaman
9423178b33 fix: Improve channel validation logic in BaseCommand
- Added checks for empty channels and normalized channel names for case-insensitive comparison.
- Updated allowed channels validation to ensure consistent handling of channel names, enhancing command execution accuracy.
2026-01-27 15:47:56 -08:00
agessaman
ffdc906b22 fix: Update help text for commands to avoid truncation and tx issues 2026-01-26 21:11:36 -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
ec4b4dbc66 feat: Enhance PathCommand with SNR integration and location validation
- Added SNR (Signal-to-Noise Ratio) data handling to improve zero-hop bonus calculations for repeaters, enhancing selection accuracy.
- Implemented location validation checks to prioritize repeaters with valid geographic data, especially for final hop scenarios.
- Updated scoring logic to apply penalties for repeaters lacking valid location data, ensuring better routing decisions.
- Enhanced logging for SNR bonuses and location penalties to improve debugging and performance tracking.
2026-01-26 17:37:36 -08:00
agessaman
1559860dcb feat: Introduce prefix best location feature and enhance message handling
- Added configuration options for the "prefix best <location>" command in config.ini.example, allowing users to enable/disable the feature and customize its behavior.
- Implemented logic in the PrefixCommand class to find the best prefix for a given location, considering neighbor prefixes and user-defined criteria.
- Enhanced MessageHandler to skip processing old cached messages based on connection time, improving message handling efficiency.
- Updated core bot to track connection time, ensuring accurate message processing and cache management.
2026-01-26 17:15:25 -08:00
agessaman
d97c0886e7 feat: Refactor multitest command to support user sessions and improve path tracking
- Introduced a new MultitestSession dataclass to manage active multitest sessions per user, enhancing concurrency handling.
- Replaced global variables with session-specific attributes to track listening duration, collected paths, and target packet hashes.
- Updated message handling logic to check active sessions and prevent race conditions during multitest execution.
- Enhanced path collection and RF data scanning to be user-specific, improving accuracy and logging for each session.
- Implemented execution locks to ensure thread safety during multitest command execution.
2026-01-25 20:47:01 -08:00
agessaman
df8dc8cafb feat: Enhance path selection and observation tracking
- Added new configuration options for path selection presets and proximity methods in config.ini.example, allowing users to customize routing behavior.
- Implemented a new database table for storing observed paths, enabling better tracking of paths from advertisements and messages.
- Updated MessageHandler to store complete paths in the observed_paths table, improving path validation and selection accuracy.
- Enhanced the PathCommand class to utilize new proximity and recency settings, optimizing repeater selection based on user-defined criteria.
- Improved web viewer functionality to display multiple paths for contacts, enhancing user experience and interaction with path data.
2026-01-25 10:12:46 -08:00
agessaman
bd2849655c feat: Enhance mesh graph functionality and path validation
- Added a new mesh graph feature for improved path validation, allowing for enhanced routing accuracy.
- Introduced configuration options for recency decay half-life and graph-based validation settings in config.ini.example.
- Updated the PathCommand class to utilize graph-based selection methods, combining graph and geographic scores for better repeater selection.
- Implemented new methods in MessageHandler to update the mesh graph with advertisement paths and trace packet data.
- Created a new database table for mesh connections to support graph-based path validation.
- Enhanced web viewer integration to display mesh graph updates in real-time, improving user interaction and monitoring capabilities.
2026-01-23 20:26:56 -08:00
agessaman
ed1e541bed feat: Add Aurora command
- Introduced a new section in configuration files for the Aurora command, allowing users to enable/disable the feature and set default coordinates.
- Updated English translations to include descriptions, usage instructions, and error messages for the Aurora command, enhancing user interaction and support.
2026-01-20 21:38:19 -08:00
agessaman
04478acf51 feat: Refactor geocoding and country/state handling in commands
- Updated utility functions to improve country name validation, ensuring accurate identification of country names and US states.
- Enhanced geocoding logic in multiple command classes to handle default state and country configurations more effectively.
- Modified error messages to reflect the correct region based on user input, improving user experience.
- Added short usage descriptions for satellite pass commands in multiple languages, enhancing internationalization support.
2026-01-19 22:01:47 -08:00
agessaman
c53bfce4b7 feat: Enhance elapsed time handling in messages
- Updated the message handling logic to format elapsed time more accurately, displaying "Nms" when the device clock is valid or "Sync Device Clock" when invalid.
- Introduced a new utility function `format_elapsed_display` to centralize elapsed time formatting, improving code maintainability.
- Modified configuration examples to clarify the usage of the {elapsed} placeholder.
- Added translations for the "Sync Device Clock" message in multiple languages to support internationalization.
2026-01-19 09:55:31 -08:00
agessaman
93c4004e2d feat: Add unique advert packet tracking and leaderboard functionality
- Introduced a new database table 'unique_advert_packets' for tracking unique advert packets by their hash.
- Enhanced the RepeaterManager to handle unique packet tracking during daily advertisement statistics.
- Updated StatsCommand to include a new subcommand for displaying the leaderboard of nodes with the most unique advert packets in the last 24 hours.
- Modified translations to support the new advert statistics feature, ensuring user-friendly command descriptions and error messages.
2026-01-18 14:16:04 -08:00
agessaman
9a74144a8f feat: Add ZIP code geocoding support to GlobalWxCommand
- Implemented geocode_zipcode_sync to handle US ZIP code queries, ensuring accurate geocoding results.
- Enhanced location handling to prevent foreign matches for ZIP codes, improving the reliability of location-based commands.
- Added error handling for reverse geocoding failures, ensuring robust logging and feedback for invalid ZIP codes.
2026-01-18 08:08:31 -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
951ded4244 feat: Add support for custom WXSIM weather sources in wx_command and wx_international modules
- Introduced functionality to configure custom weather sources in config.ini, allowing users to specify URLs for different locations.
- Enhanced WxCommand and GlobalWxCommand classes to fetch weather data from custom WXSIM sources, improving flexibility in weather reporting.
- Implemented methods to retrieve and parse weather data from specified sources, ensuring compatibility with existing weather command structures.
- Updated documentation in config.ini.example to guide users on configuring custom weather sources.
2026-01-17 16:52:15 -08:00
agessaman
db0db96f7e feat: Add reload configuration functionality and update admin commands
- Introduced a new method `reload_config` to allow dynamic reloading of the configuration without restarting the bot, ensuring seamless updates to settings.
- Added a helper method `_get_radio_settings` to retrieve current radio settings for comparison during reload.
- Updated `admin_commands` in `config.ini.example` to include the new `reload` command, enabling admin users to reload configurations on-the-fly.
- Enhanced the `setup_scheduled_messages` method in the scheduler to clear existing jobs before reloading, preventing duplicates.
2026-01-16 19:55:44 -08:00
agessaman
d2abc49048 feat: Enhance command documentation and usage information
- Updated the `generate_html` function to include detailed command usage information, including syntax, examples, and parameters for better user guidance.
- Added CSS styles for improved presentation of command usage and parameters in the generated website documentation.
- Enhanced command classes with structured documentation fields, allowing for consistent and informative command descriptions across the platform.
2026-01-15 20:04:58 -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
Adam Gessaman
4bd48e5165 feat: Add sub-command support and usage information retrieval for commands
- Implemented `get_usage_info` method in `BaseCommand` to provide structured usage information, including descriptions, sub-commands, usage patterns, and examples.
- Enhanced `generate_html` function to display sub-commands in the generated HTML output, improving command documentation.
- Updated translations in `en.json` to include sub-command details for various commands, enhancing user guidance and interaction.
2026-01-15 10:04:09 -08:00
agessaman
11dc22ae46 feat: Implement companion location features in weather commands
- Added methods to retrieve companion and bot locations from the database and configuration.
- Enhanced weather command execution to utilize companion location if no user-specified location is provided.
- Improved location handling by supporting coordinates, zip codes, and city names, with reverse geocoding for display.
2026-01-13 21:30:27 -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
agessaman
89ecc34ef6 feat: Enhance geocoding capabilities with country and state normalization
- Added optional geocoding helper libraries for improved country name validation and US state handling.
- Implemented functions to normalize country names and US state abbreviations, enhancing location parsing accuracy.
- Updated weather command to utilize new geocoding features for better location handling in weather queries.
- Adjusted message length calculations in weather responses to accommodate dynamic content based on location information.
2026-01-12 21:10:51 -08:00
agessaman
3d654d1fba feat: Add airplanes command for aircraft tracking
- Introduced the `airplanes` command to retrieve aircraft tracking information using ADS-B API data.
- Added detailed usage instructions, location options, and filter options for enhanced functionality.
- Updated `config.ini.example` to include configuration settings for the new command.
- Included translations for command descriptions and error messages in `en.json` to support user interaction.
2026-01-12 20:05:02 -08:00
agessaman
01dc2679fd feat: Add escape sequence decoding for greeting messages
- Implemented `_decode_escape_sequences` method in `GreeterCommand` to process escape sequences like `\\n`, `\\t`, and `\\r` in greeting messages.
- Updated `_load_config` to decode escape sequences in `greeting_message` and `mesh_info_format`, enhancing user flexibility in message formatting.
- Added decoding for per-channel greetings to ensure consistent message formatting across different channels.
2026-01-12 15:51:26 -08:00
agessaman
cc3fffeb54 feat: Add command enable/disable configuration for various commands
- Implemented a configuration option for enabling or disabling commands across multiple command classes.
- Each command now checks its enabled state before execution, improving control over command availability.
- Updated the configuration loading mechanism to retrieve the enabled state from the config file for commands like Advert, AQI, Catfact, and others.
2026-01-10 09:33:15 -08:00
agessaman
f054cd5f35 fix: Improve weather string handling to prevent emoji truncation
- Updated the weather string concatenation logic to use display width for checking available space, ensuring emojis are not cut off.
- Added a buffer of 5 characters to the maximum length check to enhance the user experience when displaying weather information.
2026-01-07 17:36:49 -08:00
agessaman
578fa2caa4 fix: Prevent potential segfaults by deep copying event payloads
- Added deep copy of event payloads in multiple modules to avoid segmentation faults when events are freed.
- Updated the handling of payloads in ChannelManager, MessageHandler, DiscordBridgeService, MapUploaderService, and PacketCaptureService to ensure safe access to event data.
- Enhanced logging for cases where payloads are missing, improving error handling and debugging capabilities.
2026-01-05 17:20:15 -08:00
agessaman
a34f816af5 bug: fixed path decoding logic in PathCommand
- Improved the path decoding functionality to handle single nodes more effectively by checking for hex values.
- Added regex pattern matching to identify hex values in path parts, allowing for better decoding of repeater names.
- Updated fallback behavior for unknown formats to return the raw path string when decoding fails.
2026-01-04 15:57:56 -08:00
agessaman
e7eed79b4d docs: Add __init__ docstrings and refine type hints for client and command initializers. 2026-01-01 22:04:48 -08:00
agessaman
52d1dac3db feat: Introduce ESPN and TheSportsDB clients and enhance command code quality with type hints and docstrings. 2026-01-01 21:55:48 -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
e91370672e Refactor command response handling in CmdCommand to streamline command list retrieval
- Updated the response generation in CmdCommand to allow _get_commands_list to handle the "Available commands: " prefix internally, simplifying the code and improving readability.
- Removed redundant calculations for available length, enhancing maintainability.
2026-01-01 18:53:25 -08:00
agessaman
7b2cdf411a Refactor database connection handling in GreeterCommand to use centralized method
- Introduced a new get_connection method in DBManager to standardize database connection creation with proper configuration.
- Updated all instances in GreeterCommand where sqlite3.connect was used to utilize the new get_connection method, improving code consistency and maintainability.
2026-01-01 16:54:05 -08:00
agessaman
5eb689f1a9 Enhance weather data retrieval and formatting in wx_international command
- Updated the get_weather_for_location and get_open_meteo_weather methods to accept a MeshMessage parameter for dynamic message length calculation.
- Improved weather forecast output by including precipitation amount alongside probability, ensuring clearer communication of weather conditions.
- Adjusted message length checks to utilize the dynamically calculated maximum length, enhancing message formatting and preventing truncation.
2026-01-01 16:14:12 -08:00
agessaman
f35b77cfcc Clarify weather forecast output formatting in wx_international command
- Updated the weather forecast message to display high and low temperatures with clear labels (H: for high, L: for low) for better readability.
- Removed redundant period name from the forecast to streamline the message content.
2026-01-01 15:34:46 -08:00
agessaman
72b7ebbb1e Refactor cooldown management in command classes to utilize centralized tracking
- Removed per-command user cooldown tracking from individual command classes.
- Implemented a unified cooldown management system in BaseCommand for both global and per-user cooldowns.
- Updated command execution methods to call the new centralized cooldown handling, improving code clarity and reducing redundancy.
- Enhanced error handling and logging during cooldown checks to ensure robust command execution.
2026-01-01 12:39:46 -08:00
agessaman
5ae67bc071 Refactor command handling and enhance plugin validation
- Removed redundant command list in config example for clarity.
- Improved plugin validation by adding checks for required attributes and types, ensuring better error handling during plugin instantiation.
- Enhanced rate limiter classes to track total sends and throttled attempts, providing statistics for better monitoring.
- Updated command implementations to include metadata for better organization and clarity in command handling.
2026-01-01 12:03:54 -08:00
agessaman
e4e70930f9 Update README and enhance command functionality
- Updated README to specify submitting pull requests against the dev branch.
- Added per-trigger lockout tracking in AnnouncementsCommand to prevent duplicate sends within a 60-second window.
- Implemented dynamic maximum message length calculation in BaseCommand for better message formatting.
- Enhanced response handling in PrefixCommand to support message splitting based on calculated length.
2025-12-31 16:54:38 -08:00
agessaman
316119c3fe Add announcements command and configuration options config.ini.example 2025-12-29 20:44:00 -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
Adam Gessaman
53b31c20a5 Merge pull request #24 from lincomatic/prm8
add magic8 command
2025-12-29 16:01:53 -08:00
Adam Gessaman
a7b14df9ef Enhance magic8 command response formatting
Format the magic8 command response based on message type.
2025-12-29 16:01:11 -08:00
Adam Gessaman
b80ff093fb Merge pull request #21 from lincomatic/pr
add elapsed time for test command
2025-12-29 09:43:21 -08:00
agessaman
759ee372cb Refactor geocoding logic in wx_international to utilize geocode_city_sync 2025-12-29 09:22:06 -08:00
agessaman
251c2dbc27 Update SportsCommand with additional WHL teams and aliases
- Removed redundant team aliases for Spokane Chiefs and Vancouver Giants.
- Added new teams and their aliases for the WHL, including Tri-City Americans, Wenatchee Wild, and several others, enhancing the sports command's coverage of hockey teams.
- Updated city-to-code mappings to include new entries for better identification of teams.
2025-12-28 23:09:33 -08:00
agessaman
4ccfe86494 Enhance weather command functionality with provider selection and delegation
- Added a new configuration option in config.ini.example for selecting the weather provider (NOAA or Open-Meteo), defaulting to NOAA.
- Updated WxCommand to delegate to wx_international when the Open-Meteo provider is selected, improving global weather command support.
- Implemented fallback behavior to use wx_international as the wx command if the default wx command is missing, enhancing user experience.
- Improved logging to provide clearer information on command delegation and provider usage.
2025-12-28 21:45:22 -08:00
agessaman
055db64ded Add TheSportsDB client integration for enhanced sports data retrieval
- Introduced TheSportsDBClient class to handle API requests with rate limiting, allowing for efficient data fetching for teams and events.
- Updated SportsCommand to utilize TheSportsDB API for leagues not supported by ESPN, including Canadian Football League (CFL) and Western Hockey League (WHL) teams.
- Implemented methods for fetching team and league events, including upcoming and past games, with robust error handling and logging.
- Enhanced team and league score retrieval to support both ESPN and TheSportsDB APIs, improving overall sports command functionality.
2025-12-28 21:32:54 -08:00
agessaman
35bc6260a4 Enhance command configuration and logging for joke commands
- Added configuration sections for joke and dadjoke commands in config.ini.example, allowing channel restrictions for command usage.
- Updated BaseCommand to derive configuration section names for commands, improving consistency in command management.
- Implemented channel access checks in can_execute methods for JokeCommand and DadJokeCommand to ensure commands are only executed in allowed channels.
- Improved error logging in FeedManager and MessageScheduler to include database path information for better debugging.
2025-12-27 08:21:51 -08:00
lincomatic
e62765baf0 add magic8 2025-12-24 16:56:24 -08:00