V
V
vovkaooo12019-09-01 10:24:59
C++ / C#
vovkaooo1, 2019-09-01 10:24:59

Why does Telegram stop sending messages after n times?

Hello. There is a program that collects data. And to control my PC, I made sending data by telegram when I'm not at home. (Data == messages). Messages are sent every minute, approximately. But at some point they stop coming. The day before yesterday it was after 175 messages, and yesterday after 350. That is, this is not a specific number. For sending, I use proxies that belong only to me. Proxy binding goes by ip. The IP is dynamic, but has never changed.
Here is my code. Made in a separate thread. Where am I making a mistake?

WebRequest request = WebRequest.Create(@"https://api.telegram.org/bot73...");
            request.Proxy = new System.Net.WebProxy { Address = new Uri("http://138.219.222.222:7878") };
            request.GetResponse();
            Thread.Sleep(3000);
            request.Abort();

Thread THTellegramMes = new Thread(new ThreadStart(Tellegram.Message));
                    THTellegramMes.Start();
                    Thread.Sleep(5000);
                   THTellegramMes.Abort();

The logic in my head is such that the main thread, where the thread is initialized to send a message, slows down for 5 seconds, after which the cart thread dies. Where my logic does not converge with real logic. Thank you in advance for your help.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question