simple/simple.rs
1// SPDX-License-Identifier: MIT OR Apache-2.0
2// SPDX-FileCopyrightText: 2024 John C. Murray
3
4//! Simple example showing basic Zello client connection
5
6use anyhow::Result;
7use zello_client::{
8 connect_to_zello, initialize_logging, load_credentials, utilities::load_dotenv_from_file,
9};
10
11#[tokio::main]
12async fn main() -> Result<()> {
13 load_dotenv_from_file("examples/.env.example")?;
14 initialize_logging()?;
15 let credentials = load_credentials()?;
16 let mut client = connect_to_zello(&credentials).await?;
17 client.send_text_message("Hello from Zello!").await?;
18 client.close().await?;
19 Ok(())
20}