浏览代码

Update main.js

Markus-Rost 6 年之前
父节点
当前提交
b52a0233eb
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      main.js

+ 4 - 1
main.js

@@ -781,7 +781,7 @@ function cmd_bug(lang, mclang, msg, args, title, cmd) {
 			}, function( error, response, body ) {
 				if ( error || !response || !body || body['status-code'] == 404 ) {
 					console.log( '- Fehler beim Erhalten der Zusammenfassung' + ( error ? ': ' + error.message : ( body ? ': ' + body.message : '.' ) ) );
-					if ( body && body['status-code'] == 404 ) msg.react('440871715938238494')
+					if ( body && body['status-code'] == 404 ) msg.react('440871715938238494');
 					else msg.channel.send( 'https://bugs.mojang.com/browse/' + project + args[0] ).then( message => message.react('440871715938238494') );
 				}
 				else {
@@ -793,6 +793,9 @@ function cmd_bug(lang, mclang, msg, args, title, cmd) {
 							msg.channel.send( mclang.bug.private + '\nhttps://bugs.mojang.com/browse/' + project + args[0] );
 						}
 					}
+					else if ( !body.fields ) {
+						msg.react('440871715938238494');
+					}
 					else {
 						msg.channel.send( body.fields.summary + '\nhttps://bugs.mojang.com/browse/' + body.key );
 					}