Python package to build your own Signal bots.
Important
Signalbot v2 is being developed at #240. Feedback on the direction is welcomed, either as a comment there or in #234
See the getting started section in the documentation.
This is what a minimal bot using signalbot looks like:
import os
import logging
from signalbot import SignalBot, Config, Command, Context, triggered, enable_console_logging
class PingCommand(Command):
@triggered("Ping")
async def handle(self, context: Context) -> None:
await context.send("Pong")
if __name__ == "__main__":
enable_console_logging(logging.INFO)
bot = SignalBot(
Config(
signal_service=os.environ["SIGNAL_SERVICE"],
phone_number=os.environ["PHONE_NUMBER"],
)
)
bot.register(PingCommand()) # Run the command for all contacts and groups
bot.start()See the documentation for more details.