Exemple #1
0
        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);
        }
Exemple #2
0
 public Task ReplyAsync(TenantMessage tenantMessage, string text, CancellationToken cancellationToken)
 {
     return(SendAsync(tenantMessage.CreateReply(text), cancellationToken));
 }
Exemple #3
0
        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);
        }