mirror of
https://github.com/house-of-vanity/desubot.git
synced 2025-07-08 13:04:06 +00:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
7432ce6398 | |||
0831e3f503 | |||
a0f4c40be0 | |||
1facef6897 |
10
Cargo.toml
10
Cargo.toml
@ -8,23 +8,23 @@ edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
bytes = "0.5"
|
||||
tokio = { version = "0.2", features = ["full"]}
|
||||
tokio = { version = "1.10.0", features = ["full"]}
|
||||
tracing = "0.1.9"
|
||||
tracing-futures = "0.2"
|
||||
multipart = { version = "0.16", default-features = false, features = ["client"] }
|
||||
telegram-bot = "0.8.0"
|
||||
silicon = "0.4.0"
|
||||
hyper = "0.13"
|
||||
hyper = "0.14"
|
||||
hyper-tls = { version = "0.4", optional = true }
|
||||
futures = "0.3"
|
||||
hyper-rustls = { version = "0.19", optional = true }
|
||||
rusqlite = { version = "0.24.2", features = ["bundled"]}
|
||||
html-escape = "0.2"
|
||||
regex = "1"
|
||||
reqwest = "0.10.9"
|
||||
reqwest = "0.11.4"
|
||||
uuid = { version = "0.8", features = ["v4"] }
|
||||
sha1 = "0.6.0"
|
||||
env_logger = "0.7"
|
||||
env_logger = "0.9.0"
|
||||
log = { version = "^0.4.5", features = ["std"] }
|
||||
subprocess = "0.2.6"
|
||||
serde_json = "1.0"
|
||||
@ -33,7 +33,7 @@ rand = "0.7.3"
|
||||
mystem = "^0.2"
|
||||
#mystem = { path = "../mystem-rs" }
|
||||
async-trait = "0.1.42"
|
||||
sqlparser = "0.7.0"
|
||||
sqlparser = "0.9.0"
|
||||
|
||||
[dependencies.syntect]
|
||||
version = "4.4"
|
||||
|
@ -432,6 +432,7 @@ pub(crate) async fn add_sentence(
|
||||
};
|
||||
|
||||
// Save stemmed words
|
||||
debug!("Going to stem: {}", text);
|
||||
let words = mystem.stemming(text)?;
|
||||
conn.execute("BEGIN TRANSACTION", params![]);
|
||||
for word in words {
|
||||
|
@ -53,7 +53,7 @@ pub async fn handler(
|
||||
}
|
||||
}
|
||||
}
|
||||
s if s.contains("/here") || s.contains("@here") => {
|
||||
s if s.contains("/here") || s.contains("@here") || s.contains("/хере") || s.contains("@хере") || s.contains("\"хере") => {
|
||||
db::add_sentence(&message, mystem).await?;
|
||||
Here {
|
||||
data: "".to_string(),
|
||||
|
@ -1,3 +1,4 @@
|
||||
#![allow(unreachable_code)]
|
||||
use std::{env, process};
|
||||
|
||||
use futures::StreamExt;
|
||||
@ -16,7 +17,7 @@ use mystem::MyStem;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), errors::Error> {
|
||||
env_logger::from_env(Env::default().default_filter_or("info")).init();
|
||||
env_logger::Builder::from_env(Env::default().default_filter_or("info")).init();
|
||||
let mut mystem = match MyStem::new() {
|
||||
Ok(mystem) => mystem,
|
||||
Err(e) => {
|
||||
@ -44,6 +45,7 @@ async fn main() -> Result<(), errors::Error> {
|
||||
me.first_name,
|
||||
me.id
|
||||
);
|
||||
loop {
|
||||
while let Some(update) = stream.next().await {
|
||||
let update = update?;
|
||||
if let UpdateKind::Message(message) = update.kind {
|
||||
@ -57,5 +59,6 @@ async fn main() -> Result<(), errors::Error> {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
Reference in New Issue
Block a user