You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
644 B
20 lines
644 B
2 years ago
|
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)
|
||
|
}
|