Discord community: role sync, announcements webhook, launcher invite
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DjMbLQujBHunCCu5GpsHaT
This commit is contained in:
11 files changed
+513
-2
No files matched your search
@@ -211,6 +211,17 @@ pub async fn discord_connection(state: State<'_, AppState>) -> Res<serde_json::V
|
||||
response.json().await.map_err(err)
|
||||
}
|
||||
|
||||
/// The community invite link and whether this account is linked.
|
||||
#[tauri::command]
|
||||
pub async fn discord_info(state: State<'_, AppState>) -> Res<serde_json::Value> {
|
||||
let req = account_api(&state, reqwest::Method::GET, "/account/discord").await?;
|
||||
let response = req.send().await.map_err(err)?;
|
||||
if !response.status().is_success() {
|
||||
return Err(accounts::panel_error(response).await.to_string());
|
||||
}
|
||||
response.json().await.map_err(err)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn discord_link_start(state: State<'_, AppState>) -> Res<serde_json::Value> {
|
||||
let req = account_api(&state, reqwest::Method::GET, "/auth/discord/start?kind=link").await?;
|
||||
|
||||
@@ -57,6 +57,7 @@ pub fn run() {
|
||||
commands::discord_sign_in_poll,
|
||||
commands::request_password_reset,
|
||||
commands::discord_connection,
|
||||
commands::discord_info,
|
||||
commands::discord_link_start,
|
||||
commands::discord_unlink,
|
||||
commands::register_panel,
|
||||
|
||||
Reference in new issue
Block a user