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