Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Group

Hierarchy

Index

Constructors

Protected constructor

Properties

Protected Readonly c

Readonly fs

fs: Gfs

群文件系统

Readonly gid

gid: number

Protected Optional uid

uid?: number

对方QQ号

Accessors

all_muted

  • get all_muted(): boolean

client

Private dm

  • get dm(): boolean

group_id

  • get group_id(): number

info

is_admin

  • get is_admin(): boolean

is_owner

  • get is_owner(): boolean

mute_left

  • get mute_left(): number

name

  • get name(): undefined | string

Private target

  • get target(): number

Methods

Private _fetchMembers

Private _getLastSeq

  • _getLastSeq(): Promise<any>

Protected _preprocess

Private _sendMsgByFrag

  • _sendMsgByFrag(converter: Converter): Promise<string>
  • Parameters

    • converter: Converter

    Returns Promise<string>

Private _setting

  • _setting(obj: {}): Promise<boolean>
  • Parameters

    • obj: {}
      • [tag: number]: any

    Returns Promise<boolean>

allowAnony

  • allowAnony(yes?: boolean): Promise<boolean>
  • 允许/禁止匿名

    Parameters

    • yes: boolean = true

    Returns Promise<boolean>

announce

  • announce(content: string): Promise<boolean>
  • 发送简易群公告

    Parameters

    • content: string

    Returns Promise<boolean>

getAnonyInfo

  • getAnonyInfo(): Promise<Omit<Anonymous, "flag">>

getAtAllRemainder

  • getAtAllRemainder(): Promise<number>
  • 获取 @全体成员 的剩余次数

    Returns Promise<number>

getAvatarUrl

  • getAvatarUrl(size?: 0 | 100 | 40 | 140, history?: number): string
  • 获取群头像url (history=1,2,3...)

    Parameters

    • size: 0 | 100 | 40 | 140 = 0
    • history: number = 0

    Returns string

getChatHistory

  • getChatHistory(seq?: number, cnt?: number): Promise<GroupMessage[]>
  • 获取seq之前的cnt条聊天记录,默认从最后一条发言往前,cnt默认20不能超过20

    Parameters

    • seq: number = 0
    • cnt: number = 20

    Returns Promise<GroupMessage[]>

getFileUrl

  • getFileUrl(fid: string): Promise<string>
  • 获取群文件下载地址

    Parameters

    • fid: string

    Returns Promise<string>

getForwardMsg

  • getForwardMsg(resid: string, fileName?: string): Promise<ForwardMessage[]>

getMemberMap

  • getMemberMap(no_cache?: boolean): Promise<Map<number, MemberInfo>>

getVideoUrl

  • getVideoUrl(fid: string, md5: string | Buffer): Promise<string>

invite

  • invite(uid: number): Promise<boolean>
  • 邀请好友入群

    Parameters

    • uid: number

    Returns Promise<boolean>

kickMember

  • kickMember(uid: number, block?: boolean): Promise<boolean>
  • Parameters

    • uid: number
    • block: boolean = false

    Returns Promise<boolean>

makeForwardMsg

    1. 制作一条合并转发消息以备发送(制作一次可以到处发)。
    2. 需要注意的是,好友图片和群图片的内部格式不一样, 对着群制作的转发消息中的图片,发给好友可能会裂图,反过来也一样。
    3. 暂不完全支持套娃转发。

    Parameters

    Returns Promise<XmlElem>

markRead

  • markRead(seq?: number): Promise<void>
  • 标记seq之前为已读,默认到最后一条发言

    Parameters

    • seq: number = 0

    Returns Promise<void>

muteAll

  • muteAll(yes?: boolean): Promise<boolean>
  • 全员禁言

    Parameters

    • yes: boolean = true

    Returns Promise<boolean>

muteAnony

  • muteAnony(flag: string, duration?: number): Promise<void>
  • 禁言匿名玩家,默认1800秒

    Parameters

    • flag: string
    • duration: number = 1800

    Returns Promise<void>

muteMember

  • muteMember(uid: number, duration?: number): Promise<void>
  • Parameters

    • uid: number
    • duration: number = 600

    Returns Promise<void>

pickMember

  • pickMember(uid: number, strict?: boolean): Member
  • 获取一枚群员实例

    Parameters

    • uid: number
    • strict: boolean = false

    Returns Member

pokeMember

  • pokeMember(uid: number): Promise<boolean>

quit

  • quit(): Promise<boolean>

recallMsg

  • recallMsg(msg: GroupMessage): Promise<boolean>
  • recallMsg(msgid: string): Promise<boolean>
  • recallMsg(seq: number, rand: number, pktnum?: number): Promise<boolean>
  • recallMsg(param: string | number | GroupMessage, rand?: number, pktnum?: number): Promise<boolean>

renew

sendMsg

setAdmin

  • setAdmin(uid: number, yes?: boolean): Promise<boolean>
  • Parameters

    • uid: number
    • yes: boolean = true

    Returns Promise<boolean>

setAvatar

  • setAvatar(file: string | Buffer | Readable): Promise<void>
  • 设置群头像

    Parameters

    • file: string | Buffer | Readable

    Returns Promise<void>

setCard

  • setCard(uid: number, card?: string): Promise<boolean>
  • Parameters

    • uid: number
    • card: string = ""

    Returns Promise<boolean>

setName

  • setName(name: string): Promise<boolean>
  • 设置群名

    Parameters

    • name: string

    Returns Promise<boolean>

setRemark

  • setRemark(remark?: string): Promise<void>
  • 设置备注

    Parameters

    • remark: string = ""

    Returns Promise<void>

setTitle

  • setTitle(uid: number, title?: string, duration?: number): Promise<boolean>
  • Parameters

    • uid: number
    • title: string = ""
    • duration: number = -1

    Returns Promise<boolean>

shareMusic

uploadImages

  • uploadImages(imgs: Image[] | ImageElem[]): Promise<PromiseRejectedResult[]>

uploadPtt

uploadVideo

Static as

  • as(gid: number, strict: boolean): Group

Generated using TypeDoc