oliver-moran / mediawiki

A JavaScript framework for the MediaWiki API.
GNU General Public License v3.0
34 stars 19 forks source link

Login error #11

Open Technical-13 opened 3 years ago

Technical-13 commented 3 years ago
/home/runner/MyBot/node_modules/mediawiki/mediawiki.js:50
    Promise.prototype._onError = function (err) { throw err; };
                                                  ^

Error: 301
    at Request._callback (/home/runner/MyBot/node_modules/mediawiki/mediawiki.js:181:46)
    at Request.self.callback (/home/runner/MyBot /node_modules/mediawiki/node_modules/request/request.js:121:22)
    at Request.emit (events.js:314:20)
    at Request.EventEmitter.emit (domain.js:483:12)
    at Request.<anonymous> (/home/runner/MyBot/node_modules/mediawiki/node_modules/request/request.js:978:14)
    at Request.emit (events.js:326:22)
    at Request.EventEmitter.emit (domain.js:483:12)
    at IncomingMessage.<anonymous> (/home/runner/MyBot/node_modules/mediawiki/node_modules/request/request.js:929:12)
    at IncomingMessage.emit (events.js:326:22)
    at IncomingMessage.EventEmitter.emit (domain.js:483:12)
repl process died unexpectedly: exit status 1

Is my result trying to run:

const MediaWiki = require( 'mediawiki' );
var MyBot = new MediaWiki.Bot( {
    endpoint: "https://www.mywiki.com/api.php",
    rate: 5000,
    userAgent: "MyBot <https://mywiki.com/page/User:MyBot>"
} );

MyBot
  .login( process.env.WIKI_USERNAME, process.env.WIKI_PASSWORD )
  .complete( function ( username ) {
    console.log( 'Logged in to MyWiki as %s', username );
} );

I'm running: