We'll create fresh WordPress site with Telegram Bot Master installed. You have 20 minutes to test the plugin after that site we'll be deleted.
GitHub project: https://github.com/bots-master/wp-bots-master
The features list
– Telegram Bot integration
– Send a message to all Telegram Bot’s Subscribers
– Send a message to Telegram Group Chat
– Post a message in Telegram Channel
Requirements
PHP version 7.2 or later
To uninstall the plugin permanently, follow the next steps:
1. Drop the DB table wx_bot_users:
SQL Query: DROP TABLE IF EXISTS wx_bot_users;
Remove WP Options:
delete_option(‘telegram_api_token’);
delete_option(‘welcome_message’);
delete_option(‘unknown_message’);
Done! Now, there is no data of the plugin in DB
!!! IMPORTANT !!!
If a user was subscribed to a bot before the bot installing, it will not works.
The plugin does not able to grab your bot’s old subscribers from the Telegram side.
So, you are able to message users after the next steps
1. Set a Telegram Bot API Token in WP Admin
2. A user subscribe to the bot (send any message or click any button)
Now, you are able to message the subscriber.
Add Group Chat / Channel to The Chatbot
username
Bot Master > Channels
and add the username hereNow, your bot will posts a message to the Chat, you send at Bot Master > Send Message
use WebXID\BotsMaster\ChatBot;
use WebXID\BotsMaster\ChatBot\BotUser;
BotUser::find(['type_id' => ChatBot\BotUser::TYPE_CHAT]); // returns all Group Chats and Channels list
BotUser::find(['type_id' => ChatBot\BotUser::TYPE_USER]); // returns all subscribers
BotUser::all(); // returns all records
// -------------------------
$bot_user = BotUser::findOne(['type_id' => ChatBot\BotUser::TYPE_USER]);
if ($bot_user) {
ChatBot::factory($bot_user)
->sendMessage('<b>Hello</b> world!'); // will send the message, if the plugin installed correctly
}
Please, check the Doc https://core.telegram.org/bots/api#html-style to get allowed HTML tags