public async Task Ping([FromBody] TenantMessage tenantMessage, CancellationToken cancellationToken) { await _settingApi.SetAsync(SettingKey.With("last-ping-message"), tenantMessage.Text, cancellationToken).ConfigureAwait(false); var reply = tenantMessage.CreateReply( "pong", TenantMessageAttachmentProperty.With("text", tenantMessage.Text), TenantMessageAttachmentProperty.With("color", "#333333")); await _messageApi.SendAsync(reply, cancellationToken).ConfigureAwait(false); }
public Task ReplyAsync(TenantMessage tenantMessage, string text, CancellationToken cancellationToken) { return(SendAsync(tenantMessage.CreateReply(text), cancellationToken)); }
public async Task TellJoke([FromBody] TenantMessage tenantMessage, CancellationToken cancellationToken) { var joke = await Joke(cancellationToken).ConfigureAwait(false); await _messageApi.SendAsync(tenantMessage.CreateReply(joke), CancellationToken.None).ConfigureAwait(false); }