浏览代码

fix if error check

MarkusRost 3 年之前
父节点
当前提交
d8558afc06
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      cmds/rcscript.js

+ 1 - 1
cmds/rcscript.js

@@ -212,7 +212,7 @@ function cmd_rcscript(lang, msg, args, line, wiki) {
 					} );
 					} );
 				}, error => {
 				}, error => {
 					log_error(error);
 					log_error(error);
-					if ( error.name === 'DiscordAPIError' && ['Unknown Webhook', 'Invalid Webhook Token'].includes( error.message ) ) {
+					if ( error.name !== 'DiscordAPIError' || !['Unknown Webhook', 'Invalid Webhook Token'].includes( error.message ) ) {
 						button?.setURL(new URL(`/guild/${msg.guildId}/rcscript/${selected_row.configid}`, button.url).href);
 						button?.setURL(new URL(`/guild/${msg.guildId}/rcscript/${selected_row.configid}`, button.url).href);
 						return msg.replyMsg( {content: lang.get('settings.save_failed'), components}, true );
 						return msg.replyMsg( {content: lang.get('settings.save_failed'), components}, true );
 					}
 					}