Code Monkey home page Code Monkey logo

Comments (5)

DLumi avatar DLumi commented on September 3, 2024 1

@DLumi Not sure about the button by index suggestion, what's the use case? How is the index important? :)

Well, just as I told you: you can search buttons by name and get their index to call them later. Cause if the button is called directly by index, then if you, say, put another button just before the one you test (and this happens) - then the whole test would be failed because of that.
Moreover, personally, I don't see why you need to search the button and get all its data back in the first place.

Other than that, this library is the bomb. It really helps with a lot of testing that I previously had to do manually. Thanks!

from tgintegration.

DLumi avatar DLumi commented on September 3, 2024

Found a workaround. Just use Pyrogram's Client() functions to send a message.
The code should be like this:

async with controller.collect(count=1) as response:
    await client.send_message(bot_id, text='Test text')

But it's kinda counterintuitive. Just saying.

from tgintegration.

DLumi avatar DLumi commented on September 3, 2024

On an unrelated note, it'd be cool to have a method that looks for the inline button and returns the button's index. Thus I won't have to change all the tests that refer to a specific button by index.
I'm sure I'd be able to do all of this by hand, but that would be a cool quality of life change.

from tgintegration.

JosXa avatar JosXa commented on September 3, 2024

@DLumi This makes me rethink whether the BotController should just have generated methods for everything a regular Client can do after all! 🤔

from tgintegration.

JosXa avatar JosXa commented on September 3, 2024

@DLumi Not sure about the button by index suggestion, what's the use case? How is the index important? :)

from tgintegration.

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.