onebots
Version:
基于icqq的多例oneBot实现
43 lines (42 loc) • 2.06 kB
TypeScript
import { Adapter } from "../../adapter";
import { App } from "../../server/app";
import { OneBot } from "../../onebot";
import { Bot, Sendable } from "node-dd-bot";
export default class DingtalkAdapter extends Adapter<"dingtalk", Sendable> {
#private;
constructor(app: App, config: DingtalkAdapter.Config);
startOneBot(oneBot: OneBot<Bot>): Promise<() => void>;
getBaseInfo(uin: string): {
username: string;
avatar: string;
};
setOnline(uin: string): Promise<void>;
setOffline(uin: string): Promise<void>;
createOneBot(uin: string, protocol: Bot.Options, versions: OneBot.Config[]): OneBot;
call(uin: string, version: string, method: string, args?: any[]): Promise<any>;
sendPrivateMessage<V extends OneBot.Version>(uin: string, version: V, args: [string, Sendable, string]): Promise<OneBot.MessageRet<V>>;
sendGroupMessage<V extends OneBot.Version>(uin: string, version: V, args: [string, Sendable, string]): Promise<OneBot.MessageRet<V>>;
deleteMessage(uin: string, message_id: string): Promise<boolean>;
fromSegment<V extends OneBot.Version>(onebot: OneBot<Bot>, version: V, segment: OneBot.Segment<V> | OneBot.Segment<V>[]): Sendable;
toSegment<V extends OneBot.Version>(version: V, message: Sendable): OneBot.Segment<V>[];
fromCqcode<V extends OneBot.Version>(version: V, message: string): OneBot.Segment<V>[];
formatEventPayload<V extends OneBot.Version>(uin: string, version: V, event: string, data: any): OneBot.Payload<V>;
start(uin: string): Promise<void>;
stop(uin?: string): Promise<void>;
getSelfInfo<V extends OneBot.Version>(uin: string, version: V): OneBot.SelfInfo<V>;
}
declare module "../../adapter" {
namespace Adapter {
interface Configs {
dingtalk: DingtalkAdapter.Config;
}
}
}
export declare namespace DingtalkAdapter {
interface Config extends Adapter.Config<"dingtalk"> {
protocol: Omit<Bot.Options, "clientId"> & {
username?: string;
avatar?: string;
};
}
}