koishi.d.ts 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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 tempSenders;
  29. private next;
  30. private enqueue;
  31. private getChat;
  32. private sendToGroup;
  33. private sendToUser;
  34. sendTo: (subscriber: IChat, messageChain: string, noErrors?: boolean) => Promise<void>;
  35. private initBot;
  36. private listen;
  37. connect: () => Promise<void>;
  38. constructor(opt: IQQProps);
  39. }
  40. export {};