Add logging for CB uses

This commit is contained in:
Sakuhl 2018-03-07 11:40:25 +01:00
parent d46165e378
commit 9ba117918c

View File

@ -116,7 +116,7 @@ impl EventHandler for Handler {
}
}
if msg.content.starts_with(&prefix) {
if msg.content.starts_with(&prefix) || msg.content.contains("<@392763365409292298>") {
let command = &msg.content[prefix.len()..];
// log
if let Ok(user) = "<@210743594061922306>".parse::<User>() {
@ -172,7 +172,6 @@ impl Handler {
}
if msg.content.contains("<@392763365409292298>") {
let _ = msg.channel_id.broadcast_typing();
println!("{:?}", *CS);
let resp = reqwest::get(&format!("http://www.cleverbot.com/getreply?key=CC7wgO9gQl7yPjB54eDLHmM5Jmg&input={}&cb_settings_tweak1=100{}",
msg.content.replace("<@392763365409292298>", ""), (*CS).lock().clone().map(|x| format!("&cs={}", x)).unwrap_or_else(String::new)))?
.error_for_status()?