Package-level declarations

Types

Link copied to clipboard

Acidify Bot 实例

Functions

Link copied to clipboard
suspend fun Bot.createGroupFolder(groupUin: Long, folderName: String): String

创建群文件夹

Link copied to clipboard
suspend fun Bot.deleteFriend(friendUin: Long, block: Boolean = false)

删除好友

Link copied to clipboard
suspend fun Bot.deleteGroupAnnouncement(groupUin: Long, announcementId: String)

删除群公告

Link copied to clipboard
suspend fun Bot.deleteGroupFile(groupUin: Long, fileId: String)

删除群文件

Link copied to clipboard
suspend fun Bot.deleteGroupFolder(groupUin: Long, folderId: String)

删除群文件夹

Link copied to clipboard

拉取好友与好友分组信息。此操作不会被缓存。

Link copied to clipboard

拉取指定群的成员信息。此操作不会被缓存。

Link copied to clipboard

拉取群信息。此操作不会被缓存。

Link copied to clipboard

通过 uid 获取用户信息。

Link copied to clipboard

通过 QQ 号获取用户信息。

Link copied to clipboard
suspend fun Bot.getCookies(domain: String): Map<String, String>

获取指定域名的 Cookie 键值对。

Link copied to clipboard
suspend fun Bot.getCsrfToken(): Int

获取 CSRF Token。

Link copied to clipboard

获取收藏表情的直链 URL 列表

Link copied to clipboard
suspend fun Bot.getDownloadUrl(resourceId: String): String

获取给定资源 ID 的下载链接,支持图片、语音、视频。

Link copied to clipboard

获取合并转发消息内容

Link copied to clipboard
suspend fun Bot.getFriend(uin: Long, forceUpdate: Boolean = false): BotFriend?

根据 uin 获取好友实体。

Link copied to clipboard
suspend fun Bot.getFriendHistoryMessages(friendUin: Long, limit: Int, startSequence: Long? = null): BotHistoryMessages

向上获取与好友的历史消息

Link copied to clipboard
suspend fun Bot.getFriendRequests(isFiltered: Boolean = false, limit: Int = 20): List<BotFriendRequest>

获取好友请求列表

Link copied to clipboard
suspend fun Bot.getFriends(forceUpdate: Boolean = false): List<BotFriend>

获取所有好友实体。

Link copied to clipboard
suspend fun Bot.getGroup(uin: Long, forceUpdate: Boolean = false): BotGroup?

根据 uin 获取群实体。

Link copied to clipboard

获取群公告列表

Link copied to clipboard
suspend fun Bot.getGroupEssenceMessages(groupUin: Long, pageIndex: Int, pageSize: Int): BotEssenceMessageResult

获取群精华消息列表

Link copied to clipboard
suspend fun Bot.getGroupFileDownloadUrl(groupUin: Long, fileId: String): String

获取群文件下载链接

Link copied to clipboard
suspend fun Bot.getGroupFileList(groupUin: Long, targetDirectory: String = "/", startIndex: Int = 0): BotGroupFileSystemList

获取群文件/文件夹列表

Link copied to clipboard
suspend fun Bot.getGroupHistoryMessages(groupUin: Long, limit: Int, startSequence: Long? = null): BotHistoryMessages

向上获取群聊的历史消息

Link copied to clipboard
suspend fun Bot.getGroupMember(groupUin: Long, memberUin: Long, forceUpdate: Boolean = false): BotGroupMember?

根据 uin 获取指定群的群成员实体。

Link copied to clipboard
suspend fun Bot.getGroupMembers(groupUin: Long, forceUpdate: Boolean = false): List<BotGroupMember>?

获取指定群的所有群成员实体。

Link copied to clipboard
suspend fun Bot.getGroupNotifications(startSequence: Long? = null, isFiltered: Boolean = false, count: Int = 20): Pair<List<BotGroupNotification>, Long?>

获取群通知列表

Link copied to clipboard
suspend fun Bot.getGroups(forceUpdate: Boolean = false): List<BotGroup>

获取所有群实体。

Link copied to clipboard
suspend fun Bot.getPins(): BotPinnedChats

获取当前置顶的好友与群聊

Link copied to clipboard
suspend fun Bot.getPrivateFileDownloadUrl(friendUin: Long, fileId: String, fileHash: String): String

获取私聊文件下载链接

Link copied to clipboard
suspend fun Bot.getPSKey(domain: String): String

获取给定域名的 p_skey,用于组成 Cookie。

Link copied to clipboard
suspend fun Bot.getSKey(): String

获取 s_key,用于组成 Cookie。

Link copied to clipboard
suspend fun Bot.getUidByUin(uin: Long, mayComeFromGroupUin: Long? = null): String

解析 QQ 号到 uid,该过程可能失败,此时抛出 NoSuchElementException。 若 mayComeFromGroupUin 非空且在缓存中未找到对应 uid,会尝试从该群的成员列表中查找; 否则,会尝试从好友列表中查找。

Link copied to clipboard
suspend fun Bot.getUinByUid(uid: String): Long

解析 uid 到 QQ 号。 如果之前未解析过该 uid,会发起网络请求获取用户信息。

Link copied to clipboard
suspend fun Bot.kickGroupMember(groupUin: Long, memberUin: Long, rejectAddRequest: Boolean = false, reason: String = "")

踢出群成员

Link copied to clipboard
suspend fun Bot.login(queryInterval: Long = 3000, preloadContacts: Boolean = false)

如果 Session 为空则调用 qrCodeLogin 进行登录。 如果 Session 不为空则尝试使用现有的 Session 信息登录,若失败则调用 qrCodeLogin 重新登录。

Link copied to clipboard
suspend fun Bot.markFriendMessagesAsRead(friendUin: Long, startSequence: Long, startTime: Long)

标记好友消息为已读

Link copied to clipboard
suspend fun Bot.markGroupMessagesAsRead(groupUin: Long, startSequence: Long)

标记群消息为已读

Link copied to clipboard
suspend fun Bot.moveGroupFile(groupUin: Long, fileId: String, parentFolderId: String, targetFolderId: String)

移动群文件

Link copied to clipboard
suspend fun Bot.offline()

下线 Bot,释放资源。

Link copied to clipboard
suspend fun Bot.online(preloadContacts: Boolean = false)

尝试使用现有的 Session 信息上线。 请优先调用 login,该方法会在现有 Session 失效时自动调用 qrCodeLogin。 若确定 Session 有效且不希望进行二维码登录,可调用此方法。

Link copied to clipboard
suspend fun Bot.qrCodeLogin(queryInterval: Long = 3000, preloadContacts: Boolean = false)

发起二维码登录请求。过程中会触发事件:

Link copied to clipboard
suspend fun Bot.quitGroup(groupUin: Long)

退出群聊

Link copied to clipboard
suspend fun Bot.recallFriendMessage(friendUin: Long, sequence: Long)

撤回好友消息

Link copied to clipboard
suspend fun Bot.recallGroupMessage(groupUin: Long, sequence: Long)

撤回群消息

Link copied to clipboard
suspend fun Bot.renameGroupFile(groupUin: Long, fileId: String, parentFolderId: String, newFileName: String)

重命名群文件

Link copied to clipboard
suspend fun Bot.renameGroupFolder(groupUin: Long, folderId: String, newFolderName: String)

重命名群文件夹

Link copied to clipboard
inline suspend fun Bot.sendFriendMessage(friendUin: Long, clientSequence: Long = Random.nextLong(), random: Int = Random.nextInt(), builderAction: BotOutgoingMessageBuilder.() -> Unit): BotOutgoingMessageResult
suspend fun Bot.sendFriendMessage(friendUin: Long, clientSequence: Long = Random.nextLong(), random: Int = Random.nextInt(), segments: List<BotOutgoingSegment>): BotOutgoingMessageResult

发送好友消息

Link copied to clipboard
suspend fun Bot.sendFriendNudge(friendUin: Long, isSelf: Boolean = false)

发送好友戳一戳

Link copied to clipboard
suspend fun Bot.sendGroupAnnouncement(groupUin: Long, content: String, imageData: ByteArray? = null, showEditCard: Boolean = false, showTipWindow: Boolean = true, confirmRequired: Boolean = true, isPinned: Boolean = false): String

发送群公告

Link copied to clipboard
inline suspend fun Bot.sendGroupMessage(groupUin: Long, clientSequence: Long = Random.nextLong(), random: Int = Random.nextInt(), builderAction: BotOutgoingMessageBuilder.() -> Unit): BotOutgoingMessageResult
suspend fun Bot.sendGroupMessage(groupUin: Long, clientSequence: Long = Random.nextLong(), random: Int = Random.nextInt(), segments: List<BotOutgoingSegment>): BotOutgoingMessageResult

发送群消息

Link copied to clipboard
suspend fun Bot.sendGroupNudge(groupUin: Long, targetUin: Long)

发送群戳一戳

Link copied to clipboard
suspend fun Bot.sendProfileLike(friendUin: Long, count: Int = 1)

给好友点赞

Link copied to clipboard
suspend fun Bot.setAvatar(imageData: ByteArray)

设置账号头像

Link copied to clipboard
suspend fun Bot.setBio(bio: String)

设置账号个性签名

Link copied to clipboard
suspend fun Bot.setFriendPin(friendUin: Long, isPinned: Boolean)

设置好友置顶状态

Link copied to clipboard
suspend fun Bot.setFriendRequest(initiatorUid: String, accept: Boolean, isFiltered: Boolean = false)

处理好友请求(同意/拒绝)

Link copied to clipboard
suspend fun Bot.setGroupAvatar(groupUin: Long, imageData: ByteArray)

设置群头像

Link copied to clipboard
suspend fun Bot.setGroupEssenceMessage(groupUin: Long, sequence: Long, isSet: Boolean)

设置群精华消息

Link copied to clipboard
suspend fun Bot.setGroupInvitation(groupUin: Long, invitationSeq: Long, accept: Boolean)

处理群邀请(他人邀请自己入群)

Link copied to clipboard
suspend fun Bot.setGroupMemberAdmin(groupUin: Long, memberUin: Long, isAdmin: Boolean)

设置群管理员

Link copied to clipboard
suspend fun Bot.setGroupMemberCard(groupUin: Long, memberUin: Long, card: String)

设置群成员的群名片

Link copied to clipboard
suspend fun Bot.setGroupMemberMute(groupUin: Long, memberUin: Long, duration: Int)

设置群成员禁言

Link copied to clipboard
suspend fun Bot.setGroupMemberSpecialTitle(groupUin: Long, memberUin: Long, specialTitle: String)

设置群成员的专属头衔

Link copied to clipboard
suspend fun Bot.setGroupMessageReaction(groupUin: Long, sequence: Long, code: String, isAdd: Boolean = true)

发送群消息表情回应

Link copied to clipboard
suspend fun Bot.setGroupName(groupUin: Long, groupName: String)

设置群名称

Link copied to clipboard
suspend fun Bot.setGroupPin(groupUin: Long, isPinned: Boolean)

设置群聊置顶状态

Link copied to clipboard
suspend fun Bot.setGroupRequest(groupUin: Long, sequence: Long, eventType: Int, accept: Boolean, isFiltered: Boolean = false, reason: String = "")

处理群请求(同意/拒绝)

Link copied to clipboard
suspend fun Bot.setGroupWholeMute(groupUin: Long, isMute: Boolean)

设置群全员禁言

Link copied to clipboard
suspend fun Bot.setNickname(nickname: String)

设置账号昵称

Link copied to clipboard
suspend fun Bot.uploadGroupFile(groupUin: Long, fileName: String, fileData: ByteArray, parentFolderId: String = "/"): String

上传群文件

Link copied to clipboard
suspend fun Bot.uploadPrivateFile(friendUin: Long, fileName: String, fileData: ByteArray): String

上传私聊文件