A
A
Artem Kirsov2021-09-20 17:03:37
WordPress
Artem Kirsov, 2021-09-20 17:03:37

How to integrate WordPress website with Pyhton telegram bot?

I used on my site on WordPress to send messages to the telegram chat about new posts.
Sent like this:

https://api.telegram.org/bot<token>/sendMessage?chat_id=<id>&text=<text>&parse_mode=html

Now I decided to modernize it and rewrite it in Python.
I want to do polls with buttons and so on in the future.
But for now I want to at least restore the previous functionality, but in Python.
In which direction to dig? So that when a new post is created on the site, a notification will fly to the telegram group.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vindicar, 2021-09-20
@Artur3194

Well, a counter question: is it necessary? Wouldn't it be easier to leave the mailing list as a separate bot, and implement new functionality that is not related to the site separately?
Alternatively, you can connect the bot to the WP database, and periodically monitor for new entries, plus add your own tables for the needs of the bot.
Simply because greetings from PHP to Python are not easy to convey. In fact, there is only one option - the socket that the bot listens to and which PHP knocks on.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question