Skip to content
This repository has been archived by the owner on Nov 2, 2023. It is now read-only.

Commit

Permalink
Merge pull request #79 from takayama-lily/dev
Browse files Browse the repository at this point in the history
-
  • Loading branch information
takayama-lily authored Nov 3, 2020
2 parents 3dd82d7 + f6ead22 commit a8af8c8
Show file tree
Hide file tree
Showing 24 changed files with 1,446 additions and 8,398 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
[![npm version](https://img.shields.io/npm/v/oicq.svg?logo=npm)](https://www.npmjs.com/package/oicq)
[![node engine](https://img.shields.io/node/v/oicq.svg)](https://nodejs.org) ← 注意版本

* QQ(安卓)协议的nodejs实现。参考了一些其他开源仓库如mirai、miraiGo等。
* QQ(安卓)协议的nodejs实现。也参考了一些其他开源仓库如mirai、miraiGo等。
* 以高效和稳定为第一目的,在此基础上不断完善功能。
* 将会逐步支持手机协议的大部分功能。
* 使用 [CQHTTP](https://cqhttp.cc) 风格的API、事件和参数(少量差异),并且原生支持经典的CQ码。
* 本项目使用AGPL-3.0许可证,旨在学习。不推荐也不提供商业化使用的支持。
* 有bug请告诉我!

----

Expand Down
14 changes: 11 additions & 3 deletions client.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export interface StrangerInfo {
sex?: string,
age?: number,
area?: string,
group_id?: number,
}
export interface FriendInfo extends StrangerInfo {
remark?: string,
Expand Down Expand Up @@ -111,6 +112,9 @@ export interface RetSendMsg extends RetCommon {

//////////

/**
* @see https://github.com/howmanybots/onebot/blob/master/v11/specs/message/segment.md
*/
export interface MessageElem {
type: string,
data: object,
Expand Down Expand Up @@ -154,6 +158,7 @@ export interface EventData {
source?: string,
role?: string,

inviter_id?: number,
operator_id?: number,
duration?: number,
set?: boolean,
Expand Down Expand Up @@ -182,10 +187,12 @@ export class Client extends events.EventEmitter {
private constructor();
login(password_md5?: Buffer | string): void;
captchaLogin(captcha: string): void;
terminate(): void;
logout(): Promise<void>;
terminate(): void; //直接关闭连接
logout(): Promise<void>; //先下线再关闭连接
isOnline(): boolean;

setOnlineStatus(status: number): Promise<RetCommon>; //11我在线上 31离开 41隐身 50忙碌 60Q我吧 70请勿打扰

getFriendList(): RetFriendList;
getStrangerList(): RetStrangerList;
getGroupList(): RetGroupList;
Expand Down Expand Up @@ -220,14 +227,15 @@ export class Client extends events.EventEmitter {
inviteFriend(group_id: Uin, user_id: Uin): Promise<RetCommon>;
sendLike(user_id: Uin, times?: number): Promise<RetCommon>;
setNickname(nickname: string): Promise<RetCommon>;
setGender(gender: 0 | 1 | 2): Promise<RetCommon>;
setGender(gender: 0 | 1 | 2): Promise<RetCommon>; //0未知 1男 2女
setBirthday(birthday: string | number): Promise<RetCommon>; //20110202的形式
setDescription(description?: string): Promise<RetCommon>;
setSignature(signature?: string): Promise<RetCommon>;
setPortrait(file?: Buffer | string): Promise<RetCommon>; //图片CQ码中file相同格式

getCookies(domain?: string): Promise<RetCommon>;
getCsrfToken(): Promise<RetCommon>;
cleanCache(type?: string): Promise<RetCommon>;
canSendImage(): RetCommon;
canSendRecord(): RetCommon;
getVersionInfo(): RetCommon;
Expand Down
Loading

0 comments on commit a8af8c8

Please sign in to comment.