From 27e4c2187b50ce367c43539daac1e07f6aad6374 Mon Sep 17 00:00:00 2001 From: zobweyt Date: Thu, 27 Jun 2024 17:33:51 +0300 Subject: [PATCH] Fix formatting --- src/Giveaways/Services/GiveawayScheduler.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Giveaways/Services/GiveawayScheduler.cs b/src/Giveaways/Services/GiveawayScheduler.cs index e11658d..9482b1c 100644 --- a/src/Giveaways/Services/GiveawayScheduler.cs +++ b/src/Giveaways/Services/GiveawayScheduler.cs @@ -31,7 +31,7 @@ public GiveawayScheduler(IBackgroundJobClient client) /// /// The ID of the message associated with the giveaway. /// The expiration date and time of the giveaway. - public void Schedule(ulong messageId, DateTime expiresAt) + public void Schedule(ulong messageId, DateTime expiresAt) => _client.Schedule(service => service.ExpireAsync(messageId), expiresAt); /// @@ -39,7 +39,7 @@ public void Schedule(ulong messageId, DateTime expiresAt) /// /// The ID of the message associated with the giveaway. /// The new state to set for the job. - public void ChangeState(ulong messageId, IState state) + public void ChangeState(ulong messageId, IState state) => _client.ChangeState(GetScheduledJob(messageId).Key, state); /// @@ -47,6 +47,6 @@ public void ChangeState(ulong messageId, IState state) /// /// The ID of the message associated with the giveaway. /// A key-value pair representing the scheduled job. - public KeyValuePair GetScheduledJob(ulong messageId) + public KeyValuePair GetScheduledJob(ulong messageId) => _monitor.ScheduledJobs(0, int.MaxValue).FirstOrDefault(j => (ulong)j.Value.Job.Args[0] == messageId); }