Skip to content

Commit

Permalink
Temporary workaround until the SU lets me do training
Browse files Browse the repository at this point in the history
  • Loading branch information
jmshrv committed Jul 27, 2024
1 parent 0ddaf91 commit 93ebd2a
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ pub async fn verify(
) -> Result<(), Error> {
// We do these awkward scoped accesses to members because Rust doesn't like
// holding mutexes past async calls
let is_member = {
let members = ctx.data().members.lock().unwrap();
members
.iter()
.any(|student| student.student_id == student_id)
};
// let is_member = {
// let members = ctx.data().members.lock().unwrap();
// members
// .iter()
// .any(|student| student.student_id == student_id)
// };
let is_member = true;

if is_member {
println!("Found member {student_id} in cache");
Expand Down Expand Up @@ -81,7 +82,8 @@ pub async fn verify(
}

async fn add_role(ctx: Context<'_>) -> Result<(), Error> {
ctx.say("Verified! Welcome to HackSoc :)").await?;
ctx.say("The SU broke the bot so I'm assuming you're a HackSoc member (if you're not, please join anyway at https://hacksoc.net/join 🥺). Welcome to HackSoc :)")
.await?;

if let Some(mut author) = ctx.author_member().await {
author
Expand Down

0 comments on commit 93ebd2a

Please sign in to comment.