no DISCORD

This commit is contained in:
2025-11-07 21:54:29 +08:00
parent b503c0adfb
commit f80565f868
9 changed files with 18 additions and 867 deletions

View File

@@ -1,6 +1,5 @@
use super::{models::*, AppState};
use crate::auth::Claims;
use crate::discord_bot::{send_domain_approval_request, DomainRegistration};
use base64::{engine::general_purpose, Engine as _};
use gurtlib::prelude::*;
use rand::{rngs::OsRng, Rng};
@@ -128,26 +127,7 @@ pub(crate) async fn create_logic(domain: Domain, user_id: i32, app: &AppState) -
return Err(GurtError::invalid_message("No registrations remaining"));
}
if !app.config.discord.bot_token.is_empty() && app.config.discord.channel_id != 0 {
let domain_registration = DomainRegistration {
id: domain_id,
domain_name: domain.name.clone(),
tld: domain.tld.clone(),
user_id,
username: username.clone(),
};
let channel_id = app.config.discord.channel_id;
let bot_token = app.config.discord.bot_token.clone();
tokio::spawn(async move {
if let Err(e) =
send_domain_approval_request(channel_id, domain_registration, &bot_token).await
{
log::error!("Failed to send Discord notification: {}", e);
}
});
}
// Discord notification functionality has been removed
Ok(domain)
}