Пример #1
0
        private static async void BotOnMessageReceived(object sender, MessageEventArgs messageEventArgs)
        {
            IUser user = await userFactory.Create(messageEventArgs.Message.From.Id).ConfigureAwait(false);

            IInteractor interactor = await interactorFactory.Create(user, botClient).ConfigureAwait(false);

            IMessage message = messageFactory.Create(messageEventArgs);

            await interactor.Execute(message).ConfigureAwait(false);


            //var message = messageEventArgs.Message;
            //if (message?.Type == MessageType.Text) {

            //	await client.DeleteMessageAsync(message.Chat.Id, message.MessageId).ConfigureAwait(false);

            //	await client.SendTextMessageAsync(message.Chat.Id, message.Text);
            //}
        }