From 5a6b8483a46a749ac6b0dae06ab0cf92cf728481 Mon Sep 17 00:00:00 2001 From: dennydai Date: Tue, 26 Jan 2016 12:36:53 +0800 Subject: [PATCH] minor bug fix --- VAR_BOT.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/VAR_BOT.php b/VAR_BOT.php index 4d8dd7d..7ede1a9 100644 --- a/VAR_BOT.php +++ b/VAR_BOT.php @@ -20,12 +20,20 @@ foreach ($TAGs as $TAG) { if (preg_match("/^(".preg_quote($TAG, '/').$plugin_name."|".preg_quote($TAG, '/').$plugin_name.preg_quote('@').BOT_NAME.") (.*)$/", $text, $matches)) { $plugin_text = $matches[2]; $plugin_sendto = $from; - require_once $value; + if (!empty($plugin_text)){ + require_once $value; + }else{ + $BOT->msg($plugin_sendto, "Missing argument(s)"); + } break; }elseif (preg_match("/^(".preg_quote($TAG, '/').$plugin_name.")|(".preg_quote($TAG, '/').$plugin_name.preg_quote('@').BOT_NAME.")$/", $text)) { $plugin_text = $matches[2]; $plugin_sendto = $from; - require_once $value; + if (!empty($plugin_text)){ + require_once $value; + }else{ + $BOT->msg($plugin_sendto, "Missing argument(s)"); + } break; } }