Go to file
2023-10-05 20:56:38 +06:00
.github/workflows add deployment to docker 2023-10-05 20:40:01 +06:00
gradle update dependencies 2023-10-05 20:29:43 +06:00
src/main/kotlin update dependencies 2023-10-05 20:29:43 +06:00
.gitattributes Initial commit 2022-09-07 00:24:01 +06:00
.gitignore final preparings to test 2022-09-07 20:40:01 +06:00
build.gradle first version of bot 2022-09-07 20:13:39 +06:00
docker-compose.yml temporal progress 2022-09-07 15:01:03 +06:00
Dockerfile add default dockerfile 2023-10-05 20:56:38 +06:00
gradle.properties add deployment to docker 2023-10-05 20:40:01 +06:00
gradlew Initial commit 2022-09-07 00:24:01 +06:00
gradlew.bat Initial commit 2022-09-07 00:24:01 +06:00
LICENSE Initial commit 2022-09-07 00:24:01 +06:00
Makefile Initial commit 2022-09-07 00:24:01 +06:00
nonsudo_deploy rename nonsudo_deploy 2023-10-05 20:51:35 +06:00
README.md Update README.md 2022-09-26 12:03:54 +06:00
sample.config.json fill sample.config.json 2022-09-07 20:14:20 +06:00
sample.deploy.sh fixes 2023-04-16 13:28:40 +06:00
sample.docker-compose.yml final preparings to test 2022-09-07 20:40:01 +06:00
sample.Dockerfile fixes 2023-04-16 13:28:40 +06:00
settings.gradle change project name 2022-09-07 16:24:56 +06:00

BooruGrabberTelegramBot

Bot for booru-boards grabbing. It uses imageboard-api for requests to boards and support next boards as well as imageboard-api:

  • Rule34
  • e621
  • Konachan
  • Yande.re
  • Danbooru
  • Safebooru
  • Gelbooru
  • e926

Sample bot presented here: @booru_grabber_bot

Available commands

Bot have two helping commands: /start and /help. These commands will return help for bot /request//enable commands:

Usage: enable [OPTIONS] QUERY...

Options:
  -n INT                           Amount of pictures to grab each trigger
                                   time
  -k, --krontab TEXT...            Krontab in format * * * * *. See
                                   https://bookstack.inmo.dev/books/krontab/page/string-format
  -b, --board VALUE                Board type. Possible values: r34, e621,
                                   konachan, yandere, danbooru, safebooru,
                                   gelbooru, e926
  -g, --gallery                    Effective only when count passed > 1. Will
                                   send chosen images as gallery instead of
                                   separated images
  -r, --rating [safe|general|questionable|sensitive|explicit]
  -a, --attach_urls
  -h, --help                       Show this message and exit

Arguments:
  QUERY  Your query to booru. Use syntax "-- -sometag" to add excluding of
         some tag in query

As said previously, there are /request and /enable

Request parameters

I will omit obvious parameters like -n.

  • -b/--board - select which board to use
  • -n (optional, default 1, max 10)
  • -k/--krontab (optional) - use krontab-string for setting up request from time to time. Unfortunatelly, currently supported only main five settings: seconds, minutes, hours, days and months
  • -g/--gallery (optional) - flag indicates that in case you passed -n more than 1 messages should be sent as media group
  • -r/--rating (optional) - rating of images in requests
  • -a/--attach_urls (optional) - will force bot to attach url of image to the sent images

Besides, after all parameters you should add query for the board like rem_(re:zero):

/request -n 3 -a -b safebooru -g rem_(re:zero)

If you want to use negative query parameters, you must escape them with -- before parameter:

-- -1girl (exclude posts with 1girl tag)

Bot remember which posts it already has sent to the chat. So, there should not be repetitions in the sent images

Samples

All the samples will use query rem_(re:zero) -- -1girl (in fact it is query rem_(re:zero) -1girl) and -r safe just to make request suitable for work.


Sample from above to request 3 photos in gallery mode from safebooru with urls attaching:

/request -n 3 -a -b safebooru -g rem_(re:zero) -- -1girl

Same sample as above, but with requests each day at 22:00 UTC

/enable -k 0 0 22 * * -n 3 -a -b safebooru -g rem_(re:zero) -- -1girl

Same sample as above, but with requests each day at 22:00 UTC

/enable -k 0 0 22 * * -n 3 -a -b safebooru -g rem_(re:zero) -- -1girl

Will enable autorequests of images using krontab and other parameters.

Sample:

/enable -n 3 -k 0 0 18 * * -b safebooru -g 1girl gradient

You may use the same syntax with just replacing of /enable by /request