feat: add new Event
This commit is contained in:
parent
b331df501c
commit
56cd66ffa8
0
.projectroot
Normal file
0
.projectroot
Normal file
111
python/events/account/KtGenerator.py
Normal file
111
python/events/account/KtGenerator.py
Normal file
|
|
@ -0,0 +1,111 @@
|
||||||
|
import os
|
||||||
|
|
||||||
|
# 原始API路径列表
|
||||||
|
api_paths = [
|
||||||
|
"/set_qq_avatar",
|
||||||
|
"/send_like",
|
||||||
|
"/mark_private_msg_as_read",
|
||||||
|
"/mark_group_msg_as_read",
|
||||||
|
"/create_collection",
|
||||||
|
"/set_friend_add_request",
|
||||||
|
"/set_self_longnick",
|
||||||
|
"/get_login_info",
|
||||||
|
"/get_recent_contact",
|
||||||
|
"/get_stranger_info",
|
||||||
|
"/get_friend_list",
|
||||||
|
"/_mark_all_as_read",
|
||||||
|
"/get_profile_like",
|
||||||
|
"/fetch_custom_face",
|
||||||
|
"/delete_friend",
|
||||||
|
"/_get_model_show",
|
||||||
|
"/_set_model_show",
|
||||||
|
"/nc_get_user_status",
|
||||||
|
"/get_status",
|
||||||
|
"/get_mini_app_ark",
|
||||||
|
"/get_unidirectional_friend_list",
|
||||||
|
"/set_diy_online_status",
|
||||||
|
"/set_friend_remark"
|
||||||
|
]
|
||||||
|
|
||||||
|
# Kotlin事件类模板
|
||||||
|
kotlin_template = """
|
||||||
|
package top.r3944realms.ltdmanager.napcat.events.account
|
||||||
|
|
||||||
|
import kotlinx.serialization.SerialName
|
||||||
|
import kotlinx.serialization.Serializable
|
||||||
|
import kotlinx.serialization.Transient
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {event_description}事件
|
||||||
|
* @property data 响应数据
|
||||||
|
*/
|
||||||
|
@Serializable
|
||||||
|
data class {class_name}(
|
||||||
|
@Transient
|
||||||
|
val status0: Status = Status.Ok,
|
||||||
|
@Transient
|
||||||
|
val retcode0: Double = 0.0,
|
||||||
|
@Transient
|
||||||
|
val message0: String = "",
|
||||||
|
@Transient
|
||||||
|
val wording0: String = "",
|
||||||
|
@Transient
|
||||||
|
val echo0: String? = null,
|
||||||
|
|
||||||
|
|
||||||
|
) : AbstractAccountEvent(status0, retcode0, message0, wording0, echo0) {{
|
||||||
|
|
||||||
|
override fun subtype(): String {{
|
||||||
|
return "{original_name}"
|
||||||
|
}}
|
||||||
|
}}
|
||||||
|
"""
|
||||||
|
|
||||||
|
def path_to_class_name(api_path):
|
||||||
|
"""将API路径转换为类名"""
|
||||||
|
# 移除斜杠和前缀下划线
|
||||||
|
clean_path = api_path.lstrip('/').lstrip('_')
|
||||||
|
# 分割单词并转换为驼峰命名
|
||||||
|
parts = clean_path.split('_')
|
||||||
|
return ''.join(part.capitalize() for part in parts) + "Event"
|
||||||
|
|
||||||
|
def path_to_original_name(api_path):
|
||||||
|
"""获取原始API名称(不带斜杠)"""
|
||||||
|
return api_path.lstrip('/')
|
||||||
|
|
||||||
|
def generate_description(class_name):
|
||||||
|
"""生成事件描述"""
|
||||||
|
return class_name.replace("Event", "")
|
||||||
|
|
||||||
|
def generate_kotlin_class(api_path):
|
||||||
|
"""生成完整的Kotlin类"""
|
||||||
|
class_name = path_to_class_name(api_path)
|
||||||
|
original_name = path_to_original_name(api_path)
|
||||||
|
event_description = generate_description(class_name)
|
||||||
|
|
||||||
|
return kotlin_template.format(
|
||||||
|
class_name=class_name,
|
||||||
|
original_name=original_name,
|
||||||
|
event_description=event_description
|
||||||
|
)
|
||||||
|
|
||||||
|
def main():
|
||||||
|
# 创建输出目录
|
||||||
|
output_dir = "../../../src/main/kotlin/top/r3944realms/ltdmanager/napcat/events/account/wip"
|
||||||
|
os.makedirs(output_dir, exist_ok=True)
|
||||||
|
|
||||||
|
# 为每个API路径生成Kotlin文件
|
||||||
|
for api_path in api_paths:
|
||||||
|
kotlin_code = generate_kotlin_class(api_path)
|
||||||
|
class_name = path_to_class_name(api_path)
|
||||||
|
filename = f"{output_dir}/{class_name}.kt"
|
||||||
|
|
||||||
|
with open(filename, "w", encoding="utf-8") as f:
|
||||||
|
f.write(kotlin_code)
|
||||||
|
|
||||||
|
print(f"Generated: {filename}")
|
||||||
|
|
||||||
|
print(f"\nSuccessfully generated {len(api_paths)} Kotlin event classes in '{output_dir}' directory")
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
111
python/events/group/KtGenerator.py
Normal file
111
python/events/group/KtGenerator.py
Normal file
|
|
@ -0,0 +1,111 @@
|
||||||
|
import os
|
||||||
|
|
||||||
|
# 原始API路径列表
|
||||||
|
api_paths = [
|
||||||
|
"/set_qq_avatar",
|
||||||
|
"/send_like",
|
||||||
|
"/mark_private_msg_as_read",
|
||||||
|
"/mark_group_msg_as_read",
|
||||||
|
"/create_collection",
|
||||||
|
"/set_friend_add_request",
|
||||||
|
"/set_self_longnick",
|
||||||
|
"/get_login_info",
|
||||||
|
"/get_recent_contact",
|
||||||
|
"/get_stranger_info",
|
||||||
|
"/get_friend_list",
|
||||||
|
"/_mark_all_as_read",
|
||||||
|
"/get_profile_like",
|
||||||
|
"/fetch_custom_face",
|
||||||
|
"/delete_friend",
|
||||||
|
"/_get_model_show",
|
||||||
|
"/_set_model_show",
|
||||||
|
"/nc_get_user_status",
|
||||||
|
"/get_status",
|
||||||
|
"/get_mini_app_ark",
|
||||||
|
"/get_unidirectional_friend_list",
|
||||||
|
"/set_diy_online_status",
|
||||||
|
"/set_friend_remark"
|
||||||
|
]
|
||||||
|
|
||||||
|
# Kotlin事件类模板
|
||||||
|
kotlin_template = """
|
||||||
|
package top.r3944realms.ltdmanager.napcat.events.group
|
||||||
|
|
||||||
|
import kotlinx.serialization.SerialName
|
||||||
|
import kotlinx.serialization.Serializable
|
||||||
|
import kotlinx.serialization.Transient
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {event_description}事件
|
||||||
|
* @property data 响应数据
|
||||||
|
*/
|
||||||
|
@Serializable
|
||||||
|
data class {class_name}(
|
||||||
|
@Transient
|
||||||
|
val status0: Status = Status.Ok,
|
||||||
|
@Transient
|
||||||
|
val retcode0: Double = 0.0,
|
||||||
|
@Transient
|
||||||
|
val message0: String = "",
|
||||||
|
@Transient
|
||||||
|
val wording0: String = "",
|
||||||
|
@Transient
|
||||||
|
val echo0: String? = null,
|
||||||
|
|
||||||
|
|
||||||
|
) : AbstractGroupEvent(status0, retcode0, message0, wording0, echo0) {{
|
||||||
|
|
||||||
|
override fun subtype(): String {{
|
||||||
|
return "{original_name}"
|
||||||
|
}}
|
||||||
|
}}
|
||||||
|
"""
|
||||||
|
|
||||||
|
def path_to_class_name(api_path):
|
||||||
|
"""将API路径转换为类名"""
|
||||||
|
# 移除斜杠和前缀下划线
|
||||||
|
clean_path = api_path.lstrip('/').lstrip('_')
|
||||||
|
# 分割单词并转换为驼峰命名
|
||||||
|
parts = clean_path.split('_')
|
||||||
|
return ''.join(part.capitalize() for part in parts) + "Event"
|
||||||
|
|
||||||
|
def path_to_original_name(api_path):
|
||||||
|
"""获取原始API名称(不带斜杠)"""
|
||||||
|
return api_path.lstrip('/')
|
||||||
|
|
||||||
|
def generate_description(class_name):
|
||||||
|
"""生成事件描述"""
|
||||||
|
return class_name.replace("Event", "")
|
||||||
|
|
||||||
|
def generate_kotlin_class(api_path):
|
||||||
|
"""生成完整的Kotlin类"""
|
||||||
|
class_name = path_to_class_name(api_path)
|
||||||
|
original_name = path_to_original_name(api_path)
|
||||||
|
event_description = generate_description(class_name)
|
||||||
|
|
||||||
|
return kotlin_template.format(
|
||||||
|
class_name=class_name,
|
||||||
|
original_name=original_name,
|
||||||
|
event_description=event_description
|
||||||
|
)
|
||||||
|
|
||||||
|
def main():
|
||||||
|
# 创建输出目录
|
||||||
|
output_dir = "../../../src/main/kotlin/top/r3944realms/ltdmanager/napcat/events/group/wip"
|
||||||
|
os.makedirs(output_dir, exist_ok=True)
|
||||||
|
|
||||||
|
# 为每个API路径生成Kotlin文件
|
||||||
|
for api_path in api_paths:
|
||||||
|
kotlin_code = generate_kotlin_class(api_path)
|
||||||
|
class_name = path_to_class_name(api_path)
|
||||||
|
filename = f"{output_dir}/{class_name}.kt"
|
||||||
|
|
||||||
|
with open(filename, "w", encoding="utf-8") as f:
|
||||||
|
f.write(kotlin_code)
|
||||||
|
|
||||||
|
print(f"Generated: {filename}")
|
||||||
|
|
||||||
|
print(f"\nSuccessfully generated {len(api_paths)} Kotlin event classes in '{output_dir}' directory")
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
111
python/events/message/KtGenerator.py
Normal file
111
python/events/message/KtGenerator.py
Normal file
|
|
@ -0,0 +1,111 @@
|
||||||
|
import os
|
||||||
|
|
||||||
|
# 原始API路径列表
|
||||||
|
api_paths = [
|
||||||
|
"/set_qq_avatar",
|
||||||
|
"/send_like",
|
||||||
|
"/mark_private_msg_as_read",
|
||||||
|
"/mark_group_msg_as_read",
|
||||||
|
"/create_collection",
|
||||||
|
"/set_friend_add_request",
|
||||||
|
"/set_self_longnick",
|
||||||
|
"/get_login_info",
|
||||||
|
"/get_recent_contact",
|
||||||
|
"/get_stranger_info",
|
||||||
|
"/get_friend_list",
|
||||||
|
"/_mark_all_as_read",
|
||||||
|
"/get_profile_like",
|
||||||
|
"/fetch_custom_face",
|
||||||
|
"/delete_friend",
|
||||||
|
"/_get_model_show",
|
||||||
|
"/_set_model_show",
|
||||||
|
"/nc_get_user_status",
|
||||||
|
"/get_status",
|
||||||
|
"/get_mini_app_ark",
|
||||||
|
"/get_unidirectional_friend_list",
|
||||||
|
"/set_diy_online_status",
|
||||||
|
"/set_friend_remark"
|
||||||
|
]
|
||||||
|
|
||||||
|
# Kotlin事件类模板
|
||||||
|
kotlin_template = """
|
||||||
|
package top.r3944realms.ltdmanager.napcat.events.account
|
||||||
|
|
||||||
|
import kotlinx.serialization.SerialName
|
||||||
|
import kotlinx.serialization.Serializable
|
||||||
|
import kotlinx.serialization.Transient
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {event_description}事件
|
||||||
|
* @property data 响应数据
|
||||||
|
*/
|
||||||
|
@Serializable
|
||||||
|
data class {class_name}(
|
||||||
|
@Transient
|
||||||
|
val status0: Status = Status.Ok,
|
||||||
|
@Transient
|
||||||
|
val retcode0: Double = 0.0,
|
||||||
|
@Transient
|
||||||
|
val message0: String = "",
|
||||||
|
@Transient
|
||||||
|
val wording0: String = "",
|
||||||
|
@Transient
|
||||||
|
val echo0: String? = null,
|
||||||
|
|
||||||
|
|
||||||
|
) : AbstractAccountEvent(status0, retcode0, message0, wording0, echo0) {{
|
||||||
|
|
||||||
|
override fun subtype(): String {{
|
||||||
|
return "{original_name}"
|
||||||
|
}}
|
||||||
|
}}
|
||||||
|
"""
|
||||||
|
|
||||||
|
def path_to_class_name(api_path):
|
||||||
|
"""将API路径转换为类名"""
|
||||||
|
# 移除斜杠和前缀下划线
|
||||||
|
clean_path = api_path.lstrip('/').lstrip('_')
|
||||||
|
# 分割单词并转换为驼峰命名
|
||||||
|
parts = clean_path.split('_')
|
||||||
|
return ''.join(part.capitalize() for part in parts) + "Event"
|
||||||
|
|
||||||
|
def path_to_original_name(api_path):
|
||||||
|
"""获取原始API名称(不带斜杠)"""
|
||||||
|
return api_path.lstrip('/')
|
||||||
|
|
||||||
|
def generate_description(class_name):
|
||||||
|
"""生成事件描述"""
|
||||||
|
return class_name.replace("Event", "")
|
||||||
|
|
||||||
|
def generate_kotlin_class(api_path):
|
||||||
|
"""生成完整的Kotlin类"""
|
||||||
|
class_name = path_to_class_name(api_path)
|
||||||
|
original_name = path_to_original_name(api_path)
|
||||||
|
event_description = generate_description(class_name)
|
||||||
|
|
||||||
|
return kotlin_template.format(
|
||||||
|
class_name=class_name,
|
||||||
|
original_name=original_name,
|
||||||
|
event_description=event_description
|
||||||
|
)
|
||||||
|
|
||||||
|
def main():
|
||||||
|
# 创建输出目录
|
||||||
|
output_dir = "../../../src/main/kotlin/top/r3944realms/ltdmanager/napcat/events/account/wip"
|
||||||
|
os.makedirs(output_dir, exist_ok=True)
|
||||||
|
|
||||||
|
# 为每个API路径生成Kotlin文件
|
||||||
|
for api_path in api_paths:
|
||||||
|
kotlin_code = generate_kotlin_class(api_path)
|
||||||
|
class_name = path_to_class_name(api_path)
|
||||||
|
filename = f"{output_dir}/{class_name}.kt"
|
||||||
|
|
||||||
|
with open(filename, "w", encoding="utf-8") as f:
|
||||||
|
f.write(kotlin_code)
|
||||||
|
|
||||||
|
print(f"Generated: {filename}")
|
||||||
|
|
||||||
|
print(f"\nSuccessfully generated {len(api_paths)} Kotlin event classes in '{output_dir}' directory")
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
111
python/events/message/group/KtGenerator.py
Normal file
111
python/events/message/group/KtGenerator.py
Normal file
|
|
@ -0,0 +1,111 @@
|
||||||
|
import os
|
||||||
|
|
||||||
|
# 原始API路径列表
|
||||||
|
api_paths = [
|
||||||
|
"/set_qq_avatar",
|
||||||
|
"/send_like",
|
||||||
|
"/mark_private_msg_as_read",
|
||||||
|
"/mark_group_msg_as_read",
|
||||||
|
"/create_collection",
|
||||||
|
"/set_friend_add_request",
|
||||||
|
"/set_self_longnick",
|
||||||
|
"/get_login_info",
|
||||||
|
"/get_recent_contact",
|
||||||
|
"/get_stranger_info",
|
||||||
|
"/get_friend_list",
|
||||||
|
"/_mark_all_as_read",
|
||||||
|
"/get_profile_like",
|
||||||
|
"/fetch_custom_face",
|
||||||
|
"/delete_friend",
|
||||||
|
"/_get_model_show",
|
||||||
|
"/_set_model_show",
|
||||||
|
"/nc_get_user_status",
|
||||||
|
"/get_status",
|
||||||
|
"/get_mini_app_ark",
|
||||||
|
"/get_unidirectional_friend_list",
|
||||||
|
"/set_diy_online_status",
|
||||||
|
"/set_friend_remark"
|
||||||
|
]
|
||||||
|
|
||||||
|
# Kotlin事件类模板
|
||||||
|
kotlin_template = """
|
||||||
|
package top.r3944realms.ltdmanager.napcat.events.account
|
||||||
|
|
||||||
|
import kotlinx.serialization.SerialName
|
||||||
|
import kotlinx.serialization.Serializable
|
||||||
|
import kotlinx.serialization.Transient
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {event_description}事件
|
||||||
|
* @property data 响应数据
|
||||||
|
*/
|
||||||
|
@Serializable
|
||||||
|
data class {class_name}(
|
||||||
|
@Transient
|
||||||
|
val status0: Status = Status.Ok,
|
||||||
|
@Transient
|
||||||
|
val retcode0: Double = 0.0,
|
||||||
|
@Transient
|
||||||
|
val message0: String = "",
|
||||||
|
@Transient
|
||||||
|
val wording0: String = "",
|
||||||
|
@Transient
|
||||||
|
val echo0: String? = null,
|
||||||
|
|
||||||
|
|
||||||
|
) : AbstractAccountEvent(status0, retcode0, message0, wording0, echo0) {{
|
||||||
|
|
||||||
|
override fun subtype(): String {{
|
||||||
|
return "{original_name}"
|
||||||
|
}}
|
||||||
|
}}
|
||||||
|
"""
|
||||||
|
|
||||||
|
def path_to_class_name(api_path):
|
||||||
|
"""将API路径转换为类名"""
|
||||||
|
# 移除斜杠和前缀下划线
|
||||||
|
clean_path = api_path.lstrip('/').lstrip('_')
|
||||||
|
# 分割单词并转换为驼峰命名
|
||||||
|
parts = clean_path.split('_')
|
||||||
|
return ''.join(part.capitalize() for part in parts) + "Event"
|
||||||
|
|
||||||
|
def path_to_original_name(api_path):
|
||||||
|
"""获取原始API名称(不带斜杠)"""
|
||||||
|
return api_path.lstrip('/')
|
||||||
|
|
||||||
|
def generate_description(class_name):
|
||||||
|
"""生成事件描述"""
|
||||||
|
return class_name.replace("Event", "")
|
||||||
|
|
||||||
|
def generate_kotlin_class(api_path):
|
||||||
|
"""生成完整的Kotlin类"""
|
||||||
|
class_name = path_to_class_name(api_path)
|
||||||
|
original_name = path_to_original_name(api_path)
|
||||||
|
event_description = generate_description(class_name)
|
||||||
|
|
||||||
|
return kotlin_template.format(
|
||||||
|
class_name=class_name,
|
||||||
|
original_name=original_name,
|
||||||
|
event_description=event_description
|
||||||
|
)
|
||||||
|
|
||||||
|
def main():
|
||||||
|
# 创建输出目录
|
||||||
|
output_dir = "../../../src/main/kotlin/top/r3944realms/ltdmanager/napcat/events/account/wip"
|
||||||
|
os.makedirs(output_dir, exist_ok=True)
|
||||||
|
|
||||||
|
# 为每个API路径生成Kotlin文件
|
||||||
|
for api_path in api_paths:
|
||||||
|
kotlin_code = generate_kotlin_class(api_path)
|
||||||
|
class_name = path_to_class_name(api_path)
|
||||||
|
filename = f"{output_dir}/{class_name}.kt"
|
||||||
|
|
||||||
|
with open(filename, "w", encoding="utf-8") as f:
|
||||||
|
f.write(kotlin_code)
|
||||||
|
|
||||||
|
print(f"Generated: {filename}")
|
||||||
|
|
||||||
|
print(f"\nSuccessfully generated {len(api_paths)} Kotlin event classes in '{output_dir}' directory")
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
111
python/events/message/personal/KtGenerator.py
Normal file
111
python/events/message/personal/KtGenerator.py
Normal file
|
|
@ -0,0 +1,111 @@
|
||||||
|
import os
|
||||||
|
|
||||||
|
# 原始API路径列表
|
||||||
|
api_paths = [
|
||||||
|
"/set_qq_avatar",
|
||||||
|
"/send_like",
|
||||||
|
"/mark_private_msg_as_read",
|
||||||
|
"/mark_group_msg_as_read",
|
||||||
|
"/create_collection",
|
||||||
|
"/set_friend_add_request",
|
||||||
|
"/set_self_longnick",
|
||||||
|
"/get_login_info",
|
||||||
|
"/get_recent_contact",
|
||||||
|
"/get_stranger_info",
|
||||||
|
"/get_friend_list",
|
||||||
|
"/_mark_all_as_read",
|
||||||
|
"/get_profile_like",
|
||||||
|
"/fetch_custom_face",
|
||||||
|
"/delete_friend",
|
||||||
|
"/_get_model_show",
|
||||||
|
"/_set_model_show",
|
||||||
|
"/nc_get_user_status",
|
||||||
|
"/get_status",
|
||||||
|
"/get_mini_app_ark",
|
||||||
|
"/get_unidirectional_friend_list",
|
||||||
|
"/set_diy_online_status",
|
||||||
|
"/set_friend_remark"
|
||||||
|
]
|
||||||
|
|
||||||
|
# Kotlin事件类模板
|
||||||
|
kotlin_template = """
|
||||||
|
package top.r3944realms.ltdmanager.napcat.events.account
|
||||||
|
|
||||||
|
import kotlinx.serialization.SerialName
|
||||||
|
import kotlinx.serialization.Serializable
|
||||||
|
import kotlinx.serialization.Transient
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {event_description}事件
|
||||||
|
* @property data 响应数据
|
||||||
|
*/
|
||||||
|
@Serializable
|
||||||
|
data class {class_name}(
|
||||||
|
@Transient
|
||||||
|
val status0: Status = Status.Ok,
|
||||||
|
@Transient
|
||||||
|
val retcode0: Double = 0.0,
|
||||||
|
@Transient
|
||||||
|
val message0: String = "",
|
||||||
|
@Transient
|
||||||
|
val wording0: String = "",
|
||||||
|
@Transient
|
||||||
|
val echo0: String? = null,
|
||||||
|
|
||||||
|
|
||||||
|
) : AbstractAccountEvent(status0, retcode0, message0, wording0, echo0) {{
|
||||||
|
|
||||||
|
override fun subtype(): String {{
|
||||||
|
return "{original_name}"
|
||||||
|
}}
|
||||||
|
}}
|
||||||
|
"""
|
||||||
|
|
||||||
|
def path_to_class_name(api_path):
|
||||||
|
"""将API路径转换为类名"""
|
||||||
|
# 移除斜杠和前缀下划线
|
||||||
|
clean_path = api_path.lstrip('/').lstrip('_')
|
||||||
|
# 分割单词并转换为驼峰命名
|
||||||
|
parts = clean_path.split('_')
|
||||||
|
return ''.join(part.capitalize() for part in parts) + "Event"
|
||||||
|
|
||||||
|
def path_to_original_name(api_path):
|
||||||
|
"""获取原始API名称(不带斜杠)"""
|
||||||
|
return api_path.lstrip('/')
|
||||||
|
|
||||||
|
def generate_description(class_name):
|
||||||
|
"""生成事件描述"""
|
||||||
|
return class_name.replace("Event", "")
|
||||||
|
|
||||||
|
def generate_kotlin_class(api_path):
|
||||||
|
"""生成完整的Kotlin类"""
|
||||||
|
class_name = path_to_class_name(api_path)
|
||||||
|
original_name = path_to_original_name(api_path)
|
||||||
|
event_description = generate_description(class_name)
|
||||||
|
|
||||||
|
return kotlin_template.format(
|
||||||
|
class_name=class_name,
|
||||||
|
original_name=original_name,
|
||||||
|
event_description=event_description
|
||||||
|
)
|
||||||
|
|
||||||
|
def main():
|
||||||
|
# 创建输出目录
|
||||||
|
output_dir = "../../../src/main/kotlin/top/r3944realms/ltdmanager/napcat/events/account/wip"
|
||||||
|
os.makedirs(output_dir, exist_ok=True)
|
||||||
|
|
||||||
|
# 为每个API路径生成Kotlin文件
|
||||||
|
for api_path in api_paths:
|
||||||
|
kotlin_code = generate_kotlin_class(api_path)
|
||||||
|
class_name = path_to_class_name(api_path)
|
||||||
|
filename = f"{output_dir}/{class_name}.kt"
|
||||||
|
|
||||||
|
with open(filename, "w", encoding="utf-8") as f:
|
||||||
|
f.write(kotlin_code)
|
||||||
|
|
||||||
|
print(f"Generated: {filename}")
|
||||||
|
|
||||||
|
print(f"\nSuccessfully generated {len(api_paths)} Kotlin event classes in '{output_dir}' directory")
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
package top.r3944realms.ltdmanager.napcat.data
|
||||||
|
|
||||||
|
class CharBoxElement {
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
package top.r3944realms.ltdmanager.napcat.data
|
||||||
|
|
||||||
|
class Character {
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
package top.r3944realms.ltdmanager.napcat.data
|
||||||
|
|
||||||
|
class FriendeInfo {
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,59 @@
|
||||||
|
package top.r3944realms.ltdmanager.napcat.events.account
|
||||||
|
|
||||||
|
import kotlinx.serialization.SerialName
|
||||||
|
import kotlinx.serialization.Serializable
|
||||||
|
import kotlinx.serialization.Transient
|
||||||
|
import top.r3944realms.ltdmanager.napcat.data.FriendInfo
|
||||||
|
|
||||||
|
data class GetFriendsWithCategory(
|
||||||
|
@Transient
|
||||||
|
val status0: Status = Status.Ok,
|
||||||
|
@Transient
|
||||||
|
val retcode0: Double = 0.0,
|
||||||
|
@Transient
|
||||||
|
val message0: String = "",
|
||||||
|
@Transient
|
||||||
|
val wording0: String = "",
|
||||||
|
@Transient
|
||||||
|
val echo0: String? = null,
|
||||||
|
val data: Datum
|
||||||
|
|
||||||
|
) : AbstractAccountEvent(status0, retcode0, message0, wording0, echo0) {
|
||||||
|
override fun subtype(): String = "/get_friends_with_category"
|
||||||
|
@Serializable
|
||||||
|
data class Datum (
|
||||||
|
/**
|
||||||
|
* 好友列表
|
||||||
|
*/
|
||||||
|
val buddyList: List<FriendInfo>,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分组ID
|
||||||
|
*/
|
||||||
|
@SerialName("categoryId")
|
||||||
|
val categoryID: Double,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 好友数量
|
||||||
|
*/
|
||||||
|
@SerialName("categoryMbCount")
|
||||||
|
val categoryMBCount: Double,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分组名
|
||||||
|
*/
|
||||||
|
val categoryName: String,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分组排序ID
|
||||||
|
*/
|
||||||
|
@SerialName("categorySortId")
|
||||||
|
val categorySortID: Double,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在线好友数量
|
||||||
|
*/
|
||||||
|
val onlineCount: Double
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
|
||||||
|
package top.r3944realms.ltdmanager.napcat.events.personal
|
||||||
|
|
||||||
|
import kotlinx.serialization.Serializable
|
||||||
|
import kotlinx.serialization.Transient
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CanSendImage事件
|
||||||
|
* @property data 响应数据
|
||||||
|
*/
|
||||||
|
@Serializable
|
||||||
|
data class CanSendImageEvent(
|
||||||
|
@Transient
|
||||||
|
val status0: Status = Status.Ok,
|
||||||
|
@Transient
|
||||||
|
val retcode0: Double = 0.0,
|
||||||
|
@Transient
|
||||||
|
val message0: String = "",
|
||||||
|
@Transient
|
||||||
|
val wording0: String = "",
|
||||||
|
@Transient
|
||||||
|
val echo0: String? = null,
|
||||||
|
|
||||||
|
val data: Data
|
||||||
|
) : AbstractPersonalEvent(status0, retcode0, message0, wording0, echo0) {
|
||||||
|
@Serializable
|
||||||
|
data class Data (
|
||||||
|
val yes: Boolean
|
||||||
|
)
|
||||||
|
override fun subtype(): String {
|
||||||
|
return "can_send_image"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
|
||||||
|
package top.r3944realms.ltdmanager.napcat.events.personal
|
||||||
|
|
||||||
|
import kotlinx.serialization.Serializable
|
||||||
|
import kotlinx.serialization.Transient
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CanSendRecord事件
|
||||||
|
* @property data 响应数据
|
||||||
|
*/
|
||||||
|
@Serializable
|
||||||
|
data class CanSendRecordEvent(
|
||||||
|
@Transient
|
||||||
|
val status0: Status = Status.Ok,
|
||||||
|
@Transient
|
||||||
|
val retcode0: Double = 0.0,
|
||||||
|
@Transient
|
||||||
|
val message0: String = "",
|
||||||
|
@Transient
|
||||||
|
val wording0: String = "",
|
||||||
|
@Transient
|
||||||
|
val echo0: String? = null,
|
||||||
|
|
||||||
|
val data: CanSendImageEvent.Data
|
||||||
|
) : AbstractPersonalEvent(status0, retcode0, message0, wording0, echo0) {
|
||||||
|
|
||||||
|
override fun subtype(): String {
|
||||||
|
return "can_send_record"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
|
||||||
|
package top.r3944realms.ltdmanager.napcat.events.personal
|
||||||
|
|
||||||
|
import kotlinx.serialization.Serializable
|
||||||
|
import kotlinx.serialization.Transient
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClickInlineKeyboardButton事件
|
||||||
|
* @property data 响应数据
|
||||||
|
*/
|
||||||
|
@Serializable
|
||||||
|
data class ClickInlineKeyboardButtonEvent(
|
||||||
|
@Transient
|
||||||
|
val status0: Status = Status.Ok,
|
||||||
|
@Transient
|
||||||
|
val retcode0: Double = 0.0,
|
||||||
|
@Transient
|
||||||
|
val message0: String = "",
|
||||||
|
@Transient
|
||||||
|
val wording0: String = "",
|
||||||
|
@Transient
|
||||||
|
val echo0: String? = null,
|
||||||
|
|
||||||
|
val data: Data
|
||||||
|
) : AbstractPersonalEvent(status0, retcode0, message0, wording0, echo0) {
|
||||||
|
@Serializable
|
||||||
|
data class Data (
|
||||||
|
val errMsg: String,
|
||||||
|
val promptIcon: Double,
|
||||||
|
val promptText: String,
|
||||||
|
val promptType: Double,
|
||||||
|
val result: Double,
|
||||||
|
val status: Double
|
||||||
|
)
|
||||||
|
|
||||||
|
override fun subtype(): String {
|
||||||
|
return "click_inline_keyboard_button"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
|
||||||
|
package top.r3944realms.ltdmanager.napcat.events.personal
|
||||||
|
|
||||||
|
import kotlinx.serialization.Serializable
|
||||||
|
import kotlinx.serialization.Transient
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GetAiCharacters事件
|
||||||
|
* @property data 响应数据
|
||||||
|
*/
|
||||||
|
@Serializable
|
||||||
|
data class GetAiCharactersEvent(
|
||||||
|
@Transient
|
||||||
|
val status0: Status = Status.Ok,
|
||||||
|
@Transient
|
||||||
|
val retcode0: Double = 0.0,
|
||||||
|
@Transient
|
||||||
|
val message0: String = "",
|
||||||
|
@Transient
|
||||||
|
val wording0: String = "",
|
||||||
|
@Transient
|
||||||
|
val echo0: String? = null,
|
||||||
|
|
||||||
|
val data: List<Datum>
|
||||||
|
) : AbstractPersonalEvent(status0, retcode0, message0, wording0, echo0) {
|
||||||
|
@Serializable
|
||||||
|
data class Datum (
|
||||||
|
/**
|
||||||
|
* 人物列表
|
||||||
|
*/
|
||||||
|
val characters: List<top.r3944realms.ltdmanager.napcat.data.Character>,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型
|
||||||
|
*/
|
||||||
|
val type: String
|
||||||
|
)
|
||||||
|
override fun subtype(): String {
|
||||||
|
return "get_ai_characters"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
|
||||||
|
package top.r3944realms.ltdmanager.napcat.events.personal
|
||||||
|
|
||||||
|
import kotlinx.serialization.Serializable
|
||||||
|
import kotlinx.serialization.Transient
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GetAiRecord事件
|
||||||
|
* @property data 响应数据
|
||||||
|
*/
|
||||||
|
@Serializable
|
||||||
|
data class GetAiRecordEvent(
|
||||||
|
@Transient
|
||||||
|
val status0: Status = Status.Ok,
|
||||||
|
@Transient
|
||||||
|
val retcode0: Double = 0.0,
|
||||||
|
@Transient
|
||||||
|
val message0: String = "",
|
||||||
|
@Transient
|
||||||
|
val wording0: String = "",
|
||||||
|
@Transient
|
||||||
|
val echo0: String? = null,
|
||||||
|
/**
|
||||||
|
* 链接
|
||||||
|
*/
|
||||||
|
val data: String
|
||||||
|
|
||||||
|
) : AbstractPersonalEvent(status0, retcode0, message0, wording0, echo0) {
|
||||||
|
|
||||||
|
override fun subtype(): String {
|
||||||
|
return "get_ai_record"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,68 @@
|
||||||
|
|
||||||
|
package top.r3944realms.ltdmanager.napcat.events.personal
|
||||||
|
|
||||||
|
import kotlinx.serialization.Serializable
|
||||||
|
import kotlinx.serialization.Transient
|
||||||
|
import top.r3944realms.ltdmanager.napcat.data.CharBoxElement
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OcrImage事件
|
||||||
|
* @property data 响应数据
|
||||||
|
*/
|
||||||
|
@Serializable
|
||||||
|
data class OcrImageEvent(
|
||||||
|
@Transient
|
||||||
|
val status0: Status = Status.Ok,
|
||||||
|
@Transient
|
||||||
|
val retcode0: Double = 0.0,
|
||||||
|
@Transient
|
||||||
|
val message0: String = "",
|
||||||
|
@Transient
|
||||||
|
val wording0: String = "",
|
||||||
|
@Transient
|
||||||
|
val echo0: String? = null,
|
||||||
|
|
||||||
|
val data: List<Datum>
|
||||||
|
|
||||||
|
) : AbstractPersonalEvent(status0, retcode0, message0, wording0, echo0) {
|
||||||
|
/**
|
||||||
|
* 一个代表一行
|
||||||
|
*/
|
||||||
|
@Serializable
|
||||||
|
data class Datum (
|
||||||
|
/**
|
||||||
|
* 拆分
|
||||||
|
*/
|
||||||
|
val charBox: List<CharBoxElement>,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 顶点坐标
|
||||||
|
*/
|
||||||
|
val pt1: CharBoxElement.CharBoxPt,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 顶点坐标
|
||||||
|
*/
|
||||||
|
val pt2: CharBoxElement.CharBoxPt,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 顶点坐标
|
||||||
|
*/
|
||||||
|
val pt3: CharBoxElement.CharBoxPt,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 顶点坐标
|
||||||
|
*/
|
||||||
|
val pt4: CharBoxElement.CharBoxPt,
|
||||||
|
|
||||||
|
val score: String,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 该行文本总和
|
||||||
|
*/
|
||||||
|
val text: String
|
||||||
|
)
|
||||||
|
override fun subtype(): String {
|
||||||
|
return "ocr_image"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
|
||||||
|
package top.r3944realms.ltdmanager.napcat.events.personal
|
||||||
|
|
||||||
|
import kotlinx.serialization.Serializable
|
||||||
|
import kotlinx.serialization.Transient
|
||||||
|
import kotlinx.serialization.json.JsonElement
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PointHandleQuickOperation事件
|
||||||
|
* @property data 响应数据
|
||||||
|
*/
|
||||||
|
@Serializable
|
||||||
|
data class PointHandleQuickOperationEvent(
|
||||||
|
@Transient
|
||||||
|
val status0: Status = Status.Ok,
|
||||||
|
@Transient
|
||||||
|
val retcode0: Double = 0.0,
|
||||||
|
@Transient
|
||||||
|
val message0: String = "",
|
||||||
|
@Transient
|
||||||
|
val wording0: String = "",
|
||||||
|
@Transient
|
||||||
|
val echo0: String? = null,
|
||||||
|
|
||||||
|
val data: JsonElement? = null,
|
||||||
|
) : AbstractPersonalEvent(status0, retcode0, message0, wording0, echo0) {
|
||||||
|
|
||||||
|
override fun subtype(): String {
|
||||||
|
return ".handle_quick_operation"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
|
||||||
|
package top.r3944realms.ltdmanager.napcat.events.personal
|
||||||
|
|
||||||
|
import kotlinx.serialization.Serializable
|
||||||
|
import kotlinx.serialization.Transient
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PointOcrImage事件
|
||||||
|
* @property data 响应数据
|
||||||
|
*/
|
||||||
|
@Serializable
|
||||||
|
data class PointOcrImageEvent(
|
||||||
|
@Transient
|
||||||
|
val status0: Status = Status.Ok,
|
||||||
|
@Transient
|
||||||
|
val retcode0: Double = 0.0,
|
||||||
|
@Transient
|
||||||
|
val message0: String = "",
|
||||||
|
@Transient
|
||||||
|
val wording0: String = "",
|
||||||
|
@Transient
|
||||||
|
val echo0: String? = null,
|
||||||
|
|
||||||
|
val data: List<OcrImageEvent.Datum>
|
||||||
|
|
||||||
|
) : AbstractPersonalEvent(status0, retcode0, message0, wording0, echo0) {
|
||||||
|
|
||||||
|
override fun subtype(): String {
|
||||||
|
return ".ocr_image"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
package top.r3944realms.ltdmanager.napcat.events.personal
|
||||||
|
|
||||||
|
import kotlinx.serialization.Serializable
|
||||||
|
import kotlinx.serialization.Transient
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SetInputStatusEvent
|
||||||
|
* @property data 响应数据
|
||||||
|
*/
|
||||||
|
@Serializable
|
||||||
|
data class SetInputStatusEvent(
|
||||||
|
@Transient
|
||||||
|
val status0: Status = Status.Ok,
|
||||||
|
@Transient
|
||||||
|
val retcode0: Double = 0.0,
|
||||||
|
@Transient
|
||||||
|
val message0: String = "",
|
||||||
|
@Transient
|
||||||
|
val wording0: String = "",
|
||||||
|
@Transient
|
||||||
|
val echo0: String? = null,
|
||||||
|
|
||||||
|
val data: Data
|
||||||
|
|
||||||
|
) : AbstractPersonalEvent(status0, retcode0, message0, wording0, echo0) {
|
||||||
|
@Serializable
|
||||||
|
data class Data (
|
||||||
|
val errMsg: String,
|
||||||
|
val result: Double
|
||||||
|
)
|
||||||
|
override fun subtype(): String {
|
||||||
|
return "set_input_status"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
|
||||||
|
package top.r3944realms.ltdmanager.napcat.events.personal
|
||||||
|
|
||||||
|
import kotlinx.serialization.Serializable
|
||||||
|
import kotlinx.serialization.Transient
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TranslateEn2zh事件
|
||||||
|
* @property data 响应数据
|
||||||
|
*/
|
||||||
|
@Serializable
|
||||||
|
data class TranslateEn2zhEvent(
|
||||||
|
@Transient
|
||||||
|
val status0: Status = Status.Ok,
|
||||||
|
@Transient
|
||||||
|
val retcode0: Double = 0.0,
|
||||||
|
@Transient
|
||||||
|
val message0: String = "",
|
||||||
|
@Transient
|
||||||
|
val wording0: String = "",
|
||||||
|
@Transient
|
||||||
|
val echo0: String? = null,
|
||||||
|
|
||||||
|
val data: List<String>
|
||||||
|
|
||||||
|
) : AbstractPersonalEvent(status0, retcode0, message0, wording0, echo0) {
|
||||||
|
|
||||||
|
override fun subtype(): String {
|
||||||
|
return "translate_en2zh"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
|
||||||
|
package top.r3944realms.ltdmanager.napcat.events.system
|
||||||
|
|
||||||
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
|
/**
|
||||||
|
* BotExit事件
|
||||||
|
* @property data 响应数据
|
||||||
|
*/
|
||||||
|
@Serializable
|
||||||
|
class BotExitEvent: AbstractSystemEvent() {
|
||||||
|
override fun subtype(): String {
|
||||||
|
return "bot_exit"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,50 @@
|
||||||
|
|
||||||
|
package top.r3944realms.ltdmanager.napcat.events.system
|
||||||
|
|
||||||
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GetRobotUinRange事件
|
||||||
|
* @property status 状态字符串
|
||||||
|
* @property retcode 返回代码
|
||||||
|
* @property message 消息
|
||||||
|
* @property wording 文字描述
|
||||||
|
* @property echo 回显字段 (可空)
|
||||||
|
* @property data 响应数据
|
||||||
|
*/
|
||||||
|
@Serializable
|
||||||
|
data class GetRobotUinRangeEvent(
|
||||||
|
/**
|
||||||
|
* 状态字符串
|
||||||
|
*/
|
||||||
|
val status: Status,
|
||||||
|
/**
|
||||||
|
* 返回代码
|
||||||
|
*/
|
||||||
|
val retcode: Double,
|
||||||
|
/**
|
||||||
|
* 消息
|
||||||
|
*/
|
||||||
|
val message: String,
|
||||||
|
/**
|
||||||
|
* 文字描述
|
||||||
|
*/
|
||||||
|
val wording: String,
|
||||||
|
/**
|
||||||
|
* 回显字段
|
||||||
|
*/
|
||||||
|
val echo: String? = null,
|
||||||
|
val data :List<Datum>
|
||||||
|
) : AbstractSystemEvent() {
|
||||||
|
|
||||||
|
@Serializable
|
||||||
|
data class Datum (
|
||||||
|
val maxUin: String,
|
||||||
|
val minUin: String
|
||||||
|
)
|
||||||
|
override fun subtype(): String {
|
||||||
|
return "get_robot_uin_range"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,56 @@
|
||||||
|
|
||||||
|
package top.r3944realms.ltdmanager.napcat.events.system
|
||||||
|
|
||||||
|
import kotlinx.serialization.SerialName
|
||||||
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GetVersionInfo事件
|
||||||
|
* @property status 状态字符串
|
||||||
|
* @property retcode 返回代码
|
||||||
|
* @property message 消息
|
||||||
|
* @property wording 文字描述
|
||||||
|
* @property echo 回显字段 (可空)
|
||||||
|
* @property data 响应数据
|
||||||
|
*/
|
||||||
|
@Serializable
|
||||||
|
data class GetVersionInfoEvent(
|
||||||
|
/**
|
||||||
|
* 状态字符串
|
||||||
|
*/
|
||||||
|
val status: Status,
|
||||||
|
/**
|
||||||
|
* 返回代码
|
||||||
|
*/
|
||||||
|
val retcode: Double,
|
||||||
|
/**
|
||||||
|
* 消息
|
||||||
|
*/
|
||||||
|
val message: String,
|
||||||
|
/**
|
||||||
|
* 文字描述
|
||||||
|
*/
|
||||||
|
val wording: String,
|
||||||
|
/**
|
||||||
|
* 回显字段
|
||||||
|
*/
|
||||||
|
val echo: String? = null,
|
||||||
|
|
||||||
|
val data: Data
|
||||||
|
) : AbstractSystemEvent() {
|
||||||
|
@Serializable
|
||||||
|
data class Data (
|
||||||
|
@SerialName("app_name")
|
||||||
|
val appName: String,
|
||||||
|
|
||||||
|
@SerialName("app_version")
|
||||||
|
val appVersion: String,
|
||||||
|
|
||||||
|
@SerialName("protocol_version")
|
||||||
|
val protocolVersion: String
|
||||||
|
)
|
||||||
|
override fun subtype(): String {
|
||||||
|
return "get_version_info"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,47 @@
|
||||||
|
|
||||||
|
package top.r3944realms.ltdmanager.napcat.events.system
|
||||||
|
|
||||||
|
import kotlinx.serialization.Serializable
|
||||||
|
import kotlinx.serialization.json.JsonElement
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NcGetPacketStatus事件
|
||||||
|
* @property status 状态字符串
|
||||||
|
* @property retcode 返回代码
|
||||||
|
* @property message 消息
|
||||||
|
* @property wording 文字描述
|
||||||
|
* @property echo 回显字段 (可空)
|
||||||
|
* @property data 响应数据
|
||||||
|
*/
|
||||||
|
@Serializable
|
||||||
|
data class NcGetPacketStatusEvent(
|
||||||
|
/**
|
||||||
|
* 状态字符串
|
||||||
|
*/
|
||||||
|
val status: Status,
|
||||||
|
/**
|
||||||
|
* 返回代码
|
||||||
|
*/
|
||||||
|
val retcode: Double,
|
||||||
|
/**
|
||||||
|
* 消息
|
||||||
|
*/
|
||||||
|
val message: String,
|
||||||
|
/**
|
||||||
|
* 文字描述
|
||||||
|
*/
|
||||||
|
val wording: String,
|
||||||
|
/**
|
||||||
|
* 回显字段
|
||||||
|
*/
|
||||||
|
val echo: String? = null,
|
||||||
|
|
||||||
|
val data: JsonElement? = null,
|
||||||
|
|
||||||
|
) : AbstractSystemEvent() {
|
||||||
|
|
||||||
|
override fun subtype(): String {
|
||||||
|
return "nc_get_packet_status"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
|
||||||
|
package top.r3944realms.ltdmanager.napcat.events.system
|
||||||
|
|
||||||
|
import kotlinx.serialization.Serializable
|
||||||
|
import top.r3944realms.ltdmanager.napcat.Developing
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SendPacket事件
|
||||||
|
* @property data 响应数据
|
||||||
|
*/
|
||||||
|
@Developing
|
||||||
|
@Serializable
|
||||||
|
class SendPacketEvent: AbstractSystemEvent() {
|
||||||
|
override fun subtype(): String {
|
||||||
|
return "send_packet"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Loading…
Reference in New Issue
Block a user