Skip to content

Commit

Permalink
Merge pull request #258 from AoshiW/async-method
Browse files Browse the repository at this point in the history
SendMessageAsync
  • Loading branch information
Syzuna authored Dec 4, 2023
2 parents cdf0e4c + 9b3a0c3 commit 0928dbc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions TwitchLib.Client/Interfaces/ITwitchClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -394,15 +394,15 @@ public interface ITwitchClient
/// <param name="channel">The channel.</param>
/// <param name="message">The message.</param>
/// <param name="dryRun">if set to <c>true</c> [dry run].</param>
void SendMessage(JoinedChannel channel, string message, bool dryRun = false);
Task SendMessageAsync(JoinedChannel channel, string message, bool dryRun = false);

/// <summary>
/// Sends the message.
/// </summary>
/// <param name="channel">The channel.</param>
/// <param name="message">The message.</param>
/// <param name="dryRun">if set to <c>true</c> [dry run].</param>
void SendMessage(string channel, string message, bool dryRun = false);
Task SendMessageAsync(string channel, string message, bool dryRun = false);

/// <summary>
/// Sends a formatted Twitch chat message reply.
Expand Down
7 changes: 4 additions & 3 deletions TwitchLib.Client/TwitchClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -454,15 +454,16 @@ private void SendTwitchMessage(JoinedChannel? channel, string? message, string?
}

/// <inheritdoc />
public void SendMessage(JoinedChannel channel, string message, bool dryRun = false)
public Task SendMessageAsync(JoinedChannel channel, string message, bool dryRun = false)
{
SendTwitchMessage(channel, message,null, dryRun);
return Task.CompletedTask;
}

/// <inheritdoc />
public void SendMessage(string channel, string message, bool dryRun = false)
public Task SendMessageAsync(string channel, string message, bool dryRun = false)
{
SendMessage(GetJoinedChannel(channel), message, dryRun);
return SendMessageAsync(GetJoinedChannel(channel), message, dryRun);
}

/// <inheritdoc />
Expand Down

0 comments on commit 0928dbc

Please sign in to comment.