TypeError: this.m[ffid] is not a function

This means that the object you think you’re calling a function on isn’t correct.

For example, when setting up a CTF bot you need to import the RGCTFUtils and then instantiate it when your bot starts up.

Correct


RGCTFUtils = require('rg-ctf-utils', '1.0.5').RGCTFUtils

def configure_bot(bot):
    bot.setDebug(False)
    bot.allowParkour(True)
    bot.allowDigWhilePathing(False)

    rg_ctf_utils = RGCTFUtils(bot)
    rg_ctf_utils.setDebug(False)

Incorrect

#This is missing .RGCTFUtils on the end
RGCTFUtils = require('rg-ctf-utils', '1.0.5')

def configure_bot(bot):
		bot.setDebug(False)
    bot.allowParkour(True)
    bot.allowDigWhilePathing(False)
    
    # this will throw the error as RGCTFUtils is not pointing to the constructor
    rg_ctf_utils = RGCTFUtils(bot)
    rg_ctf_utils.setDebug(False)

Error with “Proxy” objects

Sometimes you’ll get an error that says you are using a function on a Proxy object. This is often in reference to lists or objects that are not converted into real Python objects yet, and refer to some remote object on the JavaScript engine that is being referenced from the Python code.

To fix this, it often requires casting or converting the object into the Python type. For example, if you get this error on a list of entities, you can do list(entities) first, and then use that object

Where are the types?

Our Python library is not native to Python, and rather we simply make calls from Python to a JavaScript process running our JavaScript SDK. This means that the Python library has no knowledge of the types used in JavaScript, and treats every type as “any”.