forked from Skynet/discord-bot
feat: tidied up the command outouts
This commit is contained in:
parent
86f54aec6d
commit
0f4524ea63
3 changed files with 35 additions and 16 deletions
|
@ -72,6 +72,7 @@ pub struct LogoData {
|
|||
pub struct ServerIcons {
|
||||
pub id: i64,
|
||||
pub name: String,
|
||||
pub path: String,
|
||||
pub date: String,
|
||||
}
|
||||
|
||||
|
@ -120,12 +121,12 @@ pub mod update_icon {
|
|||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
struct FestivalData {
|
||||
current: Vec<String>,
|
||||
pub struct FestivalData {
|
||||
pub current: Vec<String>,
|
||||
exclusions: Vec<String>,
|
||||
}
|
||||
|
||||
fn get_festival(config_toml: &ConfigToml) -> FestivalData {
|
||||
pub fn get_festival(config_toml: &ConfigToml) -> FestivalData {
|
||||
let today = Utc::now();
|
||||
let day = today.day();
|
||||
let month = today.month();
|
||||
|
@ -276,15 +277,17 @@ pub mod update_icon {
|
|||
|
||||
async fn logo_set_db(db: &Pool<Sqlite>, logo_selected: &LogoData) {
|
||||
let name = logo_selected.name.to_str().unwrap_or_default();
|
||||
let path = logo_selected.path.to_str().unwrap_or_default();
|
||||
|
||||
match sqlx::query_as::<_, ServerIcons>(
|
||||
"
|
||||
INSERT OR REPLACE INTO server_icons (name, date)
|
||||
VALUES (?1, ?2)
|
||||
INSERT OR REPLACE INTO server_icons (name, date, path)
|
||||
VALUES (?1, ?2, ?3)
|
||||
",
|
||||
)
|
||||
.bind(name)
|
||||
.bind(get_now_iso(false))
|
||||
.bind(path)
|
||||
.fetch_optional(db)
|
||||
.await
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue