2020-05-02 18:37:34 +00:00
|
|
|
use crate::{util::debug_say, DbConnPool};
|
2020-05-02 02:17:53 +00:00
|
|
|
use serenity::framework::standard::{macros::command, CommandResult};
|
|
|
|
use serenity::model::channel::Message;
|
|
|
|
use serenity::prelude::Context;
|
|
|
|
|
|
|
|
#[command]
|
2020-05-02 18:37:34 +00:00
|
|
|
async fn heck(ctx: &Context, msg: &Message) -> CommandResult {
|
2020-05-02 02:17:53 +00:00
|
|
|
let db_pool = ctx.data.clone();
|
2020-05-03 03:56:04 +00:00
|
|
|
let db_pool = db_pool.read().await;
|
2020-05-02 05:04:51 +00:00
|
|
|
let db_pool = db_pool
|
2020-05-03 03:56:04 +00:00
|
|
|
.get::<DbConnPool>()
|
2020-05-02 05:04:51 +00:00
|
|
|
.expect("No db pool in context?!");
|
2020-05-02 02:17:53 +00:00
|
|
|
let value = db_pool.get_heck().await;
|
2020-05-02 18:37:34 +00:00
|
|
|
|
|
|
|
debug_say(
|
|
|
|
msg,
|
|
|
|
ctx,
|
|
|
|
format!("This command has been hecked {} times", value?),
|
|
|
|
)
|
|
|
|
.await?;
|
2020-05-02 02:17:53 +00:00
|
|
|
|
|
|
|
Ok(())
|
|
|
|
}
|