Skip to content

A Telegram Book Store Bot that is able to connect to any WordPress site (in this case our Book shop) using WooCommerce REST API and fetch all of its existing products in order to show it in the bot to our customers. Users will be able to see the price of products, add them to their cart, and get redirected to the payment page.

License

erfanghorbanee/Telegrambot-FinalProject

Repository files navigation

Telegrambot-FinalProject

Code style: black Imports: isort License: MIT

A Telegram Book Store Bot that is able to connect to any WordPress site (in this case our Book shop) using WooCommerce REST API and fetch all of its existing products in order to show it in the bot to our customers.
Users will be able to see the price of products, add them to their cart, and get redirected to the payment page.

This was actually the final project of my bachelor's course at the University of Guilan.

Requirements

  • Python 3.8 (or higher)
  • install this package with pip install pyTelegramBotApi in your cmd(you can check this link for documents)
  • install this package with pip install WooCommerce in your cmd(you can check this link for documents)
  • get a token for your bot from https://t.me/BotFather and write it in core.py

How to work with database

Generating API keys in the WordPress admin interface

To create or manage keys for a specific WordPress user, go to WooCommerce > Settings > Advanced > REST API.

image

Click the "Add Key" button. In the next screen, add a description and select the WordPress user you would like to generate the key for. Use of the REST API with the generated keys will conform to that user's WordPress roles and capabilities.

Choose the level of access for this REST API key, which can be Read access, Write access or Read/Write access. Then click the "Generate API Key" button and WooCommerce will generate REST API keys for the selected user.

image

Now that keys have been generated, you should see two new keys, a QRCode, and a Revoke API Key button. These two keys are your Consumer Key and Consumer Secret.

image

And the final step! just put these keys in database.py at woocommerce function and we're ready to go :D

About

A Telegram Book Store Bot that is able to connect to any WordPress site (in this case our Book shop) using WooCommerce REST API and fetch all of its existing products in order to show it in the bot to our customers. Users will be able to see the price of products, add them to their cart, and get redirected to the payment page.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages