mirror of
https://github.com/house-of-vanity/desubot.git
synced 2025-07-08 04:54:08 +00:00
Compare commits
13 Commits
Author | SHA1 | Date | |
---|---|---|---|
865fd3bbe4 | |||
30bdb23a32 | |||
f97562e9b7 | |||
2d000101c2 | |||
a26d227190 | |||
cc44f0e23b | |||
96df636195 | |||
a48e25800c | |||
36660d384d | |||
788c2cbbd4 | |||
9d5e5a3217 | |||
945da05794 | |||
3085d4c450 |
27
.github/workflows/automerge.yml
vendored
Normal file
27
.github/workflows/automerge.yml
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
name: automerge
|
||||
on:
|
||||
pull_request:
|
||||
types:
|
||||
- labeled
|
||||
- unlabeled
|
||||
- synchronize
|
||||
- opened
|
||||
- edited
|
||||
- ready_for_review
|
||||
- reopened
|
||||
- unlocked
|
||||
pull_request_review:
|
||||
types:
|
||||
- submitted
|
||||
check_suite:
|
||||
types:
|
||||
- completed
|
||||
status: {}
|
||||
jobs:
|
||||
automerge:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: automerge
|
||||
uses: "pascalgn/automerge-action@v0.13.0"
|
||||
env:
|
||||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "desubot"
|
||||
version = "0.5.1"
|
||||
version = "0.5.3"
|
||||
authors = ["AB <ab@hexor.ru>"]
|
||||
edition = "2018"
|
||||
|
||||
|
2
README
2
README
@ -7,8 +7,6 @@ Telegram bot with light group statistic and heavy spy features.
|
||||
* /here command to mention all members.
|
||||
* Alongside with saving whole message bot perform blacklist filter and stemming for every word (only Russian). "Красивую собаку мыли негры" -> "красивый собака мыть негр"
|
||||
* Generate sentences using Markov Chains trained on history with /markov_all.
|
||||
|
||||
== TODO ==
|
||||
* Syntax highlighting for CODE exported to image.
|
||||
|
||||
== Important ==
|
||||
|
@ -2,7 +2,7 @@
|
||||
static CODE_HELP: &str = "<b>Code highlighter</b>
|
||||
|
||||
<i>Usage</i>
|
||||
<pre>/CODE
|
||||
<pre>/code
|
||||
<CODE>
|
||||
#<lang - JS by default> #<theme - Dracula by default></pre>
|
||||
|
||||
|
@ -143,7 +143,7 @@ impl Execute for Sql {
|
||||
}
|
||||
res.push(tmp);
|
||||
}
|
||||
if res.len() > 100 {
|
||||
if res.len() >= 100 {
|
||||
return Err(Error::SQLResultTooLong(
|
||||
"SQL result too long. Lines limit is 100. Use LIMIT".to_string(),
|
||||
));
|
||||
|
12
src/db.rs
12
src/db.rs
@ -214,7 +214,7 @@ pub(crate) async fn add_conf(message: Message) -> Result<(), Error> {
|
||||
|
||||
match get_conf(message.chat.id()) {
|
||||
Ok(_) => {
|
||||
//info!("Group found: {:?}", message.chat.id());
|
||||
debug!("Group found: {:?}", message.chat.id());
|
||||
let update = Conf {
|
||||
id: message.chat.id(),
|
||||
title,
|
||||
@ -228,10 +228,10 @@ pub(crate) async fn add_conf(message: Message) -> Result<(), Error> {
|
||||
id = :id",
|
||||
)?;
|
||||
stmt.execute_named(&[(":id", &update.id.to_string()), (":title", &update.title)])?;
|
||||
//info!("Conf {:?} updated: {:?}", update.title, get_conf(update.id));
|
||||
debug!("Conf {:?} updated: {:?}", update.title, get_conf(update.id));
|
||||
}
|
||||
Err(_) => {
|
||||
//info!("Group didn't found: {:?}", message.chat.id());
|
||||
debug!("Group didn't found: {:?}", message.chat.id());
|
||||
|
||||
let update = Conf {
|
||||
id: message.chat.id(),
|
||||
@ -250,7 +250,7 @@ pub(crate) async fn add_conf(message: Message) -> Result<(), Error> {
|
||||
(":title", &update.title),
|
||||
(":date", &unix_time),
|
||||
])?;
|
||||
//info!("Conf {:?} added: {:?}", update.title, get_conf(update.id));
|
||||
debug!("Conf {:?} added: {:?}", update.title, get_conf(update.id));
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
@ -283,7 +283,7 @@ pub(crate) async fn add_user(message: Message) -> Result<(), Error> {
|
||||
(":first_name", &update.first_name),
|
||||
(":last_name", &update.last_name),
|
||||
])?;
|
||||
//println!("User {} updated: {:?}", update.first_name, get_user(user.id));
|
||||
debug!("User {} updated: {:?}", update.first_name, get_user(update.id));
|
||||
}
|
||||
Err(_) => {
|
||||
let unix_time = SystemTime::now()
|
||||
@ -310,7 +310,7 @@ pub(crate) async fn add_user(message: Message) -> Result<(), Error> {
|
||||
(":last_name", &user.last_name),
|
||||
(":date", &unix_time),
|
||||
])?;
|
||||
//println!("User added: {:?}", user);
|
||||
debug!("User added: {:?}", user);
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
|
@ -53,7 +53,7 @@ pub async fn handler(
|
||||
}
|
||||
}
|
||||
}
|
||||
s if s.contains("/here") => {
|
||||
s if s.contains("/here") || s.contains("@here") => {
|
||||
db::add_sentence(&message, mystem).await?;
|
||||
Here {
|
||||
data: "".to_string(),
|
||||
|
Reference in New Issue
Block a user