Giter Site home page Giter Site logo

Comments (11)

StrangePers avatar StrangePers commented on August 15, 2024 1

Ok, I'll give it a try.

from telethon.

StrangePers avatar StrangePers commented on August 15, 2024 1

Yet, all tests passed without errors! One last test left with 40 simultanious message pins in 40 chats. I'll test in about half an hour and let you know. So far results are very optimistic ;)

from telethon.

Lonami avatar Lonami commented on August 15, 2024 1

I'm really glad it works better now. I would still expect bugs though ;) Hopefully rare enough.

from telethon.

Lonami avatar Lonami commented on August 15, 2024

Related to #27, I'm not sure how to fix this…

I've made sending Pong if there's ping in the message body.

What do you mean?

from telethon.

StrangePers avatar StrangePers commented on August 15, 2024

What do you mean?

In my sample script_client class There's init with connect and run method. With registering update_handler and then endless while loop. Update handler is static function, so inside it I can't have access to self of my class, so I can't call send function there.

  • I made a queue of received messages that is populated inside update_handler.

  • In run method inside a while loop there's a check for messages in a queue. If it's len(queue) > 0 I get one element and check message text, so that I can make autoanswer. If text = 'ping' I send back 'pong'. That's all.

from telethon.

Lonami avatar Lonami commented on August 15, 2024

The update_handler inside the InteractiveTelegramClient is just an example, it doesn't have to be a @staticmethod if you don't want to. You can remove the @staticmethod part and add a first self parameter to suit your needs.

from telethon.

StrangePers avatar StrangePers commented on August 15, 2024

I moved sending "pong" to update_handler, right after receiving "ping". That helped for a while, but after 20 ping requests in a row it still failed with the same error.... But as you already mentioned it seems to be #27 related. :(

from telethon.

Lonami avatar Lonami commented on August 15, 2024

After solving #47 perhaps the introduced changes there also fixed this. Could you please try with the upstream version and provide me some feedback about it?

from telethon.

afshar-mohammad avatar afshar-mohammad commented on August 15, 2024

@Lonami is it possible to update in pip so that I can check it easily?

from telethon.

Lonami avatar Lonami commented on August 15, 2024

I would rather you tried the upstream version, please. I would like to test it before releasing a new version out there to the wild, you know?

You can replace the telethon folder with the upstream one (remember to generate the TLObjects), probably located at either of these locations:

  • /usr/local/lib/python3.5/dist-packages/ if used pip3.
  • ~/.local/lib/python3.5/site-packages/ if used pip3 with --user
  • /usr/lib/python3.5/ if used apt

from telethon.

StrangePers avatar StrangePers commented on August 15, 2024

Aaaaaaand that's it! Everything works great. So you can release it ))) I'll close the issue

from telethon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.