protected override async Task Handle(NewWhisperMessageDto request, CancellationToken cancellationToken)
        {
            var whisperMessage = request.WhisperMessage;

            var messageModel = new ChatMessageModelForDisplaying()
            {
                Channel    = "WHISPER MESSAGE",
                Message    = whisperMessage.Message,
                PostedTime = DateTime.UtcNow,
                UserName   = whisperMessage.Username,
            };

            await telegramBotClient.SendMessageAsync(new SendMessageRequest
            {
                ChatId      = rootUserChatId,
                MessageText = messageModel.ToDisplayFormat()
            }, cancellationToken : cancellationToken);
        }
Beispiel #2
0
        protected override async Task Handle(SendTelegramMessage request, CancellationToken cancellationToken)
        {
            var chatMessage = request.Message;

            if (chatMessage.User.UserId == Constants.MadTwitchId ||
                chatMessage.Message.Contains($"@{Constants.EnsthorTwitchName}", System.StringComparison.OrdinalIgnoreCase))
            {
                var messageModel = new ChatMessageModelForDisplaying()
                {
                    Channel    = chatMessage.Channel,
                    Message    = chatMessage.Message,
                    PostedTime = chatMessage.PostedTime,
                    UserName   = chatMessage.User.UserName,
                };

                await telegramBotClient.SendMessageAsync(new SendMessageRequest
                {
                    ChatId      = rootUserChatId,
                    MessageText = messageModel.ToDisplayFormat()
                }, cancellationToken : cancellationToken);
            }
        }