Skip to main content

lichess_api/api/
messaging.rs

1//! Sending private messages to other Lichess players.
2//!
3//! [`LichessApi::send_message`] posts a message to a user's inbox, on behalf
4//! of the authenticated account. It requires the `msg:write` OAuth scope.
5
6use crate::client::LichessApi;
7use crate::error::Result;
8use crate::model::messaging::*;
9
10impl LichessApi<reqwest::Client> {
11    pub async fn send_message(&self, request: impl Into<inbox::PostRequest>) -> Result<bool> {
12        self.get_ok(request.into()).await
13    }
14}