-
Notifications
You must be signed in to change notification settings - Fork 0
Regex filters
Before a manga is displayed, info about the manga is checked against the server's and channel's filters.
The template is the string the regex is tested against. Before testing, the following placeholders will be replaced with the appropriate content.
-
{{title}}
- E.g.
Bocchi the Rock!
- E.g.
-
{{artist}}
- E.g.
Hamaji Aki
- E.g.
-
{{author}}
- E.g.
Hamaji Aki
- E.g.
-
{{platformId}}
- E.g.
mangadex
- E.g.
-
{{seriesId}}
- E.g.
2e0fdb3b-632c-4f8f-a311-5b56952db647
- E.g.
-
{{tags}}
- Each tag will be separated by a comma [
,
]. - Currently MangaDex specific.
- E.g.
Comedy,4-Koma,Slice of Life,Music
- Each tag will be separated by a comma [
-
{{contentRating}}
- Can be any of the following:
Safe
Suggestive
Erotica
Pornographic
Unknown
- Will use whatever MangaDex returns. If the platform is
nhentai
, this will always bePornographic
. Otherwise, it will most likely beUnknown
. - E.g.
Safe
- Can be any of the following:
Any .NET-supported regex should be supported. The default flags are IgnoreCase
(/i
). The flags are currently not editable by server mods/admins.
(If you think a flag should be on or can think of a case where editable flags would be useful/needed, please open a GitHub issue!)
Every filters' combined runtime can be no longer than (by default) 250ms. This is to (hopefully) prevent abuse. (If you are running your own instance of Dibari, this limit is configurable in the instance's config).
Somehow i've made this hard to explain so i'll try my best.
Filter type specifies what behaviour should be followed when the filter matches. (Should the manga be blocked if the filter matches? Should only mangas that match the filter be allowed, and everything else blocked?)
Channel scope specifies whether the filter will apply in every channel except the specified channels (Exclude), or will only apply in the specified channels (Include).
For example, to block Bocchi the Rock in every channel except the #bocchi-spoilers
channel, the filter would be as follows:
-
Template:
{{title}}
-
Filter:
bocchi the rock
-
Filter type:
Block
-
Channel scope:
Exclude
-
Channels:
#bocchi-spoilers
Another example, to allow only Frieren to be pulled up in the #good-mangas-only
channel, the filter would be as follows:
-
Template:
{{title}}
-
Filter:
frieren
-
Filter type:
Allow
-
Channel scope:
Include
-
Channels:
#good-mangas-only
One more example, if you wanted every channel to only allow Oshi no Ko except the #other-series
channel, the filter would be:
-
Template:
{{title}}
-
Filter:
oshi no ko
-
Filter type:
Allow
-
Channel scope:
Exclude
-
Channels:
#other-series
And of course, if you want the filter to apply server-wide (no special channel treatment), Channel scope should be left on Exclude
and Channels
should be empty.
Will list some potentially common filters you might want to use.
-
Template:
{{contentRating}}
-
Filter:
(Erotica|Pornographic)
-
Filter type:
Block
-
Channel scope:
Exclude
-
Channels:
#nsfw