AlferZep

novel command

Apr 13th, 2024
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.14 KB | None | 0 0
  1. $nomention
  2. $onlyForIDs[$botOwnerID;]
  3. $jsonParse[
  4. {
  5. "novel":$getVar[novel;$authorID]
  6. }
  7. ]
  8.  
  9. $httpAddHeader[content-type;application/x-www-form-urlencoded]
  10.  
  11. $httpGet[https://pastebin.com/raw/qp8X4hzN]
  12.  
  13. $jsonParse[
  14. {
  15. "novel":$getVar[novel;$authorID],
  16. "link":$httpResult
  17. }
  18. ]
  19.  
  20. $if[$message!=]
  21. $onlyIf[$json[link;$message[1]]!=;There’s no novel of that ID.]
  22.  
  23. $httpGet[$json[link;$message[1];link]]
  24.  
  25. $jsonParse[
  26. {
  27. "novel":$getVar[novel;$authorID],
  28. "link":$json[link],
  29. "nlink":$httpResult
  30. }
  31. ]
  32.  
  33. $author[$username]
  34. $authorIcon[$authorAvatar]
  35. $title[$json[link;$message[1];title]]
  36. $addField[Author;$json[link;$message[1];author]]
  37. $addField[About;$json[link;$message[1];about]]
  38. $addField[Chapters;$if[$json[nlink;chapters]>0]Chapter $json[nlink;chapters] - $json[nlink;chapter;$json[nlink;chapters];title]$endif
  39. $if[$sub[$json[nlink;chapters];1]>0]Chapter $sub[$json[nlink;chapters];1] - $json[nlink;chapter;$sub[$json[nlink;chapters];1];title]$endif
  40. $if[$sub[$json[nlink;chapters];2]>0]Chapter $sub[$json[nlink;chapters];2] - $json[nlink;chapter;$sub[$json[nlink;chapters];2];title]$endif
  41. $if[$json[nlink;chapters]>=3]*…*$endif
  42. ]
  43. $thumbnail[$json[link;$message[1];thumbnail]]
  44. $addButton[no;novel read $authorID;Read;secondary]
  45. $if[$json[link;$message[1];site]!=none]
  46. $addButton[no;$json[link;$message[1];site];Site;link]
  47. $endif
  48.  
  49. $jsonSet[novel;title;$json[link;$message[1];title]]
  50. $jsonSet[novel;link;$json[link;$message[1];link]]
  51.  
  52. $setVar[novel;$json[novel];$authorID]
  53.  
  54. $else
  55. $title[Select a novel]
  56. $description[New Chapters every weekends.]
  57. $addField[Novels;$if[$json[link;1]!=]1 - $json[link;1;title]$endif
  58. $if[$json[link;2]!=]2 - $json[link;2;title]$endif
  59. $if[$json[link;3]!=]3 - $json[link;3;title]$endif
  60. $if[$json[link;4]!=]4 - $json[link;4;title]$endif
  61. $if[$json[link;5]!=]5 - $json[link;5;title]$endif
  62. $if[$json[link;6]!=]6 - $json[link;6;title]$endif
  63. $if[$json[link;7]!=]7 - $json[link;7;title]$endif
  64. $if[$json[link;8]!=]8 - $json[link;8;title]$endif
  65. $if[$json[link;9]!=]9 - $json[link;9;title]$endif
  66. $if[$json[link;10]!=]10 - $json[link;10;title]$endif]
  67. $footer[example: vnovel 1]
  68. $endif
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
Advertisement
Add Comment
Please, Sign In to add comment