Add dark mode support

This commit is contained in:
jude
2026-05-16 18:20:00 +01:00
parent 9c6c324b02
commit 050277ac8b
20 changed files with 431 additions and 125 deletions
+3 -10
View File
@@ -8,9 +8,7 @@ use crate::{consts::DEFAULT_AVATAR, Error};
pub struct ChannelData {
pub id: u32,
pub channel: u64,
pub name: Option<String>,
pub nudge: i16,
pub blacklisted: bool,
pub webhook_id: Option<u64>,
pub webhook_token: Option<String>,
pub paused: bool,
@@ -27,7 +25,7 @@ impl ChannelData {
if let Ok(c) = sqlx::query_as_unchecked!(
Self,
"
SELECT id, channel, name, nudge, blacklisted, webhook_id, webhook_token, paused,
SELECT id, channel, nudge, webhook_id, webhook_token, paused,
paused_until
FROM channels
WHERE channel = ?
@@ -45,9 +43,8 @@ impl ChannelData {
if let Some((a, b)) = props { (Some(a), Some(b)) } else { (None, None) };
sqlx::query!(
"INSERT IGNORE INTO channels (channel, name, guild_id) VALUES (?, ?, (SELECT id FROM guilds WHERE guild = ?))",
"INSERT IGNORE INTO channels (channel, guild_id) VALUES (?, (SELECT id FROM guilds WHERE guild = ?))",
channel_id,
channel_name,
guild_id
)
.execute(&pool.clone())
@@ -56,7 +53,7 @@ impl ChannelData {
Ok(sqlx::query_as_unchecked!(
Self,
"
SELECT id, channel, name, nudge, blacklisted, webhook_id, webhook_token, paused, paused_until
SELECT id, channel, nudge, webhook_id, webhook_token, paused, paused_until
FROM channels
WHERE channel = ?
",
@@ -72,18 +69,14 @@ impl ChannelData {
"
UPDATE channels
SET
name = ?,
nudge = ?,
blacklisted = ?,
webhook_id = ?,
webhook_token = ?,
paused = ?,
paused_until = ?
WHERE id = ?
",
self.name,
self.nudge,
self.blacklisted,
self.webhook_id,
self.webhook_token,
self.paused,