lightnovel-crawler
lightnovel-crawler copied to clipboard
Revamp the discord interaction format
Discussed in https://github.com/dipu-bd/lightnovel-crawler/discussions/1318
Originally posted by mensch272 March 30, 2022
Proposal
I'm essentially proposing forgoing the current start
and the other choices that follow by introducing a small domain-specific language.
Grammar
The following describes the grammar in a readable manner.
Download => [download] <url> [from <from:int>] [to <to:int>] [into <...target:str>]
Select => [select] <option:int>
Close => close [session]
Search => search [with] <key:any>
Status => [show] status
Where [optional]
<input>
Example
Usecase 1: Download with just URL
The user sends the following message in the private channel:
https://www.webnovel.com/book/my-vampire-system_16709365405930105
This falls under the download rule, hence the bot will fill in the other options with defaults (ex: from=0
to=end, target=['epub']
) and create a new download session.
Usecase 2: Download with other information
The user sends the message:
https://www.webnovel.com/book/my-vampire-system_16709365405930105 from 25 to 100 into epub, text, html
The bot will then start a download session using the provided information.