Lemmy Bots and Tools

449 readers
16 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
26
 
 

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.

27
28
 
 

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?

29
 
 

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.

30
 
 

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

31
 
 

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.

32
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

33
 
 

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

34
 
 

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

35
 
 

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
36
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

37
38
 
 

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.

39
40
 
 

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

Discovered from this Hacker News post:

41
 
 

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?

42
 
 

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.