From 1f1fd247827469c986e7c7dd465c4e9160f175a4 Mon Sep 17 00:00:00 2001 From: Denny Dai Date: Tue, 30 Jun 2015 22:44:40 +0800 Subject: [PATCH] fix --- BOT.php | 4 ++-- config.php | 2 +- plugins/help.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/BOT.php b/BOT.php index 0298f16..28b4ca9 100644 --- a/BOT.php +++ b/BOT.php @@ -18,8 +18,8 @@ require_once(PATH.'classes'.DIRECTORY_SEPARATOR.TYPE.DIRECTORY_SEPARATOR.'init.p foreach ($load_plugins as $value) { $plugin_name = substr($value, strlen(PATH.'plugins'.DIRECTORY_SEPARATOR), -4); - if (preg_match("/^".preg_quote(TAG, '/').$plugin_name." (.*)$/", $text, $matches)) { - $plugin_text = $matches[1]; + 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; break; diff --git a/config.php b/config.php index 3d5de22..4cf15c0 100644 --- a/config.php +++ b/config.php @@ -3,7 +3,7 @@ define('TYPE', 'Telegram-Bot'); define('PATH', dirname(__FILE__).DIRECTORY_SEPARATOR); define('TAG', '#'); define('OWNER_NAME', 'Denny Dai'); -define('BOT_NAME', 'Dx. Dennx'); +define('BOT_NAME', 'D_bot'); define('HELP_BEGIN', "Welcome to use TG-BOT"); define('HELP_END', "GitHub: https://github.com/dennydai/D-bot\nAuthor: @DennyDai"); diff --git a/plugins/help.php b/plugins/help.php index bd516da..4b7002b 100644 --- a/plugins/help.php +++ b/plugins/help.php @@ -1,5 +1,5 @@