insert events on deleting a reminder
This commit is contained in:
parent
11d12469fc
commit
d10bf7ede6
@ -15,7 +15,7 @@ You'll need rustc and cargo for compilation. To run, you'll need Python 3 still
|
|||||||
Reminder Bot can be built by running `cargo build --release` in the top level directory.
|
Reminder Bot can be built by running `cargo build --release` in the top level directory.
|
||||||
|
|
||||||
### Setting up Python
|
### Setting up Python
|
||||||
Reminder Bot by default looks for a venv within it's working directory to run Python out of. To set up a venv, install `python-venv` and run `python -m venv venv`. Then, run `source venv/bin/activate` to activate the venv, and do `pip install dateparser` to install the required library
|
Reminder Bot by default looks for a venv within it's working directory to run Python out of. To set up a venv, install `python3-venv` and run `python3 -m venv venv`. Then, run `source venv/bin/activate` to activate the venv, and do `pip install dateparser` to install the required library
|
||||||
|
|
||||||
### Environment Variables
|
### Environment Variables
|
||||||
Reminder Bot reads a number of environment variables. Some are essential, and others have hardcoded fallbacks. Environment variables can be loaded from a .env file in the working directory.
|
Reminder Bot reads a number of environment variables. Some are essential, and others have hardcoded fallbacks. Environment variables can be loaded from a .env file in the working directory.
|
||||||
|
@ -605,7 +605,18 @@ DELETE FROM reminders WHERE FIND_IN_SET(id, ?)
|
|||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
// TODO add deletion events to event list
|
if let Some(guild_id) = msg.guild_id {
|
||||||
|
let _ = sqlx::query!(
|
||||||
|
"
|
||||||
|
INSERT INTO events (event_name, bulk_count, guild_id, user_id) VALUES ('delete', ?, ?, ?)
|
||||||
|
",
|
||||||
|
count_row.count,
|
||||||
|
guild_id.as_u64(),
|
||||||
|
user_data.id
|
||||||
|
)
|
||||||
|
.execute(&pool)
|
||||||
|
.await;
|
||||||
|
}
|
||||||
|
|
||||||
let content = user_data.response(&pool, "del/count").await.replacen(
|
let content = user_data.response(&pool, "del/count").await.replacen(
|
||||||
"{}",
|
"{}",
|
||||||
|
@ -169,7 +169,7 @@ UPDATE channels SET name = ?, nudge = ?, blacklisted = ?, webhook_id = ?, webhoo
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub struct UserData {
|
pub struct UserData {
|
||||||
id: u32,
|
pub id: u32,
|
||||||
pub user: u64,
|
pub user: u64,
|
||||||
pub name: String,
|
pub name: String,
|
||||||
pub dm_channel: u32,
|
pub dm_channel: u32,
|
||||||
|
Loading…
Reference in New Issue
Block a user