Skip to content

A Signalbot that replies to your Signal messags using the GPT-3 API

Notifications You must be signed in to change notification settings

JtheSaw/gpt3-signalbot

 
 

Repository files navigation

GPT3-Signalbot

Tired of replying to your Signal messages? Let GPT-3 take care of it.

This repository is based on René Filip's signalbot, and bbernhard's Signal CLI REST Api

⚙️ Setup

To run, please make sure that you have Python 3.9, and docker installed. To install the dependencies run

pip install poetry
poetry install

🏃 Get it running

  1. Create a directory for the configuration. This allows you to update signal-cli-rest-api by just deleting and recreating the container without the need to re-register your signal number
export SIGNAL_CLI=$HOME/.local/share/signal-cli
mkdir $SIGNAL_CLI
  1. Now ramp up the the REST API and register our Signal Number.
docker run --restart=always -p 8080:8080 \
      -v $SIGNAL_CLI:/home/.local/share/signal-cli \
      -e 'MODE=native' bbernhard/signal-cli-rest-api

Open http:https://localhost:8080/v1/qrcodelink?device_name=signal-api in your browser, open Signal on your mobile phone, go to Settings > Linked devices and scan the QR code using the + button.

  1. Restart the server in json-rpc mode.
docker run --restart=always -p 8080:8080 \
    -v $SIGNAL_CLI:/home/.local/share/signal-cli \
    -e 'MODE=json-rpc' bbernhard/signal-cli-rest-api

As soon as the logs show time="2022-12-23T17:30:03Z" level=info msg="Started Signal Messenger REST API" the API is started successfully.

  1. Now that the API has started, we can start the bot by running poetry run python bot.py --service 127.0.0.1:8080 --phone_number <Your-Phone-Number>

Note: Per default the bot will listen, and reply to all messages. If you want the bot to reply only to specific groups you can pass the --groups argument when running the script. This argument accepts a list of group names.

About

A Signalbot that replies to your Signal messags using the GPT-3 API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 85.0%
  • Shell 9.2%
  • Dockerfile 5.8%