This post is about @TankieReplyBot@lemmygrad.ml. It’s a configurable bot running my lemmy-reply-bot software.

Currently, it has the following functionality:

  • If one or more YouTube links are detected in a comment or post, the bot will reply with links to the same video on three different Invidious instances.
  • If one or more Reddit links are detected in a comment or post, the bot will reply with links to the same location on various Teddit and Libreddit instances.
  • If one or more URLs preceded by !archive are detected in a comment or post, the bot will reply with links to various archive sites for the URL.

Config file for my instance of the bot
[lemmy]
instanceURL = "wss://lemmygrad.ml"

[lemmy.account]
userOrEmail = "TankieReplyBot"
password = 'Insert Password Here'

[[reply]]
regex = '!archive (https?)://([.\w\d]+\.[\w\d]{2,4}[\w\d?&=%/.-]*)'
msg = '''
Here are the archive links you requested:

{{range $i, $match := .Matches}}
{{if len $.Matches | ne 1}}Link {{add $i 1}}:{{end}}
- [archive.vn](https://archive.vn/{{$match.Item 1}}://{{$match.Item 2}})
- [archive.org](https://web.archive.org/web/{{$match.Item 1}}://{{$match.Item 2}})
- [ghostarchive.org](https://ghostarchive.org/search?term={{$match.Item 1}}://{{$match.Item 2}})
{{end}}
'''

[[reply]]
regex = '!paywall (https?)://([.\w\d]+\.[\w\d]{2,4}[\w\d?&=%/.-]*)'
msg = '''
One of these links should get rid of the paywall! :3

{{range $i, $match := .Matches}}
{{if len $.Matches | ne 1}}Link {{add $i 1}}:{{end}}
- [1ft.io](https://1ft.io/{{$match.Item 1}}://{{$match.Item 2}})
- [12ft.io](https://12ft.io/{{$match.Item 1}}://{{$match.Item 2}})
- [archive.ph](https://archive.ph/{{$match.Item 1}}://{{$match.Item 2}})
{{end}}
'''

[[reply]]
regex = '(https?)://(www\.google\.com/amp/s/([.\w\d]+\.[\w\d]{2,4}[\w\d?&=%/.-]*))'
msg = '''
I found {{if len .Matches | eq 1}}a Google AMP link{{else}}Google AMP links{{end}} in your {{.Type}}! I've removed Google's spyware for you! :3

{{range $i, $match := .Matches}}
{{if len $.Matches | ne 1}}Link {{add $i 1}}:{{end}}
- [Regular Link]({{$match.Item 1}}://{{regexReplaceAll `/?\.?amp` ($match.Item 3) ""}})
{{end}}
'''


[[reply]]
regex = 'https?://(?:(?:www|m)\.)?youtu(?:\.be/|be\.com/(?:watch\?v=|shorts/))([\w\d-]{11})[&?]?([\w\d?&=%/-]*)'
msg = '''
{{if len .Matches | eq 1}}A YouTube link was{{else}}YouTube links were{{end}} detected in your {{.Type}}. Here are links to the same {{if len .Matches | eq 1}}video{{else}}videos{{end}} on Invidious, which is a YouTube frontend that protects your privacy:

{{range $i, $match := .Matches}}
{{if len $.Matches | ne 1}}Link {{add $i 1}}:{{end}}
- [yewtu.be](https://yewtu.be/watch?v={{$match.Item 1}}&{{$match.Item 2}})
- [inv.zzls.xyz](https://inv.zzls.xyz/watch?v={{$match.Item 1}}&{{$match.Item 2}})
- [invidious.io.lol](https://invidious.io.lol/watch?v={{$match.Item 1}}&{{$match.Item 2}})
{{end}}
'''

[[reply]]
regex = 'https?://(?:www\.|old\.)?reddit\.com/((?:r|user)/[\w\d?&=%/-]*)'
msg = '''
{{if len .Matches | eq 1}}A Reddit link was{{else}}Reddit links were{{end}} detected in your {{.Type}}. Here are links to the same {{if len .Matches | eq 1}}location{{else}}locations{{end}} on Teddit and Libreddit, which are Reddit frontends that protect your privacy.

{{range $i, $match := .Matches}}
{{if len $.Matches | ne 1}}Link {{add $i 1}}:{{end}}
- [teddit.zaggy.nl](https://teddit.zaggy.nl/{{$match.Item 1}})
- [teddit.hostux.net](https://teddit.hostux.net/{{$match.Item 1}})
- [r.darklab.sh](https://r.darklab.sh/{{$match.Item 1}})
- [reddit.smnz.de](https://reddit.smnz.de/{{$match.Item 1}})
{{end}}
'''

[[reply]]
regex = 'https://(?:i\.)?imgur.com/((?:a|gallery)?/?[A-Za-z0-9]{5,8}(?:\.[a-zA-Z]+)?(?:[\w\d?&=%/.-]*))'
msg = '''
{{if len .Matches | eq 1}}An Imgur link was{{else}}Imgur links were{{end}} detected in your {{.Type}}. Here are links to the same {{if len .Matches | eq 1}}location{{else}}locations{{end}} on alternative frontends that protect your privacy.

{{range $i, $match := .Matches}}
{{if len $.Matches | ne 1}}Link {{add $i 1}}:{{end}}
- [imgur.artemislena.eu](https://imgur.artemislena.eu/{{$match.Item 1}})
- [rimgo.projectsegfau.lt](https://rimgo.projectsegfau.lt/{{$match.Item 1}})
- [imgin.voidnet.tech](https://imgin.voidnet.tech/{{$match.Item 1}})
{{end}}
'''