rust-tg-bot-raw 1.0.0-rc.1

Pure Telegram Bot API types and methods for Rust -- a faithful port of python-telegram-bot's core layer
Documentation
use serde::{Deserialize, Serialize};

use crate::types::files::location::Location;

/// Represents a location to which a chat is connected.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct ChatLocation {
    /// The location to which the supergroup is connected. Cannot be a live location.
    pub location: Location,
    /// Location address as defined by the chat owner (1-64 characters).
    pub address: String,
}

impl ChatLocation {
    /// Creates a new `ChatLocation`.
    pub fn new(location: Location, address: impl Into<String>) -> Self {
        Self {
            location,
            address: address.into(),
        }
    }
}