aboutsummaryrefslogtreecommitdiff
path: root/src/commands/meme/history.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/meme/history.rs')
-rw-r--r--src/commands/meme/history.rs14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/commands/meme/history.rs b/src/commands/meme/history.rs
index e2953d1..e5b3d33 100644
--- a/src/commands/meme/history.rs
+++ b/src/commands/meme/history.rs
@@ -60,7 +60,7 @@ static CLEAN_DATE_FORMAT: &str = "%b %-e %Y";
pub async fn wat(ctx: &Context, msg: &Message, _: Args) -> CommandResult {
let mut conn = connection()?;
- let record = match InvocationRecord::last(&mut conn) {
+ let record = match InvocationRecord::last(&mut conn).await {
Ok(x) => x,
Err(e) => {
if let Some(NotFound) = e.downcast_ref::<DieselError>() {
@@ -75,11 +75,11 @@ pub async fn wat(ctx: &Context, msg: &Message, _: Args) -> CommandResult {
},
};
- let meme = Meme::find(&mut conn, record.meme_id);
+ let meme = Meme::find(&mut conn, record.meme_id).await;
match meme {
Ok(ref meme) => {
- let metadata = Metadata::find(&mut conn, meme.metadata_id)?;
+ let metadata = Metadata::find(&mut conn, meme.metadata_id).await?;
let author = CONFIG.discord.guild().member(&ctx, metadata.created_by as u64).await?;
util::send(
@@ -125,7 +125,7 @@ pub async fn history(ctx: &Context, msg: &Message, mut args: Args) -> CommandRes
let records = {
let mut conn = connection()?;
- InvocationRecord::last_n(&mut conn, n)?
+ InvocationRecord::last_n(&mut conn, n).await?
};
if records.is_empty() {
@@ -150,7 +150,9 @@ pub async fn history(ctx: &Context, msg: &Message, mut args: Args) -> CommandRes
""
};
- let meme = Meme::find(&mut conn, rec.meme_id).and_then(|meme| {
+ let meme = Meme::find(&mut conn, rec.meme_id).await;
+
+ .and_then(|meme| {
Metadata::find(&mut conn, meme.metadata_id).map(|metadata| (metadata, meme))
});
@@ -214,7 +216,7 @@ pub async fn stats(ctx: &Context, msg: &Message, _: Args) -> CommandResult {
};
let mut conn = connection()?;
- let stats = db::stats(&mut conn)?;
+ let stats = db::stats(&mut conn).await?;
debug!("reporting stats");