this post was submitted on 01 Feb 2024
160 points (98.2% liked)
Open Source
31224 readers
261 users here now
All about open source! Feel free to ask questions, and share news, and interesting stuff!
Useful Links
- Open Source Initiative
- Free Software Foundation
- Electronic Frontier Foundation
- Software Freedom Conservancy
- It's FOSS
- Android FOSS Apps Megathread
Rules
- Posts must be relevant to the open source ideology
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
- !libre_culture@lemmy.ml
- !libre_software@lemmy.ml
- !libre_hardware@lemmy.ml
- !linux@lemmy.ml
- !technology@lemmy.ml
Community icon from opensource.org, but we are not affiliated with them.
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
The bot was doing exactly that a few days ago when I got a suggestion by an user and decided to rewrite the main program to only respond to mentions. Not only does this make the program less error prone, but also smaller and more efficient. I'll keep it this way.
Boo
Why though? People were complaining about it making too much noise anyways. The optout functionality was used frequently. Plus this reduces the burden on the server and on the one hosting the bot. And I can't stress this enough but it also made the errors much easier to handle. If I were to get a timeout or some server error from the server, there was no easy way to handle it. I also had to keep two databases to keep track of opted users and checked comments. Now even if there are any errors, I can just wait a few moments and continue. The comment won't be marked as read and thus can be dealt with the next iteration of the loop. This is not easily possible with the previous way. The reason is simple: the posts were being sorted by NewComments and I was getting 10 of them. What if 10 new comments appeared in the meantime when the error was being handled? They are gone to be checked along with another new comment if the post ever gets one. This could be done with another Vector keeping track of the posts that couldn't be checked because of errors but it only makes the program more complex and I hated trying to handle these pain in the ass errors for literally like 4 functions and the code was looking very messy. The current program does not look messy and the error handling is not only more efficient but also easier to do. Honestly, I don't want to do what it was doing before because of those stuff. After I am done with my new big project, I will be probably making another Lemmy bot. If you want that functionalit so much, check the repository's commits and find the one with the old code in it. Then you can run it on your own machine or server or whatever. I might rethink this if the current mention-only way doesn't go well and switch to lemmings.world to have the benefit of having webhooks which should let me make the old way somewhat as good as the current way.