You are browsing as a guest. Sign up (or log in) to start making projects!

Tangled Slackbot

  • 4 Devlogs
  • 7 Total hours

a bot similar to the @Github bot on slack, but for tangled.org (an open source github alternative, federated with atproto)

Open comments for this post

2h 13m 26s logged

i did some small changes to the update puller, just making it more reliable and functional.

the modal now actually saves the data to an sqlite database. it will also check if there is an existing entry thats exactly the same.

next ive got to check if the user actually has permissions to send messages in that channel, and then im going to setup actually sending the messages

i did some small changes to the update puller, just making it more reliable and functional.

the modal now actually saves the data to an sqlite database. it will also check if there is an existing entry thats exactly the same.

next ive got to check if the user actually has permissions to send messages in that channel, and then im going to setup actually sending the messages

Replying to @thirtyseven

0
2
Open comments for this post

1h 45m 4s logged

I made the modal that you use to configure your alerts. this code is complete spaghetti (dont read it please), for reasons ill get in to.

displaying the modal was easy, as was actually designing it.

the bot will validate your repo name and channel selection before continuing, which is annoying. the repo validation is simple, it just quickly tries to pull the atom feed to check if the repo exists.

the channel validation is harder somehow, it has its own nested try-except block, because the only methods of checking if the bot is present will raise an exception if it isnt. so i spent like an hour fighting with that.

in one of my attempts to solve this i actually had three nested try-except blocks (including the main one for the function), one of which was inside the exception handler for another. i hate the slack api

these images are just the various failures the bot can return if you dont input things properly, also one of just the modal itself

I made the modal that you use to configure your alerts. this code is complete spaghetti (dont read it please), for reasons ill get in to.

displaying the modal was easy, as was actually designing it.

the bot will validate your repo name and channel selection before continuing, which is annoying. the repo validation is simple, it just quickly tries to pull the atom feed to check if the repo exists.

the channel validation is harder somehow, it has its own nested try-except block, because the only methods of checking if the bot is present will raise an exception if it isnt. so i spent like an hour fighting with that.

in one of my attempts to solve this i actually had three nested try-except blocks (including the main one for the function), one of which was inside the exception handler for another. i hate the slack api

these images are just the various failures the bot can return if you dont input things properly, also one of just the modal itself

Replying to @thirtyseven

0
5
Open comments for this post

1h 7m 58s logged

i made the function for gathering all notifications.

it first pulls the repo list from a database file. it then calls the function i made previously to get updates to their atom feeds. it then does some filtering and writes all of them to a list.

this was annoying just because i changed my mind about the formatting for the output like three times and so i made progress slowly

the image here is the pycharm debugger showing the data the function returns. you can see it returning the notif type, the title, the listed author, the description, a link, and then the datetime

sidenote, but it kinda pmo how tangled’s whole thing is decentralised stuff, and then they dont return DID stable urls in these atom feeds

i made the function for gathering all notifications.

it first pulls the repo list from a database file. it then calls the function i made previously to get updates to their atom feeds. it then does some filtering and writes all of them to a list.

this was annoying just because i changed my mind about the formatting for the output like three times and so i made progress slowly

the image here is the pycharm debugger showing the data the function returns. you can see it returning the notif type, the title, the listed author, the description, a link, and then the datetime

sidenote, but it kinda pmo how tangled’s whole thing is decentralised stuff, and then they dont return DID stable urls in these atom feeds

Replying to @thirtyseven

0
3
Open comments for this post

2h 10m 2s logged

spent about an hour and a half making the logic to pull updates from the repos. tangled provides atom feeds, but some of the data can be inconsistent, which is annoying.

the rest was spend making some setup functions to initialize the sqlite db and clear the old atom feed data. my plan is to have the bot not track updates during downtime, so people dont get spammed when it comes back online

spent about an hour and a half making the logic to pull updates from the repos. tangled provides atom feeds, but some of the data can be inconsistent, which is annoying.

the rest was spend making some setup functions to initialize the sqlite db and clear the old atom feed data. my plan is to have the bot not track updates during downtime, so people dont get spammed when it comes back online

Replying to @thirtyseven

0
19

Followers

Loading…