消息
Some checks failed
test / Run tests (push) Failing after 6s
build / Build (push) Failing after 18s
Some checks failed
test / Run tests (push) Failing after 6s
build / Build (push) Failing after 18s
This commit is contained in:
@ -1,9 +1,10 @@
|
||||
import LoggerCore from "@App/app/logger/core";
|
||||
import { Message, MessageConnect } from "./server";
|
||||
import { Message, MessageConnect, MessageSend } from "./server";
|
||||
import { ExtensionMessageSend } from "./extension_message";
|
||||
|
||||
export async function sendMessage(msg: Message, action: string, data?: any): Promise<any> {
|
||||
export async function sendMessage(msg: MessageSend, action: string, data?: any): Promise<any> {
|
||||
const res = await msg.sendMessage({ action, data });
|
||||
LoggerCore.getInstance().logger().debug("sendMessage", { action, data, response: res });
|
||||
LoggerCore.getInstance().logger().trace("sendMessage", { action, data, response: res });
|
||||
if (res && res.code) {
|
||||
console.error(res);
|
||||
return Promise.reject(res.message);
|
||||
@ -18,7 +19,7 @@ export function connect(msg: Message, action: string, data?: any): Promise<Messa
|
||||
|
||||
export class Client {
|
||||
constructor(
|
||||
private msg: Message,
|
||||
private msg: ExtensionMessageSend,
|
||||
private prefix: string
|
||||
) {
|
||||
if (!this.prefix.endsWith("/")) {
|
||||
|
Reference in New Issue
Block a user