Lemmy Webhook - add webhook support to your Lemmy instance

Note that unless you’re a Lemmy instance admin, this doesn’t have much use to you.

Until this package came along, if you wanted a bot that responds to events, you had to manually traverse all comments/posts/whatever at a fixed interval. With this package you can actually react to events directly from the database. It’s implemented in a very efficient way by connecting the package directly to the Lemmy database and using native Postgres features to get the events (LISTEN/NOTIFY if you want to get technical).

The webhooks themselves are inserted into a separate SQLite database (API is coming) and allow for both simple and complex filtering of the incoming data. The system is already in use by two of my bots, @ChatGPT and @DallE who now both receive the information about being tagged in a comment in seconds (the actual reply takes a little longer, but that’s because of the nature of the bot).

Currently you can be notified about a post or a comment, other types are trivial to include as well.

Let me know what you think!

onlinepersona,

Hold on, so the events are put into an SQLite database and in the future an API will come? I’m a little confused. From reading the description I thought this would call a HTTP endpoint with a JSON payload, but instead the consumer will have to poll an SQLDB or an API in the future?

CC BY-NC-SA 4.0

rikudou,

Sorry, bad wording. The README of the package should be clearer.

But in short, this package takes care of the low level interaction with the database and you define the webhooks you’re interested in yourself.

So if you want to create a http request every time someone creates a comment with a specific username in the text, you configure it as a webhook in the SQLite database and next time it happens, the URL will be called.

By the api I meant that in the future you’ll be able to manage the webhooks using an api instead of inserting them directly into the db.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • opensource@programming.dev
  • kavyap
  • thenastyranch
  • cubers
  • ethstaker
  • InstantRegret
  • DreamBathrooms
  • ngwrru68w68
  • magazineikmin
  • everett
  • Youngstown
  • mdbf
  • slotface
  • rosin
  • GTA5RPClips
  • JUstTest
  • khanakhh
  • normalnudes
  • osvaldo12
  • cisconetworking
  • provamag3
  • Durango
  • tacticalgear
  • modclub
  • Leos
  • megavids
  • tester
  • anitta
  • lostlight
  • All magazines