Skip to content

Commit

Permalink
fix @jvmoverloads error and cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
RTAkland committed Dec 6, 2024
1 parent d0f5742 commit f811b37
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

package cn.rtast.rob.enums

import cn.rtast.rob.enums.AIRecordCharacter.entries


/**
* 定义几个常用的AI音色枚举类
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

package cn.rtast.rob.enums

import cn.rtast.rob.enums.BusinessName.entries


enum class BusinessName(val type: Int, val description: String) {
BigVIP(113, "QQ大会员"), VIP(1, "QQ会员"), YellowDiamond(102, "黄钻"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,6 @@ class OneBotAction internal constructor(
/**
* 设置成群员的群昵称
*/
@JvmOverloads
suspend fun setGroupMemberCard(groupId: Long, userId: Long, card: String = "") {
this.send(SetGroupMemberCardOut(params = SetGroupMemberCardOut.Params(groupId, userId, card)))
}
Expand All @@ -453,23 +452,20 @@ class OneBotAction internal constructor(
/**
* 退出群聊,如果是群主并且dismiss为true则解散群聊
*/
@JvmOverloads
suspend fun setGroupLeaveOrDismiss(groupId: Long, dismiss: Boolean = false) {
this.send(SetGroupLeaveOut(params = SetGroupLeaveOut.Params(groupId, dismiss)))
}

/**
* 处理加好友请求
*/
@JvmOverloads
suspend fun setFriendRequest(flag: String, approve: Boolean = true, remark: String = "") {
this.send(SetFriendRequestOut(params = SetFriendRequestOut.Params(flag, approve, remark)))
}

/**
* 处理加群请求
*/
@JvmOverloads
suspend fun setGroupRequest(
flag: String,
type: String,
Expand Down Expand Up @@ -504,7 +500,6 @@ class OneBotAction internal constructor(
/**
* 获取陌生人信息
*/
@JvmOverloads
suspend fun getStrangerInfo(userId: Long, noCache: Boolean = false): StrangerInfo.StrangerInfo {
val uuid = UUID.randomUUID()
val deferred = this.createCompletableDeferred(uuid)
Expand All @@ -527,7 +522,6 @@ class OneBotAction internal constructor(
/**
* 获取群组信息
*/
@JvmOverloads
suspend fun getGroupInfo(groupId: Long, noCache: Boolean = false): GroupInfo.GroupInfo {
val uuid = UUID.randomUUID()
val deferred = this.createCompletableDeferred(uuid)
Expand All @@ -550,7 +544,6 @@ class OneBotAction internal constructor(
/**
* 获取群组成员信息
*/
@JvmOverloads
suspend fun getGroupMemberInfo(groupId: Long, userId: Long, noCache: Boolean = false): GroupMemberList.MemberInfo {
val uuid = UUID.randomUUID()
val deferred = this.createCompletableDeferred(uuid)
Expand Down Expand Up @@ -700,7 +693,6 @@ class OneBotAction internal constructor(
* `folder` -> 群内的目录
* ***注意: 文件路径是OneBot实现的本地路径***
*/
@JvmOverloads
suspend fun uploadGroupFile(groupId: Long, file: String, name: String, folder: String = "/") {
this.send(UploadGroupFileOut(params = UploadGroupFileOut.Params(groupId, file, name, folder)))
}
Expand Down Expand Up @@ -756,7 +748,6 @@ class OneBotAction internal constructor(
* 该方法是Lagrange.OneBot的拓展API
* 用于设置群组成员专属头衔
*/
@JvmOverloads
suspend fun setGroupMemberSpecialTitle(groupId: Long, userId: Long, title: String = "", duration: Int = -1) {
this.send(SetGroupMemberTitleOut(params = SetGroupMemberTitleOut.Params(groupId, userId, title, duration)))
}
Expand All @@ -766,7 +757,6 @@ class OneBotAction internal constructor(
* 该方法被Lagrange标记为`隐藏API`
* 并且为异步发送API不会有返回值
*/
@JvmOverloads
suspend fun releaseGroupNoticeAsync(groupId: Long, content: String, image: String = "") {
this.send(
ReleaseGroupNoticeOut(
Expand All @@ -783,7 +773,6 @@ class OneBotAction internal constructor(
* 如果传入会导致发送失败, 截至: 24/10/01: 15:11
* 返回一个String类型的公告ID
*/
@JvmOverloads
suspend fun releaseGroupNotice(groupId: Long, content: String, image: String = ""): String {
val uuid = UUID.randomUUID()
val deferred = this.createCompletableDeferred(uuid)
Expand Down Expand Up @@ -827,7 +816,6 @@ class OneBotAction internal constructor(
* 需要提供message_id, isAdd参数如果为false则表示
* 取消对这条消息的reaction
*/
@JvmOverloads
suspend fun reaction(groupId: Long, messageId: Long, code: String, isAdd: Boolean = true) {
this.send(ReactionOut(params = ReactionOut.Params(groupId, messageId, code, isAdd)))
}
Expand All @@ -838,7 +826,6 @@ class OneBotAction internal constructor(
* 需要提供message_id, isAdd参数如果为false则表示
* 取消对这条消息的reaction
*/
@JvmOverloads
suspend fun reaction(groupId: Long, messageId: Long, code: QQFace, isAdd: Boolean = true) {
this.send(ReactionOut(params = ReactionOut.Params(groupId, messageId, code.id.toString(), isAdd)))
}
Expand Down Expand Up @@ -908,7 +895,6 @@ class OneBotAction internal constructor(
* 用于获取群聊中某个消息ID之前的历史聊天记录
* 默认只获取20条聊天记录
*/
@JvmOverloads
suspend fun getGroupMessageHistory(
groupId: Long,
messageId: Long,
Expand Down Expand Up @@ -938,7 +924,6 @@ class OneBotAction internal constructor(
* 用于获取私聊中某个消息ID之前的历史聊天记录
* 默认只获取20条聊天记录
*/
@JvmOverloads
suspend fun getPrivateMessageHistory(
userId: Long,
messageId: Long,
Expand Down Expand Up @@ -1033,7 +1018,6 @@ class OneBotAction internal constructor(
* 如果传入base64不能附带base64图片前缀
* 例如`data:image/png;base64`
*/
@JvmOverloads
suspend fun uploadImage(image: String, base64: Boolean = false): String {
val uuid = UUID.randomUUID()
val deferred = this.createCompletableDeferred(uuid)
Expand All @@ -1048,7 +1032,6 @@ class OneBotAction internal constructor(
* 用于设置机器人的头像, 如果传入的是base64则
* 不能有base64前缀
*/
@JvmOverloads
suspend fun setBotAvatar(image: String, base64: Boolean = false): Boolean {
val uuid = UUID.randomUUID()
val deferred = this.createCompletableDeferred(uuid)
Expand Down Expand Up @@ -1087,7 +1070,6 @@ class OneBotAction internal constructor(
* 该方法是Go-CQHTTP的API
* 用于OCR一个图片获取文字所在的坐标位置
*/
@JvmOverloads
suspend fun ocrImage(image: String, base64: Boolean = false): OCRImage.ORCResult? {
val uuid = UUID.randomUUID()
val deferred = this.createCompletableDeferred(uuid)
Expand Down Expand Up @@ -1144,7 +1126,6 @@ class OneBotAction internal constructor(
* 该方法是Go-CQHTTP的API
* 用于删除好友操作
*/
@JvmOverloads
suspend fun deleteFriend(userId: Long, block: Boolean = true) {
this.send(DeleteFriendOut(DeleteFriendOut.Params(userId, block)))
}
Expand All @@ -1167,7 +1148,6 @@ class OneBotAction internal constructor(
* 该方法是Go-CQHTTP的API
* 用于创建群文件中的文件夹
*/
@JvmOverloads
suspend fun createGroupFileFolder(groupId: Long, name: String, parentId: String = "/") {
this.send(CreateGroupFileFolderOut(CreateGroupFileFolderOut.Params(groupId, name, parentId)))
}
Expand Down Expand Up @@ -1197,7 +1177,6 @@ class OneBotAction internal constructor(
* 用于获取AI声聊的语音类型
* [chatType]只能传1u
*/
@JvmOverloads
suspend fun getAIRecordCharacters(groupId: Long, chatType: UInt = 1u): AIRecordCharacters {
val uuid = UUID.randomUUID()
val deferred = this.createCompletableDeferred(uuid)
Expand All @@ -1213,7 +1192,6 @@ class OneBotAction internal constructor(
* [chatType]只能传1u
* 如果生成失败则返回null
*/
@JvmOverloads
suspend fun getAIRecord(groupId: Long, character: String, text: String, chatType: UInt = 1u): String? {
val uuid = UUID.randomUUID()
val deferred = this.createCompletableDeferred(uuid)
Expand All @@ -1233,7 +1211,6 @@ class OneBotAction internal constructor(
* 用于生成指定音色的AI声音
* 但是使用了已知的[character] ([AIRecordCharacter])枚举类来发送
*/
@JvmOverloads
suspend fun getAIRecord(groupId: Long, character: AIRecordCharacter, text: String, chatType: UInt = 1u): String? {
return this.getAIRecord(groupId, character.characterId, text, chatType)
}
Expand All @@ -1244,7 +1221,6 @@ class OneBotAction internal constructor(
* [character]是[getAIRecordCharacters]返回的[AIRecordCharacters.Character.characterId]
* [chatType]只能传1u
*/
@JvmOverloads
suspend fun sendGroupAIRecord(groupId: Long, character: String, text: String, chatType: UInt = 1u) {
this.send(
GetAIRecordAndSendRecordOut(
Expand All @@ -1260,7 +1236,6 @@ class OneBotAction internal constructor(
* 用于生成指定音色的AI声音
* 但是使用了已知的[character] ([AIRecordCharacter])枚举类来发送
*/
@JvmOverloads
suspend fun sendGroupAIRecord(groupId: Long, character: AIRecordCharacter, text: String, chatType: UInt = 1u) {
this.sendGroupAIRecord(groupId, character.characterId, text, chatType)
}
Expand Down Expand Up @@ -1300,7 +1275,6 @@ class OneBotAction internal constructor(
* 该方法是NapCatAPI
* 用于签名一个小程序卡片
*/
@JvmOverloads
suspend fun getMiniAppArk(
type: MiniAppArkType,
title: String,
Expand Down

0 comments on commit f811b37

Please sign in to comment.