Skip to content

Commit

Permalink
Update comments in birthday job
Browse files Browse the repository at this point in the history
  • Loading branch information
monambike committed Jun 19, 2024
1 parent dc01cf1 commit 2886aa1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
12 changes: 8 additions & 4 deletions src/KWiJisho/Scheduling/BirthdayJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

namespace KWiJisho.Scheduling
{
[DisallowConcurrentExecution]
/// <summary>
/// Represents a Quartz.NET job that executes a birthday message task.
/// </summary>
[DisallowConcurrentExecution]
public class BirthdayJob : IJob
{
private DiscordClient? _client;
Expand All @@ -38,15 +38,19 @@ public async Task Execute(IJobExecutionContext context)
/// <returns>A <see cref="Task"/> representing the asynchronous execution of the birthday message task.</returns>
private async Task GiveBirthdayMessage()
{
// Retrieve the server details for Tramontina
var server = Servers.Tramontina;

// Getting guild by id.
// Check if the _client is null and return if it is
if (_client is null) return;

// Get the server guild asynchronously using the client and the server's GuildId
var serverGuild = await _client.GetGuildAsync(server.GuildId);

// Getting channel by id.
// Get the general channel in the server guild using the server's GeneralChannelId
var discordChannel = serverGuild.GetChannel(server.GeneralChannelId);

// Sending the birthday message.
// Send the birthday message to the retrieved discord channel and server guild
await CommandBirthday.SendBirthdayMessage(discordChannel, serverGuild, true);
}
}
Expand Down
8 changes: 7 additions & 1 deletion src/KWiJisho/Scheduling/Scheduler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,19 @@ namespace KWiJisho.Scheduling
/// </summary>
public class Scheduler
{
/// <summary>
/// Creates all schedulers using Quartz.NET library.
/// </summary>
/// <param name="discordClient">The discord client.</param>
/// <returns>A <see cref="Task"/> representing the asynchronous creation of the birthday scheduler.</returns>
public static async Task CreateAllSchedulers(DiscordClient discordClient)
{
// Creating birthday scheduler.
await CreateBirthdayScheduler(discordClient);
}

/// <summary>
/// Creates a birthday scheduler as part of the Quartz.NET library.
/// Creates a birthday scheduler using Quartz.NET library.
/// </summary>
/// <returns>A <see cref="Task"/> representing the asynchronous creation of the birthday scheduler.</returns>
public static async Task CreateBirthdayScheduler(DiscordClient discordClient)
Expand Down

0 comments on commit 2886aa1

Please sign in to comment.