Add debug logs
This commit is contained in:
parent
dfa1ae75b2
commit
cb660d13f4
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -1023,7 +1023,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kon"
|
||||
version = "0.3.17"
|
||||
version = "0.3.18"
|
||||
dependencies = [
|
||||
"bb8",
|
||||
"bb8-postgres",
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "kon"
|
||||
version = "0.3.17"
|
||||
version = "0.3.18"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
|
@ -3,7 +3,7 @@ mod processor; // Process the feeds and send it off to Discord
|
||||
mod esxi;
|
||||
mod github;
|
||||
mod gportal;
|
||||
mod rust_msg;
|
||||
mod rust;
|
||||
|
||||
use crate::{
|
||||
Error,
|
||||
|
@ -1,4 +1,5 @@
|
||||
use super::{
|
||||
task_info,
|
||||
task_err,
|
||||
TASK_NAME,
|
||||
BINARY_PROPERTIES,
|
||||
@ -6,7 +7,7 @@ use super::{
|
||||
esxi::esxi_embed,
|
||||
github::github_embed,
|
||||
gportal::gportal_embed,
|
||||
rust_msg::rust_message
|
||||
rust::rust_message
|
||||
};
|
||||
|
||||
use regex::Regex;
|
||||
@ -57,26 +58,20 @@ pub async fn feed_processor(ctx: &Context) {
|
||||
}
|
||||
|
||||
if Regex::new(r"(?i)\bresolved\b").unwrap().is_match(&new_desc) {
|
||||
task_info(TASK_NAME, &format!("GPortal func, replying to message id: {}", msg_id));
|
||||
message.reply(&ctx.http, "This incident has been marked as resolved!").await.unwrap();
|
||||
redis.del(&rkey).await.unwrap();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// If the message is invalid ID, send a new message instead
|
||||
let message = channel.send_message(&ctx.http, CreateMessage::new()
|
||||
.content("*Uh-oh! G-Portal is having issues!*").add_embed(embed)
|
||||
).await.unwrap();
|
||||
redis.set(&rkey, &message.id.to_string()).await.unwrap();
|
||||
redis.expire(&rkey, 36000).await.unwrap();
|
||||
}
|
||||
},
|
||||
Ok(None) | Err(_) => {
|
||||
// If the message is not found, send a new message instead
|
||||
let message = channel.send_message(&ctx.http, CreateMessage::new()
|
||||
.content("*Uh-oh! G-Portal is having issues!*").add_embed(embed)
|
||||
).await.unwrap();
|
||||
redis.set(&rkey, &message.id.to_string()).await.unwrap();
|
||||
redis.expire(&rkey, 36000).await.unwrap();
|
||||
// If the message is invalid ID, send a new message instead
|
||||
let message = channel.send_message(&ctx.http, CreateMessage::new()
|
||||
.content("*Uh-oh! G-Portal is having issues!*").add_embed(embed)
|
||||
).await.unwrap();
|
||||
redis.set(&rkey, &message.id.to_string()).await.unwrap();
|
||||
redis.expire(&rkey, 36000).await.unwrap();
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -109,15 +104,11 @@ pub async fn feed_processor(ctx: &Context) {
|
||||
}
|
||||
|
||||
if Regex::new(r"(?i)\bresolved\b").unwrap().is_match(&new_desc) {
|
||||
task_info(TASK_NAME, &format!("GitHub func, replying to message id: {}", msg_id));
|
||||
message.reply(&ctx.http, "This incident has been marked as resolved!").await.unwrap();
|
||||
redis.del(&rkey).await.unwrap();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// If the message is invalid ID, send a new message instead
|
||||
let message = channel.send_message(&ctx.http, CreateMessage::new().add_embed(embed)).await.unwrap();
|
||||
redis.set(&rkey, &message.id.to_string()).await.unwrap();
|
||||
redis.expire(&rkey, 36000).await.unwrap();
|
||||
}
|
||||
},
|
||||
Ok(None) | Err(_) => {
|
||||
|
Loading…
Reference in New Issue
Block a user