Lemmy Bots and Tools

0 readers
1 users here now

Welcome to the programming.dev lemmy development community! This is a place to discuss and show off bots, tools, front ends, etc. you're making that relate to lemmy

Theres another version of this community over at lemm.ee if you want to subscribe to that one as well

Icon base by DarkZaitzev under CC BY 3.0 with modifications to add a gradient

founded 1 year ago
MODERATORS
1
 
 

Hi folks, so glad this channel is here.

Recently, I:

  • Created a community called fullmoviesonyoutube on lemm.ee
  • Decided I wanted to write a bot to post helpful comments when people post movies there.
  • Created another community called fullmoviesbottesting.
  • Created a user on lemm.ee called fullmoviesbot
  • Wrote and tested the bot from my PC using the lemmy-bot as a starting point, pointing it at that 'fullmoviesbottesting' community, until I was finally pretty happy with it.
  • Updated the bot's code so the federation - allowlist points to 'fullmoviesonyoutube' on the same lemm.ee instance.
  • Ran the bot, created a post with my personal lemmy account.... and nothing happened.

The bot is not creating comments in the new channel. It's like it doesn't see posts created by any other users.

Is there something I need to do to get my bot to recognize posts from other users in the new channel?

I did a test where I logged into lemm.ee in my browser with the bot's user, and created a post and the bot created a comment on that post, but for some reason, that bot-created post doesn't show up in the community. This is that "orphaned" post: https://lemm.ee/post/2896238

I guess another way to ask this - what are the rules for bot's when it comes to creating comments on other user's posts?

EDIT


Here's the full code: https://controlc.com/dd54eae6

(it's rough - don't judge me) Thanks!

2
1
submitted 1 year ago* (last edited 1 year ago) by rikudou@lemmings.world to c/lemmy_dev@programming.dev
 
 

You can find it here. Source code in the link.

3
 
 

I have tried to decode jwt, but sub field refers to completely different user

4
 
 

I've updated the bot and added the possibility of translating hardcoded links (like this one: https://lemmy.world/post/2355178 or this one: https://lemmy.world/comment/1863672) to posts/comments with links from your instance when you mention him. I'll show an example in comments.

5
 
 

It now supports 0.18.3 and contrary to previous releases it supports unauthenticated requests where it makes sense.

https://github.com/RikudouSage/LemmyApi/

6
 
 

I created a discord bot which gets memes from lemmy RSS feeds and posts them to discord. I'm still learning, please suggest improvements/features!

7
 
 

Lemmy devs, please share if you built any tool that backup a single user's Lemmy account, settings, subscriptions - then can migrate or restore the account as new into other instance. This tool will be used by the user themselves, not by the instance admin.

Can we migrate a user's post and comments to another instance? Maybe like a bulk posting as new posts.

8
1
submitted 1 year ago* (last edited 1 year ago) by Ategon@programming.dev to c/lemmy_dev@programming.dev
 
 

With lemmy.world having published their own set of bot guidelines I figured I should make some here as well to get some parity

The rules are less strict than lemmy.worlds rules within the confines of programming.dev but for communities in instances outside programming.dev default to the lemmy.world rules unless told otherwise

Bot Guidelines:

  1. Mark Bots as Bots Bot accounts should be marked that they are a bot using the checkbox in the user settings. This includes any automation in an account (if you automate part of your personal account, put what the automation is in your bio so people know)
  2. Put contact info The owner of the bot and some way to contact them must be in the bot's bio (unless its an automated personal account, in that case the account itself it the way to contact)
  3. Use mentions as prefix If a bot has commands it should use its mention as a prefix. (This will allow different bots to use the same commands without interfering with each other)
  4. Dont spam Bots should not spam posts or comments. (If a bot command has been used its fine to do a response but dont drown out non bot posts in the local new sort.) Certain cases are unavoidable such as if you want to get a bot posting weekly threads in different communities at the same time but in those cases please contact me first to get it approved
  5. Allow mods to opt in Bots participating in a community should be opt in so communities can choose what bots they want. If you want a bot to be allowed in a community please contact the moderators of that community first. EXCEPTION: If a bot is deemed to be a well behaving bot that brings net good to the instance it can override this rule as long as it has been approved by an admin. This can include things such as a tldr bot, remindme bot, link fixer bot, piped link converter bot, etc. If a bot has overriden rule 5 with this exception community moderators should still be able to opt out of the bot

These rules should bring us up to parity with lemmy.world along with allowing a bit more leeway within the instance since there has been some nice bots getting made that I dont want unfairly punished

If you have a bot you want whitelisted for the entire instance for the rule 5 exception feel free to dm me here or on matrix

And if anyone has any suggestions for changes to these rules feel free to comment them. They can be adjusted as needed if any issues with them come up

9
 
 

cross-posted from: https://lemmy.world/post/1860512

As we see more and more bots on Lemmy World every day, it’s about time we publish a set of rules for bots and bot-owners.

So here goes:

  • Bots shall not be used for any kind of advertising.

  • The bot accounts must be clearly marked as a bot.

  • The owner of the bot and contact details must be mentioned in the bot’s bio.

  • Bots are only allowed to post in communities they have the explicit permission from the community’s owners to do so.

  • Bots from other instances that post in Lemmy World communities must follow the same rules.

  • Bots shall not just be posting Reddit content.

  • Bots shall not be “spammy”, as in multiple posts per minute.

  • Breaking any of these rules will result in a ban for the Bot and, if required, its owner.

  • Commands must use the bots mention as prefix, and not a text prefix like !help

These rules will be updated when needed.

10
11
 
 

Consolidation is a big requested feature. Well, we can do that today with bots. Instead of Reddit-reposting bots, lets use Lemmy-bots to repost and consolidate Lemmy communities together.

EDIT: The community will need to be moderator only, the bot should be a moderator. Posts/comments should be mapped to the original topic. I think the only feature needed from Lemmy-developers is some way to globally link to a topic? But we can kind of work around that issue by making a consolidation-bot / consolidation-community be server-specific?

12
 
 

I'm new to lemmy, only been here a few days, but I have already ported over one of my reddit bots to Lemmy and it was really easy, like orders of magnitude easier than it was to get my first reddit bot working.

There are lots of wrappers available and I am researching everything to figure out how best to proceed with a more serious bot. Most of my scripts for reddit were moderation tools. Lemmy doesn't seem large enough to need a lot of moderation yet, but I still want to get to work creating things because it's fun.

I'm finding documentation scarce in some cases so I just wanted to pose a question here. On reddit, if I want to look at posts (or comments, reports, modqueue, and so on) I iterate through a listing and then narrow my search based on what type of post I need.

Does Lemmy use listings, or how do you process posts/comments in the same fashion as you'd do over there?

I haven't had to take any mod actions yet because I don't have any reports, so I haven't really explored any of the mod actions via the api.

13
 
 

Bot I made for the !community_request@programming.dev community to notify me when a post got a large amount of upvotes so I can make the requested community. Can be adapted for different cases if you want to ping someone, give a congratulations message, etc.

If you have any feature requests feel free to throw them into the issues tab in the repo

14
 
 

So I've got this dumb idea, but who knows, maybe it will work?

Lemmy seems to support uploading content, and .mp4 seems to be universally supported on modern web-browsers (phone, Windows, Linux, and Mac).

There's a number of animations that can be described in textual form: Chess puzzles, Go puzzles, and other boardgames. Or video game strategies (Age of Empires 2 build orders. Starcraft). Factorio designs, etc. etc.

For example, in the game of Tetris, strong players would help teach the game to newer players through the use of Fumens. This particular Fumen is represented by the base64-encoded data: v115@BhilFeAtglR4Beg0RpBtR4Ceg0RpAtzhAeh0JeAgWW?AURVSASYNuEw488AQr78AwKY5DkoBAAvhBtsuAAlsBzgQ4I?eR4CeRpwhBeglQ4CeRpwhAeAtglFewhBthlEewhAtKeAAPX?AS1STAS4kcDnoo2AMoo2AQieeEFcxCA, which could theoretically turn into a .mp4 animation describing the different positions of the game of Tetris.

So if a strong Tetris player wanted to discuss a Tetris position, they'd enter Fumen (Javascript), create the rendering, and then call the bot with (!fumen2mp4 v115@BhilFeAtg...), and then the bot would reply by uploading a .mp4 of the Fumen positions, to allow different Tetris players to communicate about the game.

I recognize that's a lot more work than a typical bot, but hey, lets exchange some of the more "difficult" ideas that might be worth working on.


Again: many games require this kind of visualization to have good discussions. Tetris is one obvious example, but so does Chess, Go, maybe Settlers of Catan, Magic the Gathering, and more.

15
1
submitted 1 year ago* (last edited 1 year ago) by Ategon@programming.dev to c/lemmy_dev@programming.dev
 
 

Heres a list of lemmy bots that you can find! If you have any to add feel free to add a reply and mention them


Global Bots (active in most instances)


  • ⌛ RemindMe (programming.dev) - A reminder bot that triggers off of both mentions and keywords to catch people trying to use the reddit bot syntax.

  • ⌛ remindme (lemmy.icyserver.eu) - A reminder bot that triggers off of mentions.

  • 🔗 CommunityLinkFixerBot (lemmings.world) - A bot that responds with fixed links to communities when a regular community link is posted so people dont have to leave their instance


Programming.Dev Bots (active in certain communities in programming.dev)





  • 🤖 AutoTLDR - A bot that creates a summary of a post, comment, or link when mentioned


feddit.nl Bots (active in certain communities in feddit.nl)


  • 📈 tcbot - A bot that shows currently trending communities

16
 
 

Im currently hosting this bot here on programming.dev and have it set to federate with everything programming.dev does so you dont need to self host

To trigger the bot just tag @RemindMe@programming.dev at the start of your comment and then put the amount of time you want to be reminded in

  • Supports everything from seconds to years up to a maximum of 10 years
  • Supports other activitypub platforms as long as they can make a message in lemmy (ex. mastodon)

If you have any improvements or suggestions feel free to make an issue/pull request in the repo

~~Edit: Now works based on keywords so you can summon it with !remindme instead of a full ping~~ See edit 4

~~Edit 2: Kbin seems to break it if your comment doesnt have language set to english. Not something I can fix, kbin is going to have to~~ See edit 3

Edit 3: Ive fixed the kbin bug for all communities in the instance. No promises if it doesnt respond in a non programming.dev instance though as their language settings may be different and block replies to your comments

Edit 4: The bot is temporarily offline so I can make it follow the lemmy.world bot guidelines

17
 
 

This is a bot I made for the programming books community here on programming.dev to prevent pirating but can be adapted to any community.

It has functionality for both a whitelist and a blacklist and has templates so you can share ban lists between communities. It also detects in both posts and comments

Since it deals with deleting messages it needs mod permissions in communities you want to use it for

Feel free to dm me if you need some help with getting it set up

18
 
 

The bot api got updated so updated my rss feed bot to V0.18 as well

It auto posts new things from rss feeds into communities. I currently have it set up in !godot@programming.dev !unity@programming.dev and !unreal_engine@programming.dev posting official news from the engines and some other people are using it as well (one having adapted it to post news from their city)

If you want to set it up and are having issues feel free to ask me about it.

In this update theres also some other things about the bot that have changed

  • Data is now pulled from a yaml file so its easier to deal with as opposed to digging through the javascript code in order to change stuff
  • Important values such as how long the bot will wait before checking for new posts have been parameterized
  • You can now post things that are in two rss feeds or in one rss feed but not another if you want to filter posts down a bit more
  • You can set a date cutoff for how long ago you want to backpost posts from
19
1
Regex for lemmy spoilers (programming.dev)
submitted 1 year ago* (last edited 1 year ago) by starman@programming.dev to c/lemmy_dev@programming.dev
 
 

Through trial and errors, I've created regex for lemmy spoilers:

/:::\sspoiler\s+(?<title>.+)\n(?<body>[\s\S]+?)\n:::/g

link to regex101.com with explanation

20
21
 
 

Hello!

While discussing about privacy on Lemmy and in the Fediverse, I've stumbled upon an idea that would solve some of the issues inherent to the fact that you need to have a home instance, that is under control of someone you have to trust. But my knowledge about ActivityPub is lacking, and I'm not sure if something like this would be possible or not. Also - it possible that something like that already exists, but I didn't manage to find anything.

So, would it be possible to create a Fediverse/ActivityPub app that is just a self-hosted frontend for interacting with other apps, such as Lemmy or Mastodon, that only hosts your own personal data related to your account, but not the content you post to other instances?

The main thing I'm unsure with is how Fediverse works in this regard - who hosts the content. If my home instance is programming.dev, and I create a Post or a Comment on lemmy.ml, who is the source of truth for that post? Does the content get saved on my home instance, and Lemmy.ml only gets an ID that it queries if an user requests it, or do I send the content to Lemmy.ml to live on their server?

Depending on this, it would make such a self-hosted app easier or harder. If the content lives on the instance I post it to, it would mean that you can create a fediverse app that only stores your personal user information and DMs, and you don't have to deal with serving your posts to others - because they live on the other instance you posted it to. Then all that would be left is to create an UI for displaying and querying content from other instances, and you have a way how to interact with the Fediverse without risking any of your personal private data.

On the other hand, if the content would have to live on my instance, I would have to deal with serving it to whoever requests it, which would make it a lot harder to self-host.

I kind of hope it's the first option, because then it would allow for public communities of content-only servers while also letting users have their own personal-data only instances that allows them to interact with the rest. And I really like that idea, because it would allow you to for example have reliable E2E for messages, since you have the code that generates and stores the private certificate under absolute control, and only need to share your private key with others.

In general, it seems like a great solution to many privacy problems on the Fediverse, and if something like that would be possible (without having to serve the content, because then it may get too resource-intensive for a regular user), I would definitely try to come up with such a solution.

And now that I think about it - if you actually have to host the content, then it maybe be possible to create a combination of user-data / content servers, where you select a public community run content server to host your data, and have the personal user-data server self-hosted. And if a request comes to your user-data server for content, you just redirect it to the community-ran server. But that's just brainstorming.

22
23
 
 

cross-posted from: https://programming.dev/post/428156

Discovered from this Hacker News post:

24
 
 

New libraries are springing up all over currently. Which one's have you seen that looked promising / interesting?

Which one's are you planning to utilize for bot creation?

25
 
 

cross-posted from: https://programming.dev/post/371748

If you're familiar with the topic of awesome lists on GitHub, then you should know that there is a community driven list just for Lemmy, including a convenient aggregation of links to instances, alternative front-ends, mobile apps, libraries, tools, guides, etc.

view more: next ›