Unverified Commit fabad29e authored by tec's avatar tec
Browse files

Add a 'lil more logging

parent 54b61a30
Pipeline #209 failed with stages
in 2 seconds
...@@ -177,8 +177,13 @@ impl Commands { ...@@ -177,8 +177,13 @@ impl Commands {
} }
pub fn profile(ctx: Context, msg: Message, name: &str) { pub fn profile(ctx: Context, msg: Message, name: &str) {
let possible_member: Option<database::Member> = match if name.trim().is_empty() { let possible_member: Option<database::Member> = match if name.trim().is_empty() {
info!(
"{} (discord name) wants to look at their own profile",
&msg.author.name
);
database::get_member_info(&msg.author.id.0) database::get_member_info(&msg.author.id.0)
} else { } else {
info!("Searching for a profile for {}", &name);
database::get_member_info_from_username(&name) database::get_member_info_from_username(&name)
} { } {
Ok(member) => Some(member), Ok(member) => Some(member),
...@@ -187,6 +192,10 @@ impl Commands { ...@@ -187,6 +192,10 @@ impl Commands {
if name.len() != 3 { if name.len() != 3 {
None None
} else { } else {
info!(
"Searching for a profile for the TLA {}",
&name.to_uppercase()
);
match database::get_member_info_from_tla(&name.to_uppercase()) { match database::get_member_info_from_tla(&name.to_uppercase()) {
Ok(member) => Some(member), Ok(member) => Some(member),
Err(_) => None, Err(_) => None,
...@@ -203,6 +212,7 @@ impl Commands { ...@@ -203,6 +212,7 @@ impl Commands {
return return
} }
let member = possible_member.unwrap(); let member = possible_member.unwrap();
info!("Found matching profile. UCC username: {}", &member.username);
let result = msg.channel_id.send_message(&ctx.http, |m| { let result = msg.channel_id.send_message(&ctx.http, |m| {
m.embed(|embed| { m.embed(|embed| {
embed.colour(serenity::utils::Colour::LIGHTER_GREY); embed.colour(serenity::utils::Colour::LIGHTER_GREY);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment