aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 37e3abe3a94e0ebdde26d2509392be5e8718201d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# Sekoohaka

Telegram Image Board Bot written in Z Shell (zsh)

Search posts, pools and tags on various booru-like Image Boards,  
Authorize to expand limits and access private favorites,  
View post information, tags, get original file,  
Do MD5 hash lookup to find post by a hash,  
Reverse search image with SauceNAO,  
Create and save inline shortcuts

## Requirements

### Commands

BusyBox is a hard-coded dependency and cannot be replaced with alternatives!

* zsh
* busybox
* curl
* jq
* recode

For distribution specific installation commands follow [command-not-found](https://command-not-found.com/).

### BusyBox functions

* base64
* cut
* find
* grep
* head
* ls
* sed
* sha1sum
* sleep
* tail
* tar

## Deployment

Usage: `./bot.zsh [options] [token]`

For better performance, it is recommended to use a locally deployed [Telegram Bot API](https://github.com/tdlib/telegram-bot-api) server.

### Available options

```
Options:
  -h            Show help information
  -a <addr>     Telegram Bot API address, default: api.telegram.org
  -o            Allow SauceNAO with unknown Telegram Bot API instance
  -l            Use local Telegram Bot API, address: 127.0.0.1:8081
  -r <num>      Inline results limit, max: 50, default: 10
  -g <num>      Shortcuts storage limit, max: 10000, default: 500
  -m <mode>     Cache mode, default: normal
  -t <secs>     Cache expiration time, max: 1000, default: 300 secs
  -s <secs>     Sleep duration time, max: 100, default: 10 secs
  -c            Do not clear cache automatically
  -q            Do not print logs
  -i <secs>     Telegram Bot API connetion timeout, max: 5, default: 5 secs
  -e <secs>     Image Boards API connetion timeout, max: 5, default: 5 secs
  -f <secs>     Connrefused timeout, max: 2, default: none
  -n <addr>     Proxy server for Telegram Bot API
  -x <addr>     Proxy server for Image Boards/SauceNAO API

Cache modes:
  none          No cache reuse
  normal        Reuse inline results and posts cache
  advanced      Extract posts cache from inline results
```

### Default user

You can configure default user to let users without an account on certain Image Board or SauceNAO still have access to it with extended limits

Make sure to turn bot off before any data manipulation

Simply copy desired data from your user directory to `users/0`

| Data | Name |
| :--- | :--- |
| `safebooru` | Safebooru |
| `danbooru` | Danbooru |
| `idolcomplex` | Idol Complex |
| `sankakuchannel` | Sankaku Channel |
| `konachan` | Konachan |
| `yandere` | Yandere |
| `saucenao` | SauceNAO |


## Supported Image Boards

* [Safebooru](https://safebooru.donmai.us/)
* [Danbooru](https://danbooru.donmai.us/)
* [Idol Complex](https://www.idolcomplex.com/)
* [Sankaku Channel](https://www.sankakucomplex.com/)
* [Konachan](https://konachan.com/)
* [Yandere](https://yande.re/)

## Donation

If you want to support this bot development you can donate any amount of these cryptocurrencies

| Currency | Address |
| :---: | :---: |
| BTC | `bc1qqr8yryvx43y6p3kg7y2cw32w6tv748el7k38ff` |
| ETH | `0x8993D744dF7183e112E2A4489991890f6a143104` |
| BNB | `0x8993D744dF7183e112E2A4489991890f6a143104` |
| TON | `UQBdoPQq3akozSLiWqt6x2Rizv0TrxHzRjczoztFN-LMCwGO` |