mirror of
https://github.com/supleed2/nanobot.git
synced 2024-12-22 22:25:51 +00:00
Add membership flow code for Associate Union Members
This commit is contained in:
parent
d9d89f2a1b
commit
550080482c
|
@ -3,6 +3,8 @@
|
||||||
pub struct Member {
|
pub struct Member {
|
||||||
pub first_name: String,
|
pub first_name: String,
|
||||||
pub surname: String,
|
pub surname: String,
|
||||||
|
#[serde(rename = "CID")]
|
||||||
|
pub cid: String,
|
||||||
pub login: String,
|
pub login: String,
|
||||||
pub order_no: usize,
|
pub order_no: usize,
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,8 @@ const MEMBERSHIP_INTRO: &str = indoc::indoc! {"
|
||||||
To use automatic verification via Membership:
|
To use automatic verification via Membership:
|
||||||
- Enter your Union order number (from this academic year)
|
- Enter your Union order number (from this academic year)
|
||||||
- Enter your Imperial shortcode
|
- Enter your Imperial shortcode
|
||||||
|
- For Life members, your shortcode will be from when you were a student
|
||||||
|
- For Associate members, this is your CID, in the format `AM-12345` or similar
|
||||||
- Enter your preferred name for Nano whois commands
|
- Enter your preferred name for Nano whois commands
|
||||||
- Your shortcode will then be connected to your Discord Account by Nano
|
- Your shortcode will then be connected to your Discord Account by Nano
|
||||||
|
|
||||||
|
@ -117,10 +119,10 @@ pub(crate) async fn membership_3(
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
let Some(member) = members
|
let Some(member) = members.iter().find(|member| {
|
||||||
.iter()
|
((member.login.is_empty() && member.cid == shortcode) || member.login == shortcode)
|
||||||
.find(|&member| member.order_no.to_string() == order && member.login == shortcode)
|
&& member.order_no.to_string() == order
|
||||||
else {
|
}) else {
|
||||||
m.create_interaction_response(&ctx.http, |i| {
|
m.create_interaction_response(&ctx.http, |i| {
|
||||||
let msg = "Sorry, your order was not found, please check the \
|
let msg = "Sorry, your order was not found, please check the \
|
||||||
order number and that it is for your current year's membership";
|
order number and that it is for your current year's membership";
|
||||||
|
|
Loading…
Reference in a new issue