To create a REST API with Rust that allows you to send photos and videos to a Telegram bot, we can use the Actix Web framework for the API and the Teloxide library for interacting with the Telegram bot.

Steps:

  1. Set up Actix Web to create the REST API.
  2. Use Teloxide to interact with the Telegram API for sending media.
  3. Use multipart form data to handle file uploads in the REST API.

Dependencies:

You will need the following dependencies in Cargo.toml: