|
@@ -479,7 +479,7 @@ function cmd_link(lang, msg, title, wiki = lang.link, cmd = ' ', querystring = '
|
|
else {
|
|
else {
|
|
msg.reactEmoji('⏳').then( function( reaction ) {
|
|
msg.reactEmoji('⏳').then( function( reaction ) {
|
|
request( {
|
|
request( {
|
|
- uri: 'https://' + wiki + '.gamepedia.com/api.php?action=query&format=json&meta=siteinfo&siprop=general&iwurl=true&redirects=true&titles=' + encodeURI( title ),
|
|
|
|
|
|
+ uri: 'https://' + wiki + '.gamepedia.com/api.php?action=query&format=json&meta=siteinfo&siprop=general&iwurl=true&redirects=true&titles=' + encodeURIComponent( title ),
|
|
json: true
|
|
json: true
|
|
}, function( error, response, body ) {
|
|
}, function( error, response, body ) {
|
|
if ( error || !response || !body || !body.query ) {
|
|
if ( error || !response || !body || !body.query ) {
|
|
@@ -496,7 +496,7 @@ function cmd_link(lang, msg, title, wiki = lang.link, cmd = ' ', querystring = '
|
|
if ( body.query.pages ) {
|
|
if ( body.query.pages ) {
|
|
if ( body.query.pages['-1'] && ( ( body.query.pages['-1'].missing != undefined && body.query.pages['-1'].known == undefined ) || body.query.pages['-1'].invalid != undefined ) ) {
|
|
if ( body.query.pages['-1'] && ( ( body.query.pages['-1'].missing != undefined && body.query.pages['-1'].known == undefined ) || body.query.pages['-1'].invalid != undefined ) ) {
|
|
request( {
|
|
request( {
|
|
- uri: 'https://' + wiki + '.gamepedia.com/api.php?action=query&format=json&list=search&srnamespace=0|4|12|14|10000|10002|10004|10006|10008|10010&srsearch=' + encodeURI( title ) + '&srlimit=1',
|
|
|
|
|
|
+ uri: 'https://' + wiki + '.gamepedia.com/api.php?action=query&format=json&list=search&srnamespace=0|4|12|14|10000|10002|10004|10006|10008|10010&srsearch=' + encodeURIComponent( title ) + '&srlimit=1',
|
|
json: true
|
|
json: true
|
|
}, function( srerror, srresponse, srbody ) {
|
|
}, function( srerror, srresponse, srbody ) {
|
|
if ( srerror || !srresponse || !srbody || !srbody.query || ( !srbody.query.search[0] && srbody.query.searchinfo.totalhits != 0 ) ) {
|
|
if ( srerror || !srresponse || !srbody || !srbody.query || ( !srbody.query.search[0] && srbody.query.searchinfo.totalhits != 0 ) ) {
|
|
@@ -606,7 +606,7 @@ function cmd_user(lang, msg, username, wiki, title, cmd, querystring, fragment)
|
|
} else {
|
|
} else {
|
|
msg.reactEmoji('⏳').then( function( reaction ) {
|
|
msg.reactEmoji('⏳').then( function( reaction ) {
|
|
request( {
|
|
request( {
|
|
- uri: 'https://' + wiki + '.gamepedia.com/api.php?action=query&format=json&list=users&usprop=blockinfo|groups|editcount|registration|gender&ususers=' + encodeURI( username ),
|
|
|
|
|
|
+ uri: 'https://' + wiki + '.gamepedia.com/api.php?action=query&format=json&list=users&usprop=blockinfo|groups|editcount|registration|gender&ususers=' + encodeURIComponent( username ),
|
|
json: true
|
|
json: true
|
|
}, function( error, response, body ) {
|
|
}, function( error, response, body ) {
|
|
if ( error || !response || !body || !body.query || !body.query.users[0] ) {
|
|
if ( error || !response || !body || !body.query || !body.query.users[0] ) {
|