Skip to content

Commit bdf5906

Browse files
committed
fix timestamp errors in checking valid updates and refactor embed creation
1 parent 74956e7 commit bdf5906

File tree

5 files changed

+147
-150
lines changed

5 files changed

+147
-150
lines changed

Cargo.lock

Lines changed: 9 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,11 @@ anyhow = "1.0.95"
88
async-trait = "0.1.83"
99
chrono = "0.4.38"
1010
chrono-tz = "0.10.0"
11-
poise = "0.6.1"
1211
reqwest = { version = "0.12.5", features = ["json"] }
1312
serde = { version = "1.0.203", features = ["derive"] }
1413
serde_json = "1.0.117"
15-
serenity = { git = "https://github.com/serenity-rs/serenity", branch = "current" }
1614
tokio = { version = "1.26.0", features = ["rt-multi-thread", "macros"] }
1715
tracing = "0.1.37"
1816
dotenv = "0.15.0"
19-
20-
[patch.crates-io]
21-
serenity = { git = "https://github.com/serenity-rs/serenity", branch = "current" }
17+
serenity = { version = "0.12.4", features = ["chrono"] }
18+
poise = "0.6.1"

config.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1334963922205147176
2-
1334963925585891419
3-
1334963927678849145
4-
1334963929922670682
1+
1336777074354028574
2+
1336746702178095144
3+
1336752144560160823
4+
1336036250590904332

src/tasks/mod.rs

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
1717
*/
1818
mod status_update;
1919

20-
use crate::{tasks::status_update::check_status_updates, utils::time::time_until};
21-
2220
use anyhow::Result;
2321
use async_trait::async_trait;
2422
use serenity::client::Context;
23+
use status_update::StatusUpdateCheck;
2524
use tokio::time::Duration;
2625

2726
/// A [`Task`] is any job that needs to be executed on a regular basis.
@@ -39,17 +38,3 @@ pub trait Task: Send + Sync {
3938
pub fn get_tasks() -> Vec<Box<dyn Task>> {
4039
vec![Box::new(StatusUpdateCheck)]
4140
}
42-
43-
/// Checks for status updates daily at 9 AM.
44-
pub struct StatusUpdateCheck;
45-
46-
#[async_trait]
47-
impl Task for StatusUpdateCheck {
48-
fn run_in(&self) -> Duration {
49-
time_until(5, 00)
50-
}
51-
52-
async fn run(&self, ctx: Context) -> anyhow::Result<()> {
53-
check_status_updates(ctx).await
54-
}
55-
}

0 commit comments

Comments
 (0)