Add GAIJIN_ID secret to struct Data + init code

This commit is contained in:
Aadi Desai 2023-12-06 23:57:17 +00:00
parent 5a41806567
commit cdde26e940
Signed by: supleed2
SSH key fingerprint: SHA256:CkbNRs0yVzXEiUp2zd0PSxsfRUMFF9bLlKXtE1xEbKM

View file

@ -16,6 +16,7 @@ struct Data {
ea_key: String,
ea_url: String,
fresher: serenity::RoleId,
gaijin: serenity::RoleId,
gn_ch_id: serenity::ChannelId,
member: serenity::RoleId,
non_member: serenity::RoleId,
@ -51,6 +52,13 @@ struct ManualMember {
fresher: bool,
}
#[derive(Debug)]
struct Gaijin {
discord_id: i64,
name: String,
university: String,
}
#[shuttle_runtime::main]
async fn poise(
#[shuttle_secrets::Secrets] secret_store: shuttle_secrets::SecretStore,
@ -86,6 +94,11 @@ async fn poise(
.expect("FRESHER_ID not found")
.parse()
.expect("FRESHER_ID not valid u64");
let gaijin = secret_store
.get("GAIJIN_ID")
.expect("GAIJIN_ID not found")
.parse()
.expect("GAIJIN_ID not valid u64");
let gn_ch_id = secret_store
.get("GN_CHANNEL_ID")
.expect("GN_CHANNEL_ID not found")
@ -147,6 +160,7 @@ async fn poise(
ea_key,
ea_url,
fresher,
gaijin,
gn_ch_id,
member,
non_member,