Giter Club home page Giter Club logo

Comments (9)

IvanPragma avatar IvanPragma commented on June 16, 2024

You can do monkey patch for any of this functions.

def function_new(*args, **kwargs) -> None:
    # your code here
    return function_old(*args, **kwargs)

function_old = module.function
module.function = function_new

from ballistica.

TheMade4 avatar TheMade4 commented on June 16, 2024

You can do monkey patch for any of this functions.

def function_new(*args, **kwargs) -> None:
    # your code here
    return function_uld(*args, **kwargs)

function_old = module.function
module.function = new_function

this will not work for the "ba" module from the plugin

from ballistica.

TheMade4 avatar TheMade4 commented on June 16, 2024

And also this functionality is needed on the server

from ballistica.

TheMade4 avatar TheMade4 commented on June 16, 2024

monkey patch will not work for ba._hooks.filter_chat_message from plugin

from ballistica.

IvanPragma avatar IvanPragma commented on June 16, 2024

this will not work for the "ba" module from the plugin

For most functions/methods the monkey patch will work correctly.

from ballistica.

IvanPragma avatar IvanPragma commented on June 16, 2024

monkey patch will not work for ba._hooks.filter_chat_message from plugin

Yes, this is known issue. As far as I know, the C++ layer caches this function on startup. So, you can't monkey patch it from the plugin. To solve this problem you can create .py file at bastd module that will do monkey patch of this function, but don't forget to import this from bastd/__init__.py file.

from ballistica.

TheMade4 avatar TheMade4 commented on June 16, 2024

edit files in folder in ba_data is not an option

from ballistica.

Dliwk avatar Dliwk commented on June 16, 2024

Yes, known issue, if anyone would come up with some reload_hooks() PR, it would be great.

from ballistica.

TheMade4 avatar TheMade4 commented on June 16, 2024

Yes, known issue, if anyone would come up with some reload_hooks() PR, it would be great.

Yes, that's a good idea

from ballistica.

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.