Skip to content

Commit

Permalink
Merge pull request #25 from DannyS712/patch-1
Browse files Browse the repository at this point in the history
Add `updateFromID` function
  • Loading branch information
gesinn-it-gea authored Aug 6, 2019
2 parents a750352 + 03bd0e2 commit 7e624fc
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,28 @@ class MWBot {
}, customRequestOptions);
}

/**
* Updates existing wiki pages. Does not create new ones.
*
* @param {number} pageid
* @param {string} content
* @param {string} [summary]
* @param {object} [customRequestOptions]
*
* @returns {bluebird}
*/
updateFromID(pageid, content, summary, customRequestOptions) {
return this.request({
action: 'edit',
pageid: pageid,
text: content,
summary: summary || this.options.defaultSummary,
nocreate: true,
bot: true,
token: this.editToken
}, customRequestOptions);
}

/**
* Deletes a new wiki page
*
Expand Down

0 comments on commit 7e624fc

Please sign in to comment.