1
0
mirror of https://github.com/craigerl/aprsd.git synced 2026-06-09 09:34:42 -04:00
Files
aprsd/examples/plugins/example_plugin.py
T

20 lines
440 B
Python
Raw Normal View History

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