@kotori-bot/kotori-plugin-adapter-sandbox
Version:
Kotori modules test environment,a visual sandbox
263 lines (262 loc) • 7.78 kB
TypeScript
import { z } from 'zod';
interface ActionSendPrivateMsg {
action: 'send_private_msg';
message: string;
userId: string;
}
interface ActionSendGroupMsg {
action: 'send_group_msg';
message: string;
groupId: string;
}
interface ActionDeleteMsg {
action: 'delete_msg';
messageId: string;
}
interface ActionGetSelfInfo {
action: 'get_self_info';
}
interface ActionGetUserInfo {
action: 'get_user_info';
userId: string;
}
interface ActionGetFriendList {
action: 'get_friend_list';
}
interface ActionGetGroupInfo {
action: 'get_group_info';
groupId: string;
}
interface ActionGetGroupList {
action: 'get_group_list';
}
interface ActionGetGroupMemberInfo {
action: 'get_group_member_info';
groupId: string;
userId: string;
}
interface ActionGetGroupMemberList {
action: 'get_group_member_list';
groupId: string;
}
interface ActionSetGroupName {
action: 'set_group_name';
groupId: string;
groupName: string;
}
interface ActionSetGroupLeave {
action: 'leave_group';
groupId: string;
}
interface ActionSetGroupAdmin {
action: 'set_group_admin';
groupId: string;
userId: string;
enable: boolean;
}
interface ActionSetGroupCard {
action: 'set_group_card';
groupId: string;
userId: string;
card: string;
}
interface ActionSetGroupKick {
action: 'set_group_kick';
groupId: string;
userId: string;
}
interface ActionSetGroupBan {
action: 'set_group_ban';
groupId: string;
userId: string;
time: number;
}
interface ActionSetGroupWholeBan {
action: 'set_group_whole_ban';
groupId: string;
enable: boolean;
}
interface ActionOnDataError {
action: 'on_data_error';
error: string;
}
export type ActionList = ActionSendPrivateMsg | ActionSendGroupMsg | ActionDeleteMsg | ActionGetSelfInfo | ActionGetUserInfo | ActionGetFriendList | ActionGetGroupInfo | ActionGetGroupList | ActionGetGroupMemberInfo | ActionGetGroupMemberList | ActionSetGroupName | ActionSetGroupLeave | ActionSetGroupAdmin | ActionSetGroupCard | ActionSetGroupKick | ActionSetGroupBan | ActionSetGroupWholeBan | ActionOnDataError;
export declare const eventDataSchema: z.ZodUnion<readonly [z.ZodObject<{
event: z.ZodLiteral<"on_message">;
type: z.ZodLiteral<0>;
message: z.ZodString;
messageAlt: z.ZodString;
userId: z.ZodString;
sender: z.ZodObject<{
nickname: z.ZodString;
}, z.core.$strip>;
time: z.ZodNumber;
}, z.core.$strip>, z.ZodObject<{
event: z.ZodLiteral<"on_message">;
type: z.ZodLiteral<1>;
message: z.ZodString;
messageAlt: z.ZodString;
userId: z.ZodString;
sender: z.ZodObject<{
nickname: z.ZodString;
role: z.ZodEnum<{
owner: "owner";
admin: "admin";
member: "member";
}>;
}, z.core.$strip>;
time: z.ZodNumber;
groupId: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
event: z.ZodLiteral<"on_message">;
type: z.ZodLiteral<2>;
message: z.ZodString;
messageAlt: z.ZodString;
userId: z.ZodString;
sender: z.ZodObject<{
nickname: z.ZodString;
}, z.core.$strip>;
time: z.ZodNumber;
channelId: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
event: z.ZodLiteral<"on_message_delete">;
type: z.ZodLiteral<0>;
userId: z.ZodString;
messageId: z.ZodString;
time: z.ZodNumber;
}, z.core.$strip>, z.ZodObject<{
event: z.ZodLiteral<"on_message_delete">;
type: z.ZodLiteral<1>;
userId: z.ZodString;
messageId: z.ZodString;
operatorId: z.ZodString;
groupId: z.ZodString;
time: z.ZodNumber;
}, z.core.$strip>, z.ZodObject<{
event: z.ZodLiteral<"on_message_delete">;
type: z.ZodLiteral<2>;
userId: z.ZodString;
messageId: z.ZodString;
operatorId: z.ZodString;
channelId: z.ZodString;
guildId: z.ZodString;
time: z.ZodNumber;
}, z.core.$strip>, z.ZodObject<{
event: z.ZodLiteral<"on_friend_increase">;
type: z.ZodLiteral<0>;
userId: z.ZodString;
time: z.ZodNumber;
}, z.core.$strip>, z.ZodObject<{
event: z.ZodLiteral<"on_friend_decrease">;
type: z.ZodLiteral<0>;
userId: z.ZodString;
time: z.ZodNumber;
}, z.core.$strip>, z.ZodObject<{
event: z.ZodLiteral<"on_group_increase">;
type: z.ZodLiteral<1>;
userId: z.ZodString;
operatorId: z.ZodString;
groupId: z.ZodString;
time: z.ZodNumber;
}, z.core.$strip>, z.ZodObject<{
event: z.ZodLiteral<"on_group_decrease">;
type: z.ZodLiteral<1>;
userId: z.ZodString;
operatorId: z.ZodString;
groupId: z.ZodString;
time: z.ZodNumber;
}, z.core.$strip>, z.ZodObject<{
event: z.ZodLiteral<"on_guild_increase">;
type: z.ZodLiteral<2>;
userId: z.ZodString;
operatorId: z.ZodString;
channelId: z.ZodString;
guildId: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
event: z.ZodLiteral<"on_guild_decrease">;
type: z.ZodLiteral<2>;
userId: z.ZodString;
operatorId: z.ZodString;
channelId: z.ZodString;
guildId: z.ZodString;
time: z.ZodNumber;
}, z.core.$strip>, z.ZodObject<{
event: z.ZodLiteral<"on_channel_increase">;
type: z.ZodLiteral<2>;
userId: z.ZodString;
operatorId: z.ZodString;
channelId: z.ZodString;
guildId: z.ZodString;
time: z.ZodNumber;
}, z.core.$strip>, z.ZodObject<{
event: z.ZodLiteral<"on_channel_decrease">;
type: z.ZodLiteral<2>;
userId: z.ZodString;
operatorId: z.ZodString;
channelId: z.ZodString;
guildId: z.ZodString;
time: z.ZodNumber;
}, z.core.$strip>, z.ZodObject<{
event: z.ZodLiteral<"on_group_admin">;
type: z.ZodLiteral<1>;
userId: z.ZodString;
operation: z.ZodUnion<readonly [z.ZodLiteral<"set">, z.ZodLiteral<"unset">]>;
groupId: z.ZodString;
time: z.ZodNumber;
}, z.core.$strip>, z.ZodObject<{
event: z.ZodLiteral<"on_group_ban">;
type: z.ZodLiteral<1>;
userId: z.ZodString;
operatorId: z.ZodString;
duration: z.ZodNumber;
groupId: z.ZodString;
time: z.ZodNumber;
}, z.core.$strip>, z.ZodObject<{
event: z.ZodLiteral<"on_group_whole_ban">;
type: z.ZodLiteral<1>;
operatorId: z.ZodString;
operation: z.ZodUnion<readonly [z.ZodLiteral<"set">, z.ZodLiteral<"unset">]>;
groupId: z.ZodString;
time: z.ZodNumber;
}, z.core.$strip>]>;
export declare const responseSchema: z.ZodUnion<readonly [z.ZodObject<{
response: z.ZodLiteral<"send_message_response">;
messageId: z.ZodString;
time: z.ZodNumber;
}, z.core.$strip>, z.ZodObject<{
response: z.ZodLiteral<"self_info_response">;
userId: z.ZodString;
username: z.ZodString;
userDisplayname: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
response: z.ZodLiteral<"user_info_response">;
userId: z.ZodString;
username: z.ZodString;
userDisplayname: z.ZodString;
userRemark: z.ZodString;
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
response: z.ZodLiteral<"user_info_response">;
userId: z.ZodString;
username: z.ZodString;
userDisplayname: z.ZodString;
userRemark: z.ZodString;
}, z.core.$strip>>, z.ZodObject<{
response: z.ZodLiteral<"group_info_response">;
groupId: z.ZodString;
groupName: z.ZodString;
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
response: z.ZodLiteral<"group_info_response">;
groupId: z.ZodString;
groupName: z.ZodString;
}, z.core.$strip>>, z.ZodObject<{
response: z.ZodLiteral<"group_member_info_response">;
userId: z.ZodString;
username: z.ZodString;
userDisplayname: z.ZodString;
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
response: z.ZodLiteral<"group_member_info_response">;
userId: z.ZodString;
username: z.ZodString;
userDisplayname: z.ZodString;
}, z.core.$strip>>]>;
export {};