koishi.d.ts 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /// <reference types="node" />
  2. import { Bot, segment } from 'koishi';
  3. import 'koishi-adapter-onebot';
  4. interface IQQProps {
  5. access_token: string;
  6. host: string;
  7. port: number;
  8. bot_id: number;
  9. list(chat: IChat, args: string[], replyfn: (msg: string) => any): void;
  10. sub(chat: IChat, args: string[], replyfn: (msg: string) => any): void;
  11. unsub(chat: IChat, args: string[], replyfn: (msg: string) => any): void;
  12. }
  13. export declare const Message: {
  14. Image: (value: string | ArrayBuffer | Buffer, data?: segment.Data) => string;
  15. Video: (value: string | ArrayBuffer | Buffer, data?: segment.Data) => string;
  16. Voice: (value: string | ArrayBuffer | Buffer, data?: segment.Data) => string;
  17. ellipseBase64: (msg: string) => string;
  18. separateAttachment: (msg: string) => {
  19. message: string;
  20. attachments: string[];
  21. };
  22. };
  23. export default class {
  24. private botInfo;
  25. private app;
  26. bot: Bot;
  27. private messageQueues;
  28. private next;
  29. private enqueue;
  30. private getChat;
  31. private sendToGroup;
  32. private sendToUser;
  33. sendTo: (subscriber: IChat, messageChain: string) => Promise<void>;
  34. private initBot;
  35. private listen;
  36. connect: () => Promise<void>;
  37. constructor(opt: IQQProps);
  38. }
  39. export {};