New Community Bot - Linker

Hey everyone! Ive made a third bot for the instance called Linker. This bot will automatically detect when you try to reference a certain community and then give both relative and direct links to it in a comment for people to check out.

The usual syntax when you want to reference a community is communityname@programming.dev with communityname replaced by the community name and programming.dev replaced with the instance the community is in

It will also detect when you link a community like this https://programming.dev/c/programming

Works for both posts and comments but will only handle communities that have been entered in the bot. To start with I've put in the top 50 most active communities in the instance but will put the rest in soon

If you have any suggestions for communities to link in on other instances let me know

Source Code

20 points · 8 comments · view on lemmy.world

8 Comments

Linker@programming.dev · 3 pts · 3y (1 reply)

Hi! I noticed you mentioned some communities in your post[^Info]. Here are some links to them:

[^Info]: I am a bot, see the sections below for more info. ::: spoiler The relative links give you a 404 This is typically caused by the community not being interacted with from your instance yet. To fix this you can: 1. Go to search and switch to searching by all 2. Search for the direct link to the community 3. You should be able to now use a relative link to it (or it will pop up in search if you keep trying as it loads asynchonously) *** ::: ::: spoiler How do you add / remove a community from the bot To add or remove communities from the bot you can create an issue on the bot's Github Repository *** ::: ::: spoiler How do you trigger the bot to respond For example purposes lets say theres a community called testing on the instance programming.dev. All of these would work for both posts and comments: - testing@programming.dev - !testing@programming.dev - @testing@programming.dev - programming.dev/c/testing - https://programming.dev/c/testing

I have added many communities to be handled to the bot by default but it is not exhaustive. If you want to add your community then see the add / remove community section.
***
:::
::: spoiler Contact me
Hey I'm Ategon, the bots creator. If you have any questions, comments or just want to reach out to me heres my lemmy profile with some message buttons and links to my socials [Relative Link](/u/ategon@programming.dev) | [Direct Link](https://programming.dev/u/ategon)
***
:::
Ategon@programming.dev · 2 pts · 3y

Formatting seems to be a bit broken on jerboa since it doesn't use the same markdown but works on web

o_o@programming.dev · 1 pts · 3y (2 replies)

I lament I only have 1 upvote to give! Hold on let me spin up a bot…. (just kidding).

But seriously this is great! I wonder if it can be expanded to auto-populate communities rather than being a hardcoded list.

Ategon@programming.dev · 4 pts · 3y (1 reply)

Unfortunately not possible rn with the information the api currently gives. The only thing you can get in terms of instances is the instance id but you need the name to use it in a link

The bot might become redundant very soon though since v18 has a feature to autoconvert links into relative links

o_o@programming.dev · 1 pts · 3y

Ah I see. Well fair enough! Thanks for making it

ericjmorey@programming.dev · 1 pts · 3y

You need a relative search link for communities that haven't been subscribed to bay anyone on your instance

JackbyDev@programming.dev · 1 pts · 3y (1 reply)
Ategon@programming.dev · 3 pts · 3y

Bot seems to be struggling after the upgrade to v18. Hopefully comes back up soon