feat: lint ++ add find_by_status in concour
This commit is contained in:
parent
4082a1677d
commit
81c3114e0d
28
cog.toml
Normal file
28
cog.toml
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
pre_bump_hooks = [
|
||||||
|
"echo {{version}}",
|
||||||
|
"cargo audit && cargo bump {{version}} && git add Cargo.toml && git commit -m \"chore(version): set cargo version to {{version}}\"",
|
||||||
|
]
|
||||||
|
post_bump_hooks = ["git push", "git push origin {{version}}"]
|
||||||
|
|
||||||
|
[changelog]
|
||||||
|
path = "CHANGELOG.md"
|
||||||
|
template = "remote"
|
||||||
|
remote = "git.weebo.fr"
|
||||||
|
repository = "BotDiscord"
|
||||||
|
owner = "sandbox"
|
||||||
|
authors = [
|
||||||
|
{ username = "batleforc", signature = "Max" },
|
||||||
|
{ username = "max", signature = "Max" },
|
||||||
|
]
|
||||||
|
|
||||||
|
[bump_profiles]
|
||||||
|
|
||||||
|
[packages]
|
||||||
|
|
||||||
|
[git_hooks.commit-msg]
|
||||||
|
script = """#!/bin/sh
|
||||||
|
set -e
|
||||||
|
cargo fmt -v --all --check
|
||||||
|
cargo clippy
|
||||||
|
gitleaks protect --verbose --redact --staged
|
||||||
|
"""
|
@ -1,3 +1,3 @@
|
|||||||
pub mod list;
|
|
||||||
pub mod enable;
|
|
||||||
pub mod answer;
|
pub mod answer;
|
||||||
|
pub mod enable;
|
||||||
|
pub mod list;
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
use crate::botv2::init::{Context, Error};
|
use crate::botv2::init::{Context, Error};
|
||||||
|
|
||||||
/// Ping command
|
/// Ping command
|
||||||
#[poise::command(
|
#[poise::command(slash_command, prefix_command)]
|
||||||
slash_command,
|
|
||||||
prefix_command,
|
|
||||||
)]
|
|
||||||
pub async fn ping(ctx: Context<'_>) -> Result<(), Error> {
|
pub async fn ping(ctx: Context<'_>) -> Result<(), Error> {
|
||||||
ctx.say("Pong from framework!").await?;
|
ctx.say("Pong from framework!").await?;
|
||||||
Ok(())
|
Ok(())
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
pub mod change_auto_meme;
|
|
||||||
pub mod answer;
|
pub mod answer;
|
||||||
|
pub mod change_auto_meme;
|
||||||
|
@ -136,4 +136,19 @@ impl Concour {
|
|||||||
}
|
}
|
||||||
Ok(concours)
|
Ok(concours)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub async fn find_by_status(status: &ConcourStatus) -> Result<Vec<Concour>, surrealdb::Error> {
|
||||||
|
let sql = format!("SELECT * FROM {} WHERE status = '{}'", CONCOUR, status);
|
||||||
|
let mut results = match DB.query(&sql).await {
|
||||||
|
Ok(results) => results,
|
||||||
|
Err(e) => {
|
||||||
|
return Err(e);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
let mut concours = Vec::new();
|
||||||
|
while let Ok(Some(concour)) = results.take(0) {
|
||||||
|
concours.push(concour);
|
||||||
|
}
|
||||||
|
Ok(concours)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
|
@ -1,3 +1,3 @@
|
|||||||
|
pub mod init;
|
||||||
pub mod level;
|
pub mod level;
|
||||||
pub mod tracing_kind;
|
pub mod tracing_kind;
|
||||||
pub mod init;
|
|
@ -16,5 +16,5 @@ pub struct Tracing {
|
|||||||
pub kind: TracingKind,
|
pub kind: TracingKind,
|
||||||
pub name: String,
|
pub name: String,
|
||||||
pub level: VerboseLevel,
|
pub level: VerboseLevel,
|
||||||
pub additional: HashMap<String,String>
|
pub additional: HashMap<String, String>,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user