1
0
mirror of https://github.com/craigerl/aprsd.git synced 2025-06-16 13:22:27 -04:00
aprsd/examples/plugins/example_plugin.py

20 lines
440 B
Python
Raw Normal View History

import logging
2025-01-07 10:22:01 -05:00
from aprsd import packets, plugin
LOG = logging.getLogger("APRSD")
class HelloPlugin(plugin.APRSDRegexCommandPluginBase):
"""Hello World."""
version = "1.0"
# matches any string starting with h or H
command_regex = "^[hH]"
command_name = "hello"
2025-01-07 10:22:01 -05:00
def process(self, packet: packets.MessagePacket):
LOG.info("HelloPlugin")
reply = f"Hello '{packet.from_call}'"
return reply