|
@@ -51,11 +51,11 @@ function getSettings() {
|
|
|
json: true
|
|
|
}, function( error, response, body ) {
|
|
|
if ( error || !response || response.statusCode !== 200 || !body || body.message || body.error ) {
|
|
|
- console.log( '- Fehler beim Erhalten der Einstellungen' + ( error ? ': ' + error : ( body ? ( body.message ? ': ' + body.message : ( body.error ? ': ' + body.error : '.' ) ) : '.' ) ) );
|
|
|
+ console.log( '- Error while getting the settings' + ( error ? ': ' + error : ( body ? ( body.message ? ': ' + body.message : ( body.error ? ': ' + body.error : '.' ) ) : '.' ) ) );
|
|
|
ready.settings = false;
|
|
|
}
|
|
|
else {
|
|
|
- console.log( '- Einstellungen erfolgreich ausgelesen.' );
|
|
|
+ console.log( '- Settings successfully loaded.' );
|
|
|
settings = Object.assign({}, body);
|
|
|
}
|
|
|
setStatus();
|
|
@@ -79,11 +79,11 @@ function getAllSites() {
|
|
|
json: true
|
|
|
}, function( error, response, body ) {
|
|
|
if ( error || !response || response.statusCode !== 200 || !body || body.status !== 'okay' || !body.data || !body.data.wikis ) {
|
|
|
- console.log( '- Fehler beim Erhalten der Wikis' + ( error ? ': ' + error : ( body ? ( body.error ? ': ' + body.error.info : '.' ) : '.' ) ) );
|
|
|
+ console.log( '- Error while gettings all sites' + ( error ? ': ' + error : ( body ? ( body.error ? ': ' + body.error.info : '.' ) : '.' ) ) );
|
|
|
ready.allSites = false;
|
|
|
}
|
|
|
else {
|
|
|
- console.log( '- Wikis erfolgreich ausgelesen.' );
|
|
|
+ console.log( '- Sites successfully loaded.' );
|
|
|
allSites = Object.assign([], body.data.wikis.filter( site => /^[a-z\d-]{1,50}\.gamepedia\.com$/.test(site.wiki_domain) ));
|
|
|
allSites.filter( site => site.wiki_domain in multiManager ).forEach( function(site) {
|
|
|
site.wiki_managers = multiManager[site.wiki_domain].concat(site.wiki_managers).filter( (value, index, self) => self.indexOf(value) === index );
|
|
@@ -94,12 +94,12 @@ function getAllSites() {
|
|
|
}
|
|
|
|
|
|
client.on( 'ready', () => {
|
|
|
- console.log( '- Erfolgreich als ' + client.user.username + ' angemeldet!' );
|
|
|
+ console.log( '- Successfully logged in as ' + client.user.username + '!' );
|
|
|
getSettings();
|
|
|
getAllSites();
|
|
|
|
|
|
if ( !isDebug ) client.setInterval( () => {
|
|
|
- console.log( '- Anzahl der Server: ' + client.guilds.size );
|
|
|
+ console.log( '- Current server count: ' + client.guilds.size );
|
|
|
dbl.postStats(client.guilds.size).catch( () => {} );
|
|
|
request.post( {
|
|
|
uri: 'https://discord.bots.gg/api/v1/bots/' + client.user.id + '/stats',
|
|
@@ -228,7 +228,7 @@ function find_wikis(lang, msg, key, value, text) {
|
|
|
function edit_settings(lang, msg, key, value) {
|
|
|
msg.reactEmoji('⏳', true).then( function( reaction ) {
|
|
|
if ( settings === defaultSettings ) {
|
|
|
- console.log( '- Fehler beim Erhalten bestehender Einstellungen.' );
|
|
|
+ console.log( '- Error while getting current settings.' );
|
|
|
msg.replyMsg( lang.settings.save_failed, {}, true );
|
|
|
if ( reaction ) reaction.removeEmoji();
|
|
|
}
|
|
@@ -257,7 +257,7 @@ function edit_settings(lang, msg, key, value) {
|
|
|
headers: access,
|
|
|
body: {
|
|
|
branch: 'master',
|
|
|
- commit_message: client.user.username + ': Einstellungen aktualisiert.',
|
|
|
+ commit_message: client.user.username + ': Settings updated.',
|
|
|
actions: [
|
|
|
{
|
|
|
action: 'update',
|
|
@@ -269,14 +269,14 @@ function edit_settings(lang, msg, key, value) {
|
|
|
json: true
|
|
|
}, function( error, response, body ) {
|
|
|
if ( error || !response || response.statusCode !== 201 || !body || body.error ) {
|
|
|
- console.log( '- Fehler beim Bearbeiten der Einstellungen' + ( error ? ': ' + error : ( body ? ( body.message ? ': ' + body.message : ( body.error ? ': ' + body.error : '.' ) ) : '.' ) ) );
|
|
|
+ console.log( '- Error while editing the settings' + ( error ? ': ' + error : ( body ? ( body.message ? ': ' + body.message : ( body.error ? ': ' + body.error : '.' ) ) : '.' ) ) );
|
|
|
msg.replyMsg( lang.settings.save_failed, {}, true );
|
|
|
}
|
|
|
else {
|
|
|
settings = Object.assign({}, temp_settings);
|
|
|
if ( key === 'lang' ) lang = i18n[value];
|
|
|
cmd_settings(lang, msg, [key], 'changed');
|
|
|
- console.log( '- Einstellungen erfolgreich aktualisiert.' );
|
|
|
+ console.log( '- Settings successfully updated.' );
|
|
|
}
|
|
|
|
|
|
if ( reaction ) reaction.removeEmoji();
|
|
@@ -373,7 +373,7 @@ function cmd_test(lang, msg, args, line) {
|
|
|
var text = lang.test.default;
|
|
|
var x = Math.floor(Math.random() * lang.test.random);
|
|
|
if ( x < lang.test.text.length ) text = lang.test.text[x];
|
|
|
- console.log( '- Test: Voll funktionsfähig!' );
|
|
|
+ console.log( '- Test: Fully functioning!' );
|
|
|
var now = Date.now();
|
|
|
if ( msg.showEmbed() ) msg.replyMsg( text ).then( edit => {
|
|
|
var then = Date.now();
|
|
@@ -388,11 +388,11 @@ function cmd_test(lang, msg, args, line) {
|
|
|
var ping = ( then - now ) + 'ms';
|
|
|
if ( error || !response || response.statusCode !== 200 || !body || body.batchcomplete === undefined ) {
|
|
|
if ( response && response.request && response.request.uri && response.request.uri.href === 'https://www.gamepedia.com/' ) {
|
|
|
- console.log( '- Dieses Wiki existiert nicht! ' + ( error ? error.message : ( body ? ( body.error ? body.error.info : '' ) : '' ) ) );
|
|
|
+ console.log( '- This wiki doesn\'t exist! ' + ( error ? error.message : ( body ? ( body.error ? body.error.info : '' ) : '' ) ) );
|
|
|
ping += ' <:unknown_wiki:505887262077353984>';
|
|
|
}
|
|
|
else {
|
|
|
- console.log( '- Fehler beim Erreichen des Wikis' + ( error ? ': ' + error : ( body ? ( body.error ? ': ' + body.error.info : '.' ) : '.' ) ) );
|
|
|
+ console.log( '- Error while reaching the wiki' + ( error ? ': ' + error : ( body ? ( body.error ? ': ' + body.error.info : '.' ) : '.' ) ) );
|
|
|
ping += ' <:error:505887261200613376>';
|
|
|
}
|
|
|
}
|
|
@@ -401,7 +401,7 @@ function cmd_test(lang, msg, args, line) {
|
|
|
} );
|
|
|
} );
|
|
|
} else {
|
|
|
- console.log( '- Test: Pausiert!' );
|
|
|
+ console.log( '- Test: Paused!' );
|
|
|
msg.replyMsg( lang.test.pause, {}, true );
|
|
|
}
|
|
|
}
|
|
@@ -429,9 +429,9 @@ async function cmd_stop(lang, msg, args, line) {
|
|
|
if ( args.join(' ').split('\n')[0].isMention(msg.guild) ) {
|
|
|
await msg.replyMsg( 'I\'ll destroy myself now!', {}, true );
|
|
|
await client.destroy();
|
|
|
- console.log( '- Ich schalte mich nun aus!' );
|
|
|
+ console.log( '- I\'m now shutting down!' );
|
|
|
setTimeout( async () => {
|
|
|
- console.log( '- Ich brauche zu lange zum Beenden, terminieren!' );
|
|
|
+ console.log( '- I need to long to close, terminating!' );
|
|
|
process.exit(1);
|
|
|
}, 1000 ).unref();
|
|
|
} else if ( msg.channel.type !== 'text' || !pause[msg.guild.id] ) {
|
|
@@ -443,11 +443,11 @@ function cmd_pause(lang, msg, args, line) {
|
|
|
if ( msg.channel.type === 'text' && args.join(' ').split('\n')[0].isMention(msg.guild) && ( msg.isAdmin() || msg.isOwner() ) ) {
|
|
|
if ( pause[msg.guild.id] ) {
|
|
|
delete pause[msg.guild.id];
|
|
|
- console.log( '- Pause beendet.' );
|
|
|
+ console.log( '- Pause ended.' );
|
|
|
msg.replyMsg( lang.pause.off, {}, true );
|
|
|
} else {
|
|
|
msg.replyMsg( lang.pause.on, {}, true );
|
|
|
- console.log( '- Pause aktiviert.' );
|
|
|
+ console.log( '- Pause started.' );
|
|
|
pause[msg.guild.id] = true;
|
|
|
}
|
|
|
} else if ( msg.channel.type !== 'text' || !pause[msg.guild.id] ) {
|
|
@@ -464,7 +464,7 @@ function cmd_delete(lang, msg, args, line) {
|
|
|
else {
|
|
|
msg.channel.bulkDelete(parseInt(args[0], 10) + 1, true).then( messages => {
|
|
|
msg.reply( lang.delete.success.replace( '%s', messages.size - 1 ) ).then( antwort => antwort.deleteMsg(5000), log_error );
|
|
|
- console.log( '- Die letzten ' + ( messages.size - 1 ) + ' Nachrichten in #' + msg.channel.name + ' wurden von @' + msg.member.displayName + ' gelöscht!' );
|
|
|
+ console.log( '- The last ' + ( messages.size - 1 ) + ' messages in #' + msg.channel.name + ' were deleted by @' + msg.member.displayName + '!' );
|
|
|
}, log_error );
|
|
|
}
|
|
|
}
|
|
@@ -532,11 +532,11 @@ function check_wiki(lang, msg, title, wiki, cmd, reaction, spoiler = '', queryst
|
|
|
if ( body && body.warnings ) log_warn(body.warnings);
|
|
|
if ( error || !response || response.statusCode !== 200 || !body || body.batchcomplete === undefined || !body.query ) {
|
|
|
if ( response && response.request && response.request.uri && response.request.uri.href === 'https://www.gamepedia.com/' ) {
|
|
|
- console.log( '- Dieses Wiki existiert nicht! ' + ( error ? error.message : ( body ? ( body.error ? body.error.info : '' ) : '' ) ) );
|
|
|
+ console.log( '- This wiki doesn\'t exist! ' + ( error ? error.message : ( body ? ( body.error ? body.error.info : '' ) : '' ) ) );
|
|
|
msg.reactEmoji('nowiki');
|
|
|
}
|
|
|
else {
|
|
|
- console.log( '- Fehler beim Erhalten der Suchergebnisse' + ( error ? ': ' + error : ( body ? ( body.error ? ': ' + body.error.info : '.' ) : '.' ) ) );
|
|
|
+ console.log( '- Error while getting the search results' + ( error ? ': ' + error : ( body ? ( body.error ? ': ' + body.error.info : '.' ) : '.' ) ) );
|
|
|
msg.sendChannelError( spoiler + '<https://' + wiki + '.gamepedia.com/' + ( linksuffix || !title ? title.toTitle() + linksuffix : 'Special:Search/' + title.toTitle() ) + '>' + spoiler );
|
|
|
}
|
|
|
|
|
@@ -566,7 +566,7 @@ function check_wiki(lang, msg, title, wiki, cmd, reaction, spoiler = '', queryst
|
|
|
json: true
|
|
|
}, function( uerror, uresponse, ubody ) {
|
|
|
if ( uerror || !uresponse || uresponse.statusCode !== 200 || !ubody || ubody.batchcomplete === undefined || !ubody.query ) {
|
|
|
- console.log( '- Fehler beim Erhalten der Benutzer' + ( uerror ? ': ' + uerror : ( ubody ? ( ubody.error ? ': ' + ubody.error.info : '.' ) : '.' ) ) );
|
|
|
+ console.log( '- Error while getting the user' + ( uerror ? ': ' + uerror : ( ubody ? ( ubody.error ? ': ' + ubody.error.info : '.' ) : '.' ) ) );
|
|
|
msg.sendChannelError( spoiler + '<https://' + wiki + '.gamepedia.com/' + ( contribs + username ).toTitle() + linksuffix + '>' + spoiler );
|
|
|
|
|
|
if ( reaction ) reaction.removeEmoji();
|
|
@@ -597,7 +597,7 @@ function check_wiki(lang, msg, title, wiki, cmd, reaction, spoiler = '', queryst
|
|
|
}, function( srerror, srresponse, srbody ) {
|
|
|
if ( srbody && srbody.warnings ) log_warn(srbody.warnings);
|
|
|
if ( srerror || !srresponse || srresponse.statusCode !== 200 || !srbody || srbody.batchcomplete === undefined ) {
|
|
|
- console.log( '- Fehler beim Erhalten der Suchergebnisse' + ( srerror ? ': ' + srerror : ( srbody ? ( srbody.error ? ': ' + srbody.error.info : '.' ) : '.' ) ) );
|
|
|
+ console.log( '- Error while getting the search results' + ( srerror ? ': ' + srerror : ( srbody ? ( srbody.error ? ': ' + srbody.error.info : '.' ) : '.' ) ) );
|
|
|
msg.sendChannelError( spoiler + '<https://' + wiki + '.gamepedia.com/Special:Search/' + title.toTitle() + '>' + spoiler );
|
|
|
}
|
|
|
else {
|
|
@@ -721,7 +721,7 @@ function check_wiki(lang, msg, title, wiki, cmd, reaction, spoiler = '', queryst
|
|
|
check_wiki(lang, msg, iwtitle, regex[1], ' !' + regex[1] + ' ', reaction, spoiler, querystring, fragment, selfcall);
|
|
|
} else {
|
|
|
if ( reaction ) reaction.removeEmoji();
|
|
|
- console.log( '- Abgebrochen, pausiert.' );
|
|
|
+ console.log( '- Aborted, paused.' );
|
|
|
}
|
|
|
} else {
|
|
|
if ( inter.url.includes( '#' ) ) {
|
|
@@ -745,7 +745,7 @@ function check_wiki(lang, msg, title, wiki, cmd, reaction, spoiler = '', queryst
|
|
|
}, function( mperror, mpresponse, mpbody ) {
|
|
|
if ( mpbody && mpbody.warnings ) log_warn(body.warnings);
|
|
|
if ( mperror || !mpresponse || mpresponse.statusCode !== 200 || !mpbody || mpbody.batchcomplete === undefined || !mpbody.query ) {
|
|
|
- console.log( '- Fehler beim Erhalten der Hauptseite' + ( error ? ': ' + error : ( body ? ( body.error ? ': ' + body.error.info : '.' ) : '.' ) ) );
|
|
|
+ console.log( '- Error while getting the main page' + ( error ? ': ' + error : ( body ? ( body.error ? ': ' + body.error.info : '.' ) : '.' ) ) );
|
|
|
} else {
|
|
|
querypage = Object.values(mpbody.query.pages)[0];
|
|
|
if ( querypage.pageprops && querypage.pageprops.description ) {
|
|
@@ -835,7 +835,7 @@ function cmd_user(lang, msg, namespace, username, wiki, linksuffix, querypage, c
|
|
|
if ( body && body.warnings ) log_warn(body.warnings);
|
|
|
if ( error || !response || response.statusCode !== 200 || !body || body.batchcomplete === undefined || !body.query || !body.query.blocks ) {
|
|
|
if ( response && response.request && response.request.uri && response.request.uri.href === 'https://www.gamepedia.com/' ) {
|
|
|
- console.log( '- Dieses Wiki existiert nicht! ' + ( error ? error.message : ( body ? ( body.error ? body.error.info : '' ) : '' ) ) );
|
|
|
+ console.log( '- This wiki doesn\'t exist! ' + ( error ? error.message : ( body ? ( body.error ? body.error.info : '' ) : '' ) ) );
|
|
|
msg.reactEmoji('nowiki');
|
|
|
}
|
|
|
else if ( body && body.error && ( body.error.code === 'param_ip' || body.error.code === 'cidrtoobroad' ) ) {
|
|
@@ -857,7 +857,7 @@ function cmd_user(lang, msg, namespace, username, wiki, linksuffix, querypage, c
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
- console.log( '- Fehler beim Erhalten der Suchergebnisse' + ( error ? ': ' + error : ( body ? ( body.error ? ': ' + body.error.info : '.' ) : '.' ) ) );
|
|
|
+ console.log( '- Error while getting the search results' + ( error ? ': ' + error : ( body ? ( body.error ? ': ' + body.error.info : '.' ) : '.' ) ) );
|
|
|
msg.sendChannelError( spoiler + '<https://' + wiki + '.gamepedia.com/' + ( querypage.noRedirect ? namespace : contribs ) + username.toTitle() + linksuffix + '>' + spoiler );
|
|
|
}
|
|
|
|
|
@@ -909,7 +909,7 @@ function cmd_user(lang, msg, namespace, username, wiki, linksuffix, querypage, c
|
|
|
msg.reactEmoji('error');
|
|
|
}
|
|
|
else {
|
|
|
- console.log( '- Fehler beim Erhalten der Suchergebnisse' + ( ucerror ? ': ' + ucerror : ( ucbody ? ( ucbody.error ? ': ' + ucbody.error.info : '.' ) : '.' ) ) );
|
|
|
+ console.log( '- Error while getting the search results' + ( ucerror ? ': ' + ucerror : ( ucbody ? ( ucbody.error ? ': ' + ucbody.error.info : '.' ) : '.' ) ) );
|
|
|
msg.sendChannelError( spoiler + '<https://' + wiki + '.gamepedia.com/' + namespace + username.toTitle() + linksuffix + '>' + spoiler );
|
|
|
}
|
|
|
}
|
|
@@ -943,11 +943,11 @@ function cmd_user(lang, msg, namespace, username, wiki, linksuffix, querypage, c
|
|
|
if ( body && body.warnings ) log_warn(body.warnings);
|
|
|
if ( error || !response || response.statusCode !== 200 || !body || body.batchcomplete === undefined || !body.query || !body.query.users[0] ) {
|
|
|
if ( response && response.request && response.request.uri && response.request.uri.href === 'https://www.gamepedia.com/' ) {
|
|
|
- console.log( '- Dieses Wiki existiert nicht! ' + ( error ? error.message : ( body ? ( body.error ? body.error.info : '' ) : '' ) ) );
|
|
|
+ console.log( '- This wiki doesn\'t exist! ' + ( error ? error.message : ( body ? ( body.error ? body.error.info : '' ) : '' ) ) );
|
|
|
msg.reactEmoji('nowiki');
|
|
|
}
|
|
|
else {
|
|
|
- console.log( '- Fehler beim Erhalten der Suchergebnisse' + ( error ? ': ' + error : ( body ? ( body.error ? ': ' + body.error.info : '.' ) : '.' ) ) );
|
|
|
+ console.log( '- Error while getting the search results' + ( error ? ': ' + error : ( body ? ( body.error ? ': ' + body.error.info : '.' ) : '.' ) ) );
|
|
|
msg.sendChannelError( spoiler + '<https://' + wiki + '.gamepedia.com/' + namespace + username.toTitle() + linksuffix + '>' + spoiler );
|
|
|
}
|
|
|
}
|
|
@@ -1094,14 +1094,14 @@ function cmd_diff(lang, msg, args, wiki, reaction, spoiler) {
|
|
|
}
|
|
|
}
|
|
|
if ( response && response.request && response.request.uri && response.request.uri.href === 'https://www.gamepedia.com/' ) {
|
|
|
- console.log( '- Dieses Wiki existiert nicht! ' + ( error ? error.message : ( body ? ( body.error ? body.error.info : '' ) : '' ) ) );
|
|
|
+ console.log( '- This wiki doesn\'t exist! ' + ( error ? error.message : ( body ? ( body.error ? body.error.info : '' ) : '' ) ) );
|
|
|
msg.reactEmoji('nowiki');
|
|
|
}
|
|
|
else if ( noerror ) {
|
|
|
msg.replyMsg( lang.diff.badrev );
|
|
|
}
|
|
|
else {
|
|
|
- console.log( '- Fehler beim Erhalten der Suchergebnisse' + ( error ? ': ' + error : ( body ? ( body.error ? ': ' + body.error.info : '.' ) : '.' ) ) );
|
|
|
+ console.log( '- Error while getting the search results' + ( error ? ': ' + error : ( body ? ( body.error ? ': ' + body.error.info : '.' ) : '.' ) ) );
|
|
|
msg.sendChannelError( spoiler + '<https://' + wiki + '.gamepedia.com/' + title.toTitle() + '?diff=' + relative + ( title ? '' : '&oldid=' + revision ) + '>' + spoiler );
|
|
|
}
|
|
|
|
|
@@ -1140,11 +1140,11 @@ function cmd_diffsend(lang, msg, args, wiki, reaction, spoiler) {
|
|
|
if ( body && body.warnings ) log_warn(body.warnings);
|
|
|
if ( error || !response || response.statusCode !== 200 || !body || body.batchcomplete === undefined || !body.query ) {
|
|
|
if ( response && response.request && response.request.uri && response.request.uri.href === 'https://www.gamepedia.com/' ) {
|
|
|
- console.log( '- Dieses Wiki existiert nicht! ' + ( error ? error.message : ( body ? ( body.error ? body.error.info : '' ) : '' ) ) );
|
|
|
+ console.log( '- This wiki doesn\'t exist! ' + ( error ? error.message : ( body ? ( body.error ? body.error.info : '' ) : '' ) ) );
|
|
|
msg.reactEmoji('nowiki');
|
|
|
}
|
|
|
else {
|
|
|
- console.log( '- Fehler beim Erhalten der Suchergebnisse' + ( error ? ': ' + error : ( body ? ( body.error ? ': ' + body.error.info : '.' ) : '.' ) ) );
|
|
|
+ console.log( '- Error while getting the search results' + ( error ? ': ' + error : ( body ? ( body.error ? ': ' + body.error.info : '.' ) : '.' ) ) );
|
|
|
msg.sendChannelError( spoiler + '<https://' + wiki + '.gamepedia.com/Special:Diff/' + ( args[1] ? args[1] + '/' : '' ) + args[0] + '>' + spoiler );
|
|
|
}
|
|
|
}
|
|
@@ -1204,11 +1204,11 @@ function cmd_random(lang, msg, wiki, reaction, spoiler) {
|
|
|
if ( body && body.warnings ) log_warn(body.warnings);
|
|
|
if ( error || !response || response.statusCode !== 200 || !body || body.batchcomplete === undefined || !body.query || !body.query.pages ) {
|
|
|
if ( response && response.request && response.request.uri && response.request.uri.href === 'https://www.gamepedia.com/' ) {
|
|
|
- console.log( '- Dieses Wiki existiert nicht! ' + ( error ? error.message : ( body ? ( body.error ? body.error.info : '' ) : '' ) ) );
|
|
|
+ console.log( '- This wiki doesn\'t exist! ' + ( error ? error.message : ( body ? ( body.error ? body.error.info : '' ) : '' ) ) );
|
|
|
msg.reactEmoji('nowiki');
|
|
|
}
|
|
|
else {
|
|
|
- console.log( '- Fehler beim Erhalten der Suchergebnisse' + ( error ? ': ' + error : ( body ? ( body.error ? ': ' + body.error.info : '.' ) : '.' ) ) );
|
|
|
+ console.log( '- Error while getting the search results' + ( error ? ': ' + error : ( body ? ( body.error ? ': ' + body.error.info : '.' ) : '.' ) ) );
|
|
|
msg.sendChannelError( spoiler + '<https://' + wiki + '.gamepedia.com/Special:Random>' + spoiler );
|
|
|
}
|
|
|
}
|
|
@@ -1246,11 +1246,11 @@ function cmd_overview(lang, msg, wiki, reaction, spoiler) {
|
|
|
if ( body && body.warnings ) log_warn(body.warnings);
|
|
|
if ( error || !response || response.statusCode !== 200 || !body || body.batchcomplete === undefined || !body.query || !body.query.pages ) {
|
|
|
if ( response && response.request && response.request.uri && response.request.uri.href === 'https://www.gamepedia.com/' ) {
|
|
|
- console.log( '- Dieses Wiki existiert nicht! ' + ( error ? error.message : ( body ? ( body.error ? body.error.info : '' ) : '' ) ) );
|
|
|
+ console.log( '- This wiki doesn\'t exist! ' + ( error ? error.message : ( body ? ( body.error ? body.error.info : '' ) : '' ) ) );
|
|
|
msg.reactEmoji('nowiki');
|
|
|
}
|
|
|
else {
|
|
|
- console.log( '- Fehler beim Erhalten der Suchergebnisse' + ( error ? ': ' + error : ( body ? ( body.error ? ': ' + body.error.info : '.' ) : '.' ) ) );
|
|
|
+ console.log( '- Error while getting the search results' + ( error ? ': ' + error : ( body ? ( body.error ? ': ' + body.error.info : '.' ) : '.' ) ) );
|
|
|
msg.sendChannelError( spoiler + '<https://' + wiki + '.gamepedia.com/Special:Statistics>' + spoiler );
|
|
|
}
|
|
|
}
|
|
@@ -1281,7 +1281,7 @@ function cmd_overview(lang, msg, wiki, reaction, spoiler) {
|
|
|
msg.sendChannel( spoiler + text + spoiler, embed );
|
|
|
}
|
|
|
else {
|
|
|
- console.log( '- Dieses Wiki ist nicht gelistet: ' + wiki + '.gamepedia.com' )
|
|
|
+ console.log( '- This site isn\'t listed: ' + wiki + '.gamepedia.com' )
|
|
|
msg.replyMsg( lang.overview.missing );
|
|
|
}
|
|
|
|
|
@@ -1309,12 +1309,12 @@ function cmd_bug(lang, mclang, msg, args, title, cmd, querystring, fragment, rea
|
|
|
msg.sendChannel( spoiler + mclang.bug.private + '\n' + link + project + invoke + spoiler );
|
|
|
}
|
|
|
else {
|
|
|
- console.log( '- Fehler beim Erhalten des Fehlers: ' + body.errorMessages.join(' - ') );
|
|
|
+ console.log( '- Error while getting the issue: ' + body.errorMessages.join(' - ') );
|
|
|
msg.reactEmoji('error');
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
- console.log( '- Fehler beim Erhalten der Fehlers' + ( error ? ': ' + error : ( body ? ': ' + body.message : '.' ) ) );
|
|
|
+ console.log( '- Error while getting the issue' + ( error ? ': ' + error : ( body ? ': ' + body.message : '.' ) ) );
|
|
|
if ( body && body['status-code'] === 404 ) msg.reactEmoji('error');
|
|
|
else msg.sendChannelError( spoiler + link + project + invoke + spoiler );
|
|
|
}
|
|
@@ -1363,12 +1363,12 @@ function cmd_bug(lang, mclang, msg, args, title, cmd, querystring, fragment, rea
|
|
|
msg.reactEmoji('🤷');
|
|
|
}
|
|
|
else {
|
|
|
- console.log( '- Fehler beim Erhalten des Fehlers: ' + body.errorMessages.join(' - ') );
|
|
|
+ console.log( '- Error while getting the issue: ' + body.errorMessages.join(' - ') );
|
|
|
msg.reactEmoji('error');
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
- console.log( '- Fehler beim Erhalten der Fehlers' + ( error ? ': ' + error : ( body ? ': ' + body.message : '.' ) ) );
|
|
|
+ console.log( '- Error while getting the issue' + ( error ? ': ' + error : ( body ? ': ' + body.message : '.' ) ) );
|
|
|
if ( body && body['status-code'] === 404 ) msg.reactEmoji('error');
|
|
|
else msg.sendChannelError( spoiler + link + spoiler );
|
|
|
}
|
|
@@ -1607,7 +1607,7 @@ Discord.Message.prototype.reactEmoji = function(name, ignorePause = false) {
|
|
|
}
|
|
|
return this.react(emoji).catch(log_error);
|
|
|
} else {
|
|
|
- console.log( '- Abgebrochen, pausiert.' );
|
|
|
+ console.log( '- Aborted, paused.' );
|
|
|
return Promise.resolve();
|
|
|
}
|
|
|
};
|
|
@@ -1624,7 +1624,7 @@ Discord.Message.prototype.sendChannel = function(content, options, ignorePause =
|
|
|
} else return msg;
|
|
|
}, log_error);
|
|
|
} else {
|
|
|
- console.log( '- Abgebrochen, pausiert.' );
|
|
|
+ console.log( '- Aborted, paused.' );
|
|
|
return Promise.resolve();
|
|
|
}
|
|
|
};
|
|
@@ -1641,7 +1641,7 @@ Discord.Message.prototype.replyMsg = function(content, options, ignorePause = fa
|
|
|
} else return msg;
|
|
|
}, log_error);;
|
|
|
} else {
|
|
|
- console.log( '- Abgebrochen, pausiert.' );
|
|
|
+ console.log( '- Aborted, paused.' );
|
|
|
return Promise.resolve();
|
|
|
}
|
|
|
};
|
|
@@ -1681,12 +1681,12 @@ client.on( 'message', msg => {
|
|
|
if ( ownercmd || permissions.has('MANAGE_MESSAGES') ) {
|
|
|
var args = cont.split(' ').slice(2);
|
|
|
if ( cont.split(' ')[1].split('\n')[1] ) args.unshift( '', cont.split(' ')[1].split('\n')[1] );
|
|
|
- if ( !( ownercmd || aliasInvoke in pausecmdmap ) && pause[msg.guild.id] ) console.log( msg.guild.name + ': Pausiert' );
|
|
|
+ if ( !( ownercmd || aliasInvoke in pausecmdmap ) && pause[msg.guild.id] ) console.log( msg.guild.name + ': Paused' );
|
|
|
else console.log( ( msg.guild ? msg.guild.name : '@' + author.username ) + ': ' + cont.replace( /\n/g, '\n\u200b' ) );
|
|
|
if ( ownercmd ) ownercmdmap[aliasInvoke](lang, msg, args, cont);
|
|
|
else if ( !pause[msg.guild.id] || aliasInvoke in pausecmdmap ) multilinecmdmap[aliasInvoke](lang, msg, args, cont);
|
|
|
} else {
|
|
|
- console.log( msg.guild.name + ': Fehlende Berechtigungen - MANAGE_MESSAGES' );
|
|
|
+ console.log( msg.guild.name + ': Missing permissions - MANAGE_MESSAGES' );
|
|
|
msg.replyMsg( lang.missingperm + ' `MANAGE_MESSAGES`' );
|
|
|
}
|
|
|
} else {
|
|
@@ -1698,7 +1698,7 @@ client.on( 'message', msg => {
|
|
|
var args = line.split(' ').slice(2);
|
|
|
aliasInvoke = ( invoke in lang.aliase ) ? lang.aliase[invoke] : invoke;
|
|
|
ownercmd = msg.isOwner() && aliasInvoke in ownercmdmap;
|
|
|
- if ( channel.type === 'text' && pause[msg.guild.id] && !( ( msg.isAdmin() && aliasInvoke in pausecmdmap ) || ownercmd ) ) console.log( msg.guild.name + ': Pausiert' );
|
|
|
+ if ( channel.type === 'text' && pause[msg.guild.id] && !( ( msg.isAdmin() && aliasInvoke in pausecmdmap ) || ownercmd ) ) console.log( msg.guild.name + ': Paused' );
|
|
|
else console.log( ( msg.guild ? msg.guild.name : '@' + author.username ) + ': ' + line );
|
|
|
if ( ownercmd ) ownercmdmap[aliasInvoke](lang, msg, args, line);
|
|
|
else if ( channel.type !== 'text' || !pause[msg.guild.id] || ( msg.isAdmin() && aliasInvoke in pausecmdmap ) ) {
|
|
@@ -1708,7 +1708,7 @@ client.on( 'message', msg => {
|
|
|
}
|
|
|
} else if ( line.hasPrefix() && count === 10 ) {
|
|
|
count++;
|
|
|
- console.log( '- Nachricht enthält zu viele Befehle!' );
|
|
|
+ console.log( '- Message contains too many commands!' );
|
|
|
msg.reactEmoji('⚠');
|
|
|
msg.sendChannelError( lang.limit.replaceSave( '%s', author.toString() ) );
|
|
|
}
|
|
@@ -1716,7 +1716,7 @@ client.on( 'message', msg => {
|
|
|
}
|
|
|
} else if ( msg.isAdmin() || msg.isOwner() ) {
|
|
|
var missing = permissions.missing(['SEND_MESSAGES','ADD_REACTIONS','USE_EXTERNAL_EMOJIS','READ_MESSAGE_HISTORY']);
|
|
|
- console.log( msg.guild.name + ': Fehlende Berechtigungen - ' + missing.join(', ') );
|
|
|
+ console.log( msg.guild.name + ': Missing permissions - ' + missing.join(', ') );
|
|
|
if ( !missing.includes( 'SEND_MESSAGES' ) ) msg.replyMsg( lang.missingperm + ' `' + missing.join('`, `') + '`' );
|
|
|
}
|
|
|
} );
|
|
@@ -1734,14 +1734,14 @@ client.on( 'voiceStateUpdate', (oldm, newm) => {
|
|
|
if ( oldm.voiceChannel ) {
|
|
|
var oldrole = oldm.roles.find( role => role.name === lang.channel + ' – ' + oldm.voiceChannel.name );
|
|
|
if ( oldrole && oldrole.comparePositionTo(oldm.guild.me.highestRole) < 0 ) {
|
|
|
- console.log( oldm.guild.name + ': ' + oldm.displayName + ' hat den Sprachkanal "' + oldm.voiceChannel.name + '" verlassen.' );
|
|
|
+ console.log( oldm.guild.name + ': ' + oldm.displayName + ' left the voice channel "' + oldm.voiceChannel.name + '".' );
|
|
|
oldm.removeRole( oldrole, lang.left.replaceSave( '%1$s', oldm.displayName ).replaceSave( '%2$s', oldm.voiceChannel.name ) ).catch(log_error);
|
|
|
}
|
|
|
}
|
|
|
if ( newm.voiceChannel ) {
|
|
|
var newrole = newm.guild.roles.find( role => role.name === lang.channel + ' – ' + newm.voiceChannel.name );
|
|
|
if ( newrole && newrole.comparePositionTo(newm.guild.me.highestRole) < 0 ) {
|
|
|
- console.log( newm.guild.name + ': ' + newm.displayName + ' hat den Sprachkanal "' + newm.voiceChannel.name + '" betreten.' );
|
|
|
+ console.log( newm.guild.name + ': ' + newm.displayName + ' joined the voice channel "' + newm.voiceChannel.name + '".' );
|
|
|
newm.addRole( newrole, lang.join.replaceSave( '%1$s', newm.displayName ).replaceSave( '%2$s', newm.voiceChannel.name ) ).catch(log_error);
|
|
|
}
|
|
|
}
|
|
@@ -1750,18 +1750,18 @@ client.on( 'voiceStateUpdate', (oldm, newm) => {
|
|
|
|
|
|
|
|
|
client.on( 'guildCreate', guild => {
|
|
|
- console.log( '- Ich wurde zu einem Server hinzugefügt.' );
|
|
|
+ console.log( '- I\'ve been added to a server.' );
|
|
|
} );
|
|
|
|
|
|
client.on( 'guildDelete', guild => {
|
|
|
- console.log( '- Ich wurde von einem Server entfernt.' );
|
|
|
+ console.log( '- I\'ve been removed from a server.' );
|
|
|
if ( !guild.available ) {
|
|
|
- console.log( '- Dieser Server ist nicht erreichbar.' );
|
|
|
+ console.log( '- ' + guild.name + ': This server isn\'t responding.' );
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if ( settings === defaultSettings ) {
|
|
|
- console.log( '- Fehler beim Erhalten bestehender Einstellungen.' );
|
|
|
+ console.log( '- Error while getting current settings.' );
|
|
|
}
|
|
|
else {
|
|
|
var temp_settings = Object.assign({}, settings);
|
|
@@ -1773,7 +1773,7 @@ client.on( 'guildDelete', guild => {
|
|
|
headers: access,
|
|
|
body: {
|
|
|
branch: 'master',
|
|
|
- commit_message: 'Wiki-Bot: Einstellungen entfernt.',
|
|
|
+ commit_message: client.user.username + ': Settings removed',
|
|
|
actions: [
|
|
|
{
|
|
|
action: 'update',
|
|
@@ -1785,11 +1785,11 @@ client.on( 'guildDelete', guild => {
|
|
|
json: true
|
|
|
}, function( error, response, body ) {
|
|
|
if ( error || !response || response.statusCode !== 201 || !body || body.error ) {
|
|
|
- console.log( '- Fehler beim Entfernen der Einstellungen' + ( error ? ': ' + error : ( body ? ( body.message ? ': ' + body.message : ( body.error ? ': ' + body.error : '.' ) ) : '.' ) ) );
|
|
|
+ console.log( '- Error while removing the settings' + ( error ? ': ' + error : ( body ? ( body.message ? ': ' + body.message : ( body.error ? ': ' + body.error : '.' ) ) : '.' ) ) );
|
|
|
}
|
|
|
else {
|
|
|
settings = Object.assign({}, temp_settings);
|
|
|
- console.log( '- Einstellungen erfolgreich entfernt.' );
|
|
|
+ console.log( '- Settings successfully removed.' );
|
|
|
}
|
|
|
} );
|
|
|
}
|
|
@@ -1826,12 +1826,12 @@ function log_warn(warning, api = true) {
|
|
|
|
|
|
async function graceful(code = 1) {
|
|
|
stop = true;
|
|
|
- console.log( '- SIGTERM: Beenden wird vorbereitet...' );
|
|
|
+ console.log( '- SIGTERM: Preparing to close...' );
|
|
|
setTimeout( async () => {
|
|
|
- console.log( '- SIGTERM: Client wird zerstört...' );
|
|
|
+ console.log( '- SIGTERM: Destroying client...' );
|
|
|
await client.destroy();
|
|
|
setTimeout( async () => {
|
|
|
- console.log( '- SIGTERM: Beenden dauert zu lange, terminieren!' );
|
|
|
+ console.log( '- SIGTERM: Closing takes too long, terminating!' );
|
|
|
process.exit(code);
|
|
|
}, 1000 ).unref();
|
|
|
}, 5000 ).unref();
|