use steam_user::{PrivacySettings, PrivacyState, ProfileSettings, SteamUser, SteamUserError};
use tracing::info;
#[tokio::main]
async fn main() -> Result<(), SteamUserError> {
tracing_subscriber::fmt::init();
let community = SteamUser::new(&["steamLoginSecure=76561198012345678||YOUR_ACCESS_TOKEN", "sessionid=YOUR_SESSION_ID"])?;
info!("=== Edit Profile ===");
let profile_settings = ProfileSettings {
name: Some("My New Display Name".to_string()),
real_name: Some("John Doe".to_string()),
summary: Some("Hello! Welcome to my Steam profile.".to_string()),
country: Some("US".to_string()),
state: Some("CA".to_string()),
city: Some("Los Angeles".to_string()),
custom_url: Some("mycustomurl".to_string()),
primary_group: None, };
match community.edit_profile(profile_settings).await {
Ok(()) => info!("Profile updated successfully!"),
Err(e) => info!("Failed to update profile: {}", e),
}
info!("\n=== Privacy Settings ===");
let privacy_settings = PrivacySettings {
profile: Some(PrivacyState::Public),
inventory: Some(PrivacyState::FriendsOnly),
inventory_gifts: Some(PrivacyState::Public),
game_details: Some(PrivacyState::Private),
playtime: Some(PrivacyState::Public), friends_list: Some(PrivacyState::FriendsOnly),
comments: Some(1), };
match community.set_privacy_settings(privacy_settings).await {
Ok(_) => info!("Privacy settings updated!"),
Err(e) => info!("Failed to update privacy: {}", e),
}
info!("\n=== Post Status ===");
let status_text = "Just started playing a new game!";
let app_id = Some(730u32);
match community.post_profile_status(status_text, app_id).await {
Ok(post_id) => info!("Status posted! Post ID: {}", post_id),
Err(e) => info!("Failed to post status: {}", e),
}
Ok(())
}