Want to contribute? Fork me on Codeberg.org!
tegakituesday.com/src/routes/testing.rs

29 lines
791 B

use std::ops::Deref;
use poise::serenity_prelude::Http;
use rocket::{http::CookieJar, State};
use crate::models::User;
#[get("/testing")]
pub async fn testing(cookies: &CookieJar<'_>, http: &State<Http>) -> String {
// Get logged in user's join date in 字ちゃん server
format!(
"{:?}",
http.get_guild(814700630958276649)
.await
.expect("Failed to get testing guild")
.member(
http.deref(),
User::get(cookies)
.await
.expect("Failed to get logged in user data")
.expect("No logged in user")
.id
)
.await
.expect("Failed to fetch user in server")
.joined_at
)
}