Browse Source

fix rc error

Markus-Rost 3 years ago
parent
commit
31fdaef8fc
2 changed files with 6 additions and 5 deletions
  1. 1 1
      functions/special_page.js
  2. 5 4
      util/functions.js

+ 1 - 1
functions/special_page.js

@@ -202,7 +202,7 @@ function special_page(lang, msg, {title, uselang = lang.lang}, specialpage, quer
 		if ( msg.channel.isGuild() && patreons[msg.guildId] && querypages.hasOwnProperty(specialpage) ) {
 			var text = Util.splitMessage( querypages[specialpage][1](body.query, wiki, lang), {maxLength:1000} )[0];
 			embed.addField( lang.get('search.special'), ( text || lang.get('search.empty') ) );
-			if ( body.query.querypage.cached !== undefined ) {
+			if ( body.query.querypage?.cached !== undefined ) {
 				embed.setFooter( lang.get('search.cached') ).setTimestamp(new Date(body.query.querypage.cachedtimestamp));
 			}
 		}

+ 5 - 4
util/functions.js

@@ -435,10 +435,11 @@ function partialURIdecode(m) {
  * @param {String} author - The user id.
  */
 function allowDelete(msg, author) {
-	msg?.awaitReactions?.( {filter: (reaction, user) => ( reaction.emoji.name === '🗑️' && user.id === author ), max: 1, time: 300000} ).then( reaction => {
-		if ( reaction.size ) {
-			msg.delete().catch(log_error);
-		}
+	msg?.awaitReactions?.( {
+		filter: (reaction, user) => ( reaction.emoji.name === '🗑️' && user.id === author ),
+		max: 1, time: 300000
+	} ).then( reaction => {
+		if ( reaction.size ) msg.delete().catch(log_error);
 	} );
 };