You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// A simple event handler that says pong when you say ping.
/// </summary>
class PingDemo : IEventHandler<MessageEvent>
{
private readonly ISlackApiClient _slack;
public PingDemo(ISlackApiClient slack) => _slack = slack;
public async Task Handle(MessageEvent slackEvent)
{
if (slackEvent.Text?.Contains("ping", StringComparison.OrdinalIgnoreCase) == true)
{
Console.WriteLine($"Received ping from {(await _slack.Users.Info(slackEvent.User)).Name} in the {(await _slack.Conversations.Info(slackEvent.Channel)).Name} channel");