Skip to content

Commit

Permalink
new docs
Browse files Browse the repository at this point in the history
  • Loading branch information
makeding committed Jul 18, 2024
1 parent 39fb362 commit 79d035c
Show file tree
Hide file tree
Showing 12 changed files with 3,288 additions and 2,512 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
[![Deploy to cloudflare pages](https://github.com/my-telegram-bots/Pixiv_bot/actions/workflows/deploy-docs.yml/badge.svg)](https://pixiv-bot.pages.dev)

Translate by:
- deepl.com (en)
- zhconvert.org (zh-hant)
- chatgpt
- And you?
Binary file added docs/img/album-summary.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/album-summary.png.webp
Binary file not shown.
Binary file added docs/img/tourial-1-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/tourial-1-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/tourial-1-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/tourial-2-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
202 changes: 124 additions & 78 deletions docs/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,125 +2,171 @@
title: Guide
pageClass: guide
---

# Pixiv bot
A Telegram bot that helps you send illustrations from Pixiv on Telegram.
[Click here to start](tg://resolve?domain=pixiv_bot&start=67953985) | [Add bot to group](tg://resolve?domain=Pixiv_bot&startgroup=s)

![r_1](./img/r_1.jpg)
A Telegram bot that helps you send artwork from Pixiv on Telegram.

[Click to start](tg://resolve?domain=pixiv_bot&start=67953985) | [Add bot to group](tg://resolve?domain=Pixiv_bot&startgroup=s)

## Quick Start

### Message Mode

![message mode](./img/tourial-1-1.png)

The bot will respond when it detects the following links:

The bot will reply when it matches the following Pixiv link.
- pixiv.net/artworks/:id
- pixiv.net/artworks/en/:id
- pixiv.net/i/:id
- pixiv.net/member_illust.php?illust_id=:id
- pixiv.net/member_illust.php?illust_id=:id#manga
- :id (just numbers)
- :id (pure numbers)

You can include multiple links in one message and send them all to the bot at once!

### Inline Mode

The bot supports Telegram inline mode, allowing you to use the bot without switching to the bot's chat window.

## Simple usage
### Normal message mode
Just send the pixiv link to bot
Supports multiple links in one message, just send them all to bot!
Click the share button or type [@pixiv_bot](https://t.me/Pixiv_bot) to trigger the bot.

### Inline mode
Bot supports Telegram inline , click the share button or [@Pixiv_bot](https://t.me/Pixiv_bot) in the chat window to experience it.
Currently, inline only has a daily chart and id search function, but not a direct search function.
> Just type `@pixiv_bot` will be work, it's case insensitive.
> This needs to be filled in! (Only member accounts can have popularity sorting, but it's on hold for now.)
![inline mode](./img/tourial-1-2.png)

Additionally, inline mode currently requires switching to normal message mode in the following cases:

- artworks containing multiple images (multi-page)
- Using the `+spoiler`
- ugoira that have not been convert yet

> When you need to switch to normal mode, you will see a prompt like the image above:
> ![inline pm alert](./img/tourial-1-3.png)
> Click to switch to normal message mode or use the inline results just needed.
> Additionally, the search function is not yet implemented (requires Pixiv Premium), so it is on hold.
## Advanced Usage
The bot supports some customisation, here are the instructions.
Simply put, a custom configuration is to type a few more words to pass parameters when sending a work, for example, if I want to show the tag of the work in the reply, then type `+tag` and it will be shown.
If you don't want the open button, type `-open` and the open button disappears.

### Persistently save configuration
(Originally it should be made into a web version, but the web version has not been patched yet)
Use `/s` followed by configuration
The bot supports some custom configurations. Here are the configuration instructions.

Custom configuration is very simple. You just need to input some keywords along with the artwork link:
For example, `+tags` will include tags in the output.
If you don't want the open button, input `-open` to remove the button:

![demo](./img/tourial-2-1.png)

### `/s` Persist Configuration

For some parameters, like `+tags`, you might want to save them persistently. This is also very simple.
For example:

```
/s +tags -share
```
Then the bot will output works in the format of `+tags` `-share` by default
After setting it to custom configuration (such as /s -open -kb ...), you can still manually add `+open` `+kb` after the link / id to display the corresponding content

#### Give priority to group custom results in groups +overwrite
After successfully saving, the bot will output artworks with the `+tags` and `-share` configuration by default.

This feature is also applicable in groups, with options to adjust priorities to unify the format in the group. Refer to the next section for specific configurations.

### `+overwrite` Use Group Settings Instead of Personal Settings in Groups

If you want all members in the group/channel to use a uniform format, you can use:

```
/s +overwrite
```
You can overwrite your own customized results (for groups)

If you want to output a message in your own format in a group at one time, you can bring `+god` every time you send it
> For persistent configuration, please use `/s -overwrite`
> instead of `/s +god`!
### Display series on demand
One picture summary:
![r_2](./img/r_2.jpg)
Description:
- `open` controls whether to display the open button
- `share` controls whether to display the share button
- `kb` controls both the open and share buttons
> kb = keyboard
- `cp` `rm` controls whether to add a description of the image
> `+sc` adds a description to the first image only for multiple images
- `+above` show_caption_above_media
For example:
- `+open -share` displays the open button but not the share button

### Support reading links in caption +caption
`+caption` bot can read Pixiv work links in the message caption
to make all group members use the group configuration.

### Include work tags +tags
Just enter `+tag` / `+tags` in the message to display the tags of the work
> Due to the limitations of Telegram, the work tags will not be displayed when encountering some special characters (such as 《》() - ・) will not be recognized as a clickable link, and I have no way to solve this.
If you want to output your own format in the group on a single occasion, just include `+god` when sending the message.

### Add a mask to the image +sp
Type `+sp` and the bot will add a spoiler effect to the sent image
> Due to Telegram issues, it still cannot be used inline
> `+god` is not a persistent configuration, please include it every time you use it.
### Send the work in the form of a file +file
Type `+file` and the bot will directly send the original image file to you.
> and `/s +file`, then the bot will directly send the original image file to you every time
> Suitable for friends who collect original images (right-click on the web page to download is faster?)
### Custom Message Format
TODO (Refer to the configuration page)

Enter `+af` `+appendf`, the bot will send the original image file to you after sending the image
> It also supports persistent configuration
## cheatsheet

### Output works in reverse order +desc
The output works will be in the opposite order of the input links (multiple p will not be affected)
For example:
Input:
- illust 1 link
- illust 2 link
| name | alias | description | remark |
| ----------- | ---------------------------- | -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| -+tag | tags | Show artwork tags | artwork tags may not be recognized as clickable links if they contain special characters (e.g., 《》() - ・) |
| +-id | show_id | Show artwork ID | Default display format does not include %id% field, please implement through custom message format |
| -+rm | | Show only images | Do not show buttons and caption |
| +-kb | keyboard <br>remove_keyboard | Show or remove buttons | |
| +-cp | remove_caption | Show or remove captions | |
| +-open | | Show or remove open button | |
| +-share | | Show or remove share button | Forced on in inline mode that switched to mesaage mode<br>Forced off in channel|
| -+sc | single_caption | Show only one caption when sending multiple images | Cannot be used in inline mode |
| -+above | caption_above | Show caption above the image | |
| -+desc | | Send artworks in reverse order | Does not change the order of pages within a artwork |
| -+file | asfile | Send as file | Cannot be used in inline mode |
| -+af | append_file | Send images in addition to the artwork | Cannot be used in inline mode |
| -+graph | telegraph | Convert to Telegraph | Cannot be used in inline mode |
| +-album | | Send artworks as MediaGroup | Cannot be used in inline mode |
| -+one | album_one | Send all artworks as one MediaGroup | For example, if you send 2 artworks, the bot will send them as one MediaGroup instead of separately |
| -+equal | album_equal | Try to send MediaGroup artworks in balanced parts | For example, if there are 14 images, it will be split into 7+7 instead of 10+4 |
| -+sp | spoiler | Mark images as hidden (sensitive content) | Cannot be used in inline mode |
| -+caption | caption_extraction | Extract and send related artworks from image captions | Special requirement, not needed by default |
| +-overwrite | | Override user settings in groups or channels | Cannot be used in inline mode<br>Using inline mode in groups will not trigger overwrite behavior |
| +god | | Use own format in groups/channels with `+overwrite`| Cannot be used in inline mode<br>Cannot persist with `/s +god` |

### `+album` mediagroup Series

The bot supports merging multi-page artworks into one mediagroup. MediaGroup is a feature in Telegram that allows displaying multiple media in one message.

Thus, the `+album` parameter is enabled by default. If a artwork has multiple pages, all images will be packed into one mediagroup.
Additionally, Telegram limits a mediagroup to 10 images, so in cases with many images, they will still be sent separately but as mediagroups.
For cases with more than 20 images, it is recommended to use the `+graph` parameter below to convert the artworks into a Telegram page for instant preview.

Return:
- illust 2's image 1
- illust 1's image 1
- illust 1's image 2
::: details Curious? Click here to see the magic of the mediagroup series in action!
![](./img/album-summary.png.webp)
:::

### Integrate multiple works into one media group (album) +album / +one (enabled by default)
Enter `+album` / `+one` in the message, and the robot will integrate multiple works into one mediagroup
If you need to turn off this function and send one id once, then enter `-album`
> After `-album`, the order of sending pictures may change a bit, and multi-page works will still be in the media group
#### `+one`

In addition, Telegram has a limit that a mediagroup can only have a maximum of 10 pictures, so they will still be sent in pieces
If there are multiple artworks, they will all be merged into one mediagroup.

> `+equal` When the bot sends more than 10 pictures at a time, it will try to balance the number in the mediagroup. For example, if there are 16 pictures, it will be sent in 2 times, 8 pictures each time
#### `+equal`

### Display multiple works using telegraph +graph +telegraph
Enter `+graph` / `+telegraph` in the message, and the bot will integrate multiple works into a telegraph and return a telegraph link, which can be quickly previewed on the phone.
When the bot sends more than 10 images at a time, it will try to balance the number of images in each mediagroup. For example, if there are 16 images, they will be sent in 2 groups of 8 each.

> If there are too many pictures, Telegram may not show the instant preview of the message. It is recommended to be less than 200 pictures at a time.
~~Too many, my Tudou server might crash qaq~~
#### `+sc`

Show caption in the mediagroup
This feature allows you to see what is being sent directly, with the format showing only the artwork name and the number of pages. You can still customize this format.

### `+graph` `+telegraph` Convert artworks into a Telegraph page

Input `+graph` / `+telegraph` in the message, and the bot will compile multiple artworks into a Telegraph page.
It will return a Telegraph link for quick preview on mobile.

> This is part of the Telegram Instant View service, and there may be scraping failures. It is recommended to keep the number of images below 200.
> This part uses a webp conversion server. Directly visiting the telegra.ph page may collect your IP. For more details, please refer to our privacy policy.
#### Customizing title, author name, and author link in the `telegraph` link

#### Customize the title, author name and author link in the telegraph link
For example:

```
https://www.pixiv.net/artworks/91105889 +telegraph
title=白スクのやつ
title=White Swimsuit
author_name=syokuyou-mogura
author_url=https://www.pixiv.net/users/579672
```
Format, all the content after the = sign will be matched, and the line break is used as the separator

The content after the `=` will be matched, separated by line breaks.

![telegraph custom](./img/telegraph-1.jpg)

# artwork Copyright
Materials on this page are sourced from:
- [「見つけた」](https://www.pixiv.net/en/artworks/100316625)
- [XX:Me](https://www.pixiv.net/en/artworks/67953985)
- [白スクのやつ](https://www.pixiv.net/en/artworks/91105889)

Hoping to one day have the budget and opportunity to travel to `Wakayama City, Japan`
(⁠ノ゚⁠0゚⁠)⁠ノ⁠~
Loading

0 comments on commit 79d035c

Please sign in to comment.