Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
zobweyt committed Jun 27, 2024
1 parent 6452860 commit 27e4c21
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Giveaways/Services/GiveawayScheduler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,22 @@ public GiveawayScheduler(IBackgroundJobClient client)
/// </summary>
/// <param name="messageId">The ID of the message associated with the giveaway.</param>
/// <param name="expiresAt">The expiration date and time of the giveaway.</param>
public void Schedule(ulong messageId, DateTime expiresAt)
public void Schedule(ulong messageId, DateTime expiresAt)
=> _client.Schedule<GiveawayService>(service => service.ExpireAsync(messageId), expiresAt);

/// <summary>
/// Changes the state of a scheduled job associated with a giveaway.
/// </summary>
/// <param name="messageId">The ID of the message associated with the giveaway.</param>
/// <param name="state">The new state to set for the job.</param>
public void ChangeState(ulong messageId, IState state)
public void ChangeState(ulong messageId, IState state)
=> _client.ChangeState(GetScheduledJob(messageId).Key, state);

/// <summary>
/// Retrieves the scheduled job associated with a specific message ID.
/// </summary>
/// <param name="messageId">The ID of the message associated with the giveaway.</param>
/// <returns>A key-value pair representing the scheduled job.</returns>
public KeyValuePair<string, ScheduledJobDto?> GetScheduledJob(ulong messageId)
public KeyValuePair<string, ScheduledJobDto?> GetScheduledJob(ulong messageId)
=> _monitor.ScheduledJobs(0, int.MaxValue).FirstOrDefault(j => (ulong)j.Value.Job.Args[0] == messageId);
}

0 comments on commit 27e4c21

Please sign in to comment.