chore: 更新 py 回调

This commit is contained in:
uye
2024-06-11 03:10:22 +08:00
parent 825f3afe3f
commit d6a65ec5db
2 changed files with 7 additions and 2 deletions

View File

@@ -86,14 +86,15 @@ class Asst:
``callback``: 回调函数
``arg``: 自定义参数
"""
self.__callback = callback
if callback:
self.__ptr = Asst.__lib.AsstCreateEx(callback, arg)
else:
self.__ptr = Asst.__lib.AsstCreate()
def __del__(self):
Asst.__lib.AsstDestroy(self.__ptr)
if self.__callback:
Asst.__lib.AsstDestroy(self.__ptr)
self.__ptr = None
def set_instance_option(self, option_type: InstanceOptionType, option_value: str):

View File

@@ -24,6 +24,10 @@ class Message(Enum):
AllTasksCompleted = auto()
AsyncCallInfo = auto()
Destroyed = auto()
TaskChainError = 10000
TaskChainStart = auto()