kanasimi / wikiapi

JavaScript MediaWiki API for node.js
https://kanasimi.github.io/wikiapi/
BSD 3-Clause "New" or "Revised" License
49 stars 6 forks source link

Upload upon : no edit of the page ? #42

Closed hugolpz closed 3 years ago

hugolpz commented 3 years ago

This is possibly not a bug.

I just uploaded upon, and it does no pagecontent's changes.

// upload
let result = await targetWiki.upload({ 
  comment: `Upload Chinese radical ${zi} in red style, raster format.`,
  text: `{{SOlicense|${zi}|${locale}|${major}.${extension}||${rad[0].replace(/^0+/,'')}|date=${today}|author=[[User:Yug|]]|license=PD-font|fontname=Arphic PL UKai}}`
  +`\n{{MakeMeAHanzi}}\n{{AnimeCJK}}`
  +`\n{{Rcat|{{Radnum|${rad[0]}}}|${rad[0]}|0||x}}`,
  filepath : `../DragonsBot/SOP/${zi}-${locale}${major}.${extension}`,
  ignorewarnings: 1, // overwrite or create,
  author: '[[User:Yug]]',
  categories:[`ShufaBot test: upload`]
});

Parameter comment is not effective. Parameter text is not effective. Parameter author is not effective. Parameter categories is not effective.

So I plan an edit round thereafter.

kanasimi commented 3 years ago

You may try change text to additional_text.

hugolpz commented 3 years ago

It will append, right ?

kanasimi commented 3 years ago

Sorry, I misunderstood your meaning. Yes, this is not a bug. When you are update a file, only the file content will changed. The comment will only shown in the file page. The text, ... till categories will all ignored. I guess what you want is like https://commons.wikimedia.org/wiki/Special:Contributions/cewbot . I update the documents, please tell me if there are still something not clear.