create BotFunction context getter
This commit is contained in:
parent
845071c800
commit
bc46e0fda4
@ -122,6 +122,13 @@ impl BotFunction {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn context(&self) -> Option<*mut quickjs_rusty::JSContext> {
|
||||
match &self.func {
|
||||
FunctionMarker::Function(js_function) => Some(js_function.context()),
|
||||
FunctionMarker::StrTemplate(_) => None,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn call(&self) -> ScriptResult<JsValue> {
|
||||
self.call_args(Default::default())
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user