Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
512 views
in Plugins by
Is there any plugin for automatic broadcasting on Telegram channels? I did it by adding it to the core myself, but it cannot be said to be very healthy.
Q2A version: 1.8.6
by
Can you share your code change?
by
Of course, add answer
by
sorry, i dont understand.. what content this bot will share on telegram?
by
example new question, or new answer

1 Answer

+2 votes
by

My code in qa-notify-event.php

$botToken = "!!BOT-TOKEN!!!";
$chat_id = "@ruyadaruya";
$message = qa_q_path($params['postid'], $params['title'], true);
$bot_url    = "https://api.telegram.org/bot$botToken/";
$url = $bot_url."sendMessage?chat_id=".$chat_id."&text=".urlencode($message);
file_get_contents($url);
...