chore: bump rob
This commit is contained in:
118 files changed
+208
-303
No files matched your search
@@ -21,7 +21,6 @@ import cn.rtast.rob.entity.GroupMessage
|
||||
import cn.rtast.rob.util.BaseCommand
|
||||
import cn.rtast.rob.util.ob.MessageChain
|
||||
import cn.rtast.rob.util.ob.NodeMessageChain
|
||||
import cn.rtast.rob.util.ob.OneBotListener
|
||||
|
||||
@CommandDescription("问AI(GPT)")
|
||||
class AICommand : BaseCommand() {
|
||||
@@ -29,7 +28,7 @@ class AICommand : BaseCommand() {
|
||||
|
||||
private val openAIModel = configManager.openAIModel
|
||||
|
||||
override suspend fun executeGroup(listener: OneBotListener, message: GroupMessage, args: List<String>) {
|
||||
override suspend fun executeGroup(message: GroupMessage, args: List<String>) {
|
||||
if (args.isEmpty()) {
|
||||
val msg = MessageChain.Builder()
|
||||
.addText("发送`/ai [模型] <问题>`即可询问AI哦~")
|
||||
@@ -81,7 +80,7 @@ class LlamaCommand : BaseCommand() {
|
||||
private val llamaURL = configManager.llamaUrl
|
||||
private val llamaModel = configManager.llamaModel
|
||||
|
||||
override suspend fun executeGroup(listener: OneBotListener, message: GroupMessage, args: List<String>) {
|
||||
override suspend fun executeGroup(message: GroupMessage, args: List<String>) {
|
||||
if (args.isEmpty()) {
|
||||
message.reply("发送`/llama <问题>`即可使用llama模型来回复")
|
||||
return
|
||||
|
||||
@@ -16,7 +16,6 @@ import cn.rtast.rob.entity.GroupMessage
|
||||
import cn.rtast.rob.util.BaseCommand
|
||||
import cn.rtast.rob.util.ob.MessageChain
|
||||
import cn.rtast.rob.util.ob.NodeMessageChain
|
||||
import cn.rtast.rob.util.ob.OneBotListener
|
||||
import okhttp3.OkHttpClient
|
||||
import okhttp3.Request
|
||||
|
||||
@@ -37,7 +36,7 @@ class AnimeSearchCommand : BaseCommand() {
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun executeGroup(listener: OneBotListener, message: GroupMessage, args: List<String>) {
|
||||
override suspend fun executeGroup(message: GroupMessage, args: List<String>) {
|
||||
if (args.isEmpty()) {
|
||||
message.reply("发送`/dm <关键词>`即可搜索番剧啦~")
|
||||
return
|
||||
|
||||
@@ -16,7 +16,6 @@ import cn.rtast.rob.entity.GroupMessage
|
||||
import cn.rtast.rob.util.BaseCommand
|
||||
import cn.rtast.rob.util.ob.MessageChain
|
||||
import cn.rtast.rob.util.ob.NodeMessageChain
|
||||
import cn.rtast.rob.util.ob.OneBotListener
|
||||
import java.net.URI
|
||||
|
||||
@CommandDescription("查询香烟价格")
|
||||
@@ -25,7 +24,7 @@ class CigaretteCommand : BaseCommand() {
|
||||
|
||||
private val apiUrl = "https://www.yanyue.cn/api/rc/product/yanlist"
|
||||
|
||||
override suspend fun executeGroup(listener: OneBotListener, message: GroupMessage, args: List<String>) {
|
||||
override suspend fun executeGroup(message: GroupMessage, args: List<String>) {
|
||||
if (args.isEmpty()) {
|
||||
val msg = MessageChain.Builder()
|
||||
.addText("发送/tobacco <名称> [数量] 来搜索结果哦~")
|
||||
|
||||
@@ -17,7 +17,6 @@ import cn.rtast.fancybot.util.str.toJson
|
||||
import cn.rtast.rob.entity.GroupMessage
|
||||
import cn.rtast.rob.util.BaseCommand
|
||||
import cn.rtast.rob.util.ob.MessageChain
|
||||
import cn.rtast.rob.util.ob.OneBotListener
|
||||
import java.awt.Color
|
||||
import java.awt.Font
|
||||
import java.awt.image.BufferedImage
|
||||
@@ -61,7 +60,7 @@ class DomainPriceCommand : BaseCommand() {
|
||||
domain: String,
|
||||
available: Boolean,
|
||||
premium: Boolean,
|
||||
domainPrice: Pair<Int, Int>
|
||||
domainPrice: Pair<Int, Int>,
|
||||
): String {
|
||||
val canvas = this.createCommonCanvas()
|
||||
val g2d = canvas.createGraphics()
|
||||
@@ -77,7 +76,7 @@ class DomainPriceCommand : BaseCommand() {
|
||||
}
|
||||
|
||||
|
||||
override suspend fun executeGroup(listener: OneBotListener, message: GroupMessage, args: List<String>) {
|
||||
override suspend fun executeGroup(message: GroupMessage, args: List<String>) {
|
||||
if (args.isEmpty()) {
|
||||
val msg = MessageChain.Builder()
|
||||
.addText("发送`/domain <域名>`即可查询对应的注册和续费价格~")
|
||||
|
||||
@@ -16,7 +16,6 @@ import cn.rtast.fancybot.util.str.fromArrayJson
|
||||
import cn.rtast.rob.entity.GroupMessage
|
||||
import cn.rtast.rob.util.BaseCommand
|
||||
import cn.rtast.rob.util.ob.MessageChain
|
||||
import cn.rtast.rob.util.ob.OneBotListener
|
||||
|
||||
@CommandDescription("查询Github上的仓库的最新一次的提交信息")
|
||||
class GithubLatestCommitCommand : BaseCommand() {
|
||||
@@ -24,7 +23,7 @@ class GithubLatestCommitCommand : BaseCommand() {
|
||||
|
||||
private val userInfoUrl = "https://api.github.com/repos"
|
||||
|
||||
override suspend fun executeGroup(listener: OneBotListener, message: GroupMessage, args: List<String>) {
|
||||
override suspend fun executeGroup(message: GroupMessage, args: List<String>) {
|
||||
if (args.isEmpty()) {
|
||||
message.reply("发送`.commit <用户名/仓库名>`即可查询仓库最新一次的提交信息")
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ import cn.rtast.fancybot.util.str.encodeToBase64
|
||||
import cn.rtast.rob.entity.GroupMessage
|
||||
import cn.rtast.rob.util.BaseCommand
|
||||
import cn.rtast.rob.util.ob.MessageChain
|
||||
import cn.rtast.rob.util.ob.OneBotListener
|
||||
import java.awt.Color
|
||||
import java.awt.Font
|
||||
import java.awt.image.BufferedImage
|
||||
@@ -67,7 +66,7 @@ class GithubUserCommand : BaseCommand() {
|
||||
return canvas.toByteArray().encodeToBase64()
|
||||
}
|
||||
|
||||
override suspend fun executeGroup(listener: OneBotListener, message: GroupMessage, args: List<String>) {
|
||||
override suspend fun executeGroup(message: GroupMessage, args: List<String>) {
|
||||
if (args.isEmpty()) {
|
||||
val msg = MessageChain.Builder().addText("发送`gh <用户名>`即可查询用户的信息~").build()
|
||||
message.reply(msg)
|
||||
|
||||
@@ -14,7 +14,6 @@ import cn.rtast.fancybot.util.str.getMD5
|
||||
import cn.rtast.rob.entity.GroupMessage
|
||||
import cn.rtast.rob.util.BaseCommand
|
||||
import cn.rtast.rob.util.ob.MessageChain
|
||||
import cn.rtast.rob.util.ob.OneBotListener
|
||||
|
||||
@CommandDescription("查询用户的Gravatar头像")
|
||||
class GravatarCommand : BaseCommand() {
|
||||
@@ -24,7 +23,7 @@ class GravatarCommand : BaseCommand() {
|
||||
private const val GRAVATAR_URL = "https://gravatar.rtast.cn/avatar"
|
||||
}
|
||||
|
||||
override suspend fun executeGroup(listener: OneBotListener, message: GroupMessage, args: List<String>) {
|
||||
override suspend fun executeGroup(message: GroupMessage, args: List<String>) {
|
||||
val emailMD5 = if (args.first().trim().lowercase().contains("@")) args.first().trim().lowercase().getMD5()
|
||||
else args.first().trim().lowercase()
|
||||
val avatarImage = "$GRAVATAR_URL/$emailMD5?size=256".toURL().readBytes().encodeToBase64()
|
||||
|
||||
@@ -14,7 +14,6 @@ import cn.rtast.fancybot.util.Http
|
||||
import cn.rtast.rob.entity.GroupMessage
|
||||
import cn.rtast.rob.util.BaseCommand
|
||||
import cn.rtast.rob.util.ob.MessageChain
|
||||
import cn.rtast.rob.util.ob.OneBotListener
|
||||
|
||||
@CommandDescription("解释一个成语")
|
||||
class IdiomExplainCommand : BaseCommand() {
|
||||
@@ -22,7 +21,7 @@ class IdiomExplainCommand : BaseCommand() {
|
||||
|
||||
private val apiSpaceUrl = "https://eolink.o.apispace.com/cyudac/api/v1/idioms/SearchIdiomsByPinyin/search"
|
||||
|
||||
override suspend fun executeGroup(listener: OneBotListener, message: GroupMessage, args: List<String>) {
|
||||
override suspend fun executeGroup(message: GroupMessage, args: List<String>) {
|
||||
if (args.isEmpty()) {
|
||||
message.reply("发送`成语解释 <成语>`就能解释这个成语的意思了")
|
||||
return
|
||||
|
||||
@@ -18,7 +18,6 @@ import cn.rtast.rob.entity.GroupMessage
|
||||
import cn.rtast.rob.enums.MusicShareType
|
||||
import cn.rtast.rob.util.BaseCommand
|
||||
import cn.rtast.rob.util.ob.MessageChain
|
||||
import cn.rtast.rob.util.ob.OneBotListener
|
||||
import java.time.Instant
|
||||
|
||||
@CommandDescription("网易云音乐点歌")
|
||||
@@ -38,7 +37,7 @@ class MusicCommand : BaseCommand() {
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun legacyMusicCommand(listener: OneBotListener, message: GroupMessage, args: List<String>) {
|
||||
private suspend fun legacyMusicCommand(message: GroupMessage, args: List<String>) {
|
||||
if (args.isEmpty()) {
|
||||
message.reply("发送`/点歌` <关键词> 来搜索音乐~")
|
||||
return
|
||||
@@ -93,9 +92,9 @@ class MusicCommand : BaseCommand() {
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun executeGroup(listener: OneBotListener, message: GroupMessage, args: List<String>) {
|
||||
override suspend fun executeGroup(message: GroupMessage, args: List<String>) {
|
||||
if (args.last() == "legacy" || args.last() == "l" || args.last() in "0".."4") {
|
||||
this.legacyMusicCommand(listener, message, args)
|
||||
this.legacyMusicCommand(message, args)
|
||||
return
|
||||
}
|
||||
if (args.isEmpty()) {
|
||||
@@ -128,7 +127,7 @@ class MusicPlayUrlCommand : BaseCommand() {
|
||||
return Http.get<SongUrl>("$musicApiUrl/song/url", mapOf("id" to id)).data.first().url
|
||||
}
|
||||
|
||||
override suspend fun executeGroup(listener: OneBotListener, message: GroupMessage, args: List<String>) {
|
||||
override suspend fun executeGroup(message: GroupMessage, args: List<String>) {
|
||||
val url = if (args.last() == "id" || args.last() == "i") {
|
||||
val id = args.first()
|
||||
this.getPlayUrl(id)
|
||||
@@ -151,7 +150,7 @@ class QQMusicCommand : BaseCommand() {
|
||||
|
||||
private val qqMusicApiUrl = configManager.qqMusicApiUrl
|
||||
|
||||
override suspend fun executeGroup(listener: OneBotListener, message: GroupMessage, args: List<String>) {
|
||||
override suspend fun executeGroup(message: GroupMessage, args: List<String>) {
|
||||
if (args.isEmpty()) {
|
||||
message.reply("发送`/qm <关键词>`即可搜索qq音乐的音乐哦")
|
||||
return
|
||||
|
||||
@@ -14,7 +14,6 @@ import cn.rtast.fancybot.util.Http
|
||||
import cn.rtast.rob.entity.GroupMessage
|
||||
import cn.rtast.rob.util.BaseCommand
|
||||
import cn.rtast.rob.util.ob.MessageChain
|
||||
import cn.rtast.rob.util.ob.OneBotListener
|
||||
import cn.rtast.rob.util.ob.asNode
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.withContext
|
||||
@@ -52,7 +51,7 @@ class NslookupCommand : BaseCommand() {
|
||||
|
||||
private fun geo(ip: String) = Http.get<IPGeo>(IP_INFO_API.replace("###", ip))
|
||||
|
||||
override suspend fun executeGroup(listener: OneBotListener, message: GroupMessage, args: List<String>) {
|
||||
override suspend fun executeGroup(message: GroupMessage, args: List<String>) {
|
||||
val host = args.first()
|
||||
val nsType = if (args.size == 3) args[1] else "common"
|
||||
val srvType = if (args.size == 3) args.last() else "mc"
|
||||
|
||||
@@ -16,7 +16,6 @@ import cn.rtast.rob.entity.GroupMessage
|
||||
import cn.rtast.rob.util.BaseCommand
|
||||
import cn.rtast.rob.util.ob.MessageChain
|
||||
import cn.rtast.rob.util.ob.NodeMessageChain
|
||||
import cn.rtast.rob.util.ob.OneBotListener
|
||||
import java.net.URI
|
||||
|
||||
@CommandDescription("获取Pixiv上的图片")
|
||||
@@ -26,7 +25,7 @@ class PixivCommand : BaseCommand() {
|
||||
private val pixivRankingURL = "https://proxy.rtast.cn/https/www.pixiv.net/ranking.php?format=json&mode=daily&p=1"
|
||||
private val imageProxyURL = "https://pixiv.re"
|
||||
|
||||
override suspend fun executeGroup(listener: OneBotListener, message: GroupMessage, args: List<String>) {
|
||||
override suspend fun executeGroup(message: GroupMessage, args: List<String>) {
|
||||
if (args.isEmpty()) {
|
||||
val msg = MessageChain.Builder()
|
||||
.addText("发送`/pixiv <id> | rank` 来进行操作哦~")
|
||||
|
||||
@@ -13,7 +13,6 @@ import cn.rtast.rob.enums.ArrayMessageType
|
||||
import cn.rtast.rob.util.BaseCommand
|
||||
import cn.rtast.rob.util.ob.MessageChain
|
||||
import cn.rtast.rob.util.ob.NodeMessageChain
|
||||
import cn.rtast.rob.util.ob.OneBotListener
|
||||
|
||||
|
||||
private fun generateNodeMessage(targetId: String, times: Int = 10): NodeMessageChain {
|
||||
@@ -29,7 +28,7 @@ private fun generateNodeMessage(targetId: String, times: Int = 10): NodeMessageC
|
||||
class ShotSelfCommand : BaseCommand() {
|
||||
override val commandNames = listOf("骂我")
|
||||
|
||||
override suspend fun executeGroup(listener: OneBotListener, message: GroupMessage, args: List<String>) {
|
||||
override suspend fun executeGroup(message: GroupMessage, args: List<String>) {
|
||||
message.action.sendGroupForwardMsg(message.groupId, generateNodeMessage(message.sender.userId.toString()))
|
||||
}
|
||||
}
|
||||
@@ -38,7 +37,7 @@ class ShotSelfCommand : BaseCommand() {
|
||||
class ShotOtherCommand : BaseCommand() {
|
||||
override val commandNames = listOf("骂")
|
||||
|
||||
override suspend fun executeGroup(listener: OneBotListener, message: GroupMessage, args: List<String>) {
|
||||
override suspend fun executeGroup(message: GroupMessage, args: List<String>) {
|
||||
if (args.isEmpty()) {
|
||||
message.action.sendGroupForwardMsg(
|
||||
message.groupId, generateNodeMessage(message.sender.userId.toString(), 20)
|
||||
|
||||
@@ -17,7 +17,6 @@ import cn.rtast.fancybot.util.str.proxy
|
||||
import cn.rtast.rob.entity.GroupMessage
|
||||
import cn.rtast.rob.util.BaseCommand
|
||||
import cn.rtast.rob.util.ob.MessageChain
|
||||
import cn.rtast.rob.util.ob.OneBotListener
|
||||
|
||||
@CommandDescription("随机猫猫图")
|
||||
class TheCatCommand : BaseCommand() {
|
||||
@@ -25,7 +24,7 @@ class TheCatCommand : BaseCommand() {
|
||||
|
||||
private val theCatApiUrl = "https://api.thecatapi.com/v1/images/search"
|
||||
|
||||
override suspend fun executeGroup(listener: OneBotListener, message: GroupMessage, args: List<String>) {
|
||||
override suspend fun executeGroup(message: GroupMessage, args: List<String>) {
|
||||
val imageBase64 = Http.get(theCatApiUrl)
|
||||
.fromArrayJson<List<Cat>>().first().url
|
||||
.proxy.toURL().readBytes().encodeToBase64()
|
||||
|
||||
@@ -14,7 +14,6 @@ import cn.rtast.fancybot.util.Http
|
||||
import cn.rtast.rob.entity.GroupMessage
|
||||
import cn.rtast.rob.util.BaseCommand
|
||||
import cn.rtast.rob.util.ob.MessageChain
|
||||
import cn.rtast.rob.util.ob.OneBotListener
|
||||
import cn.rtast.rob.util.ob.asNode
|
||||
import java.time.LocalDateTime
|
||||
import java.time.ZoneId
|
||||
@@ -27,7 +26,7 @@ class TheHistoryOfTodayCommand : BaseCommand() {
|
||||
private val tianXingApiUrl = "https://apis.tianapi.com/lishi/index"
|
||||
private val tianXingApiKey = configManager.tianXingApiKey
|
||||
|
||||
override suspend fun executeGroup(listener: OneBotListener, message: GroupMessage, args: List<String>) {
|
||||
override suspend fun executeGroup(message: GroupMessage, args: List<String>) {
|
||||
val currentDateTime = LocalDateTime.now(ZoneId.of("Asia/Shanghai"))
|
||||
val formatter = DateTimeFormatter.ofPattern("MMdd")
|
||||
val currentDate = currentDateTime.format(formatter)
|
||||
|
||||
@@ -21,7 +21,6 @@ import cn.rtast.fancybot.util.str.encodeToBase64
|
||||
import cn.rtast.rob.entity.GroupMessage
|
||||
import cn.rtast.rob.util.BaseCommand
|
||||
import cn.rtast.rob.util.ob.MessageChain
|
||||
import cn.rtast.rob.util.ob.OneBotListener
|
||||
import java.awt.Color
|
||||
import java.awt.Font
|
||||
import java.awt.image.BufferedImage
|
||||
@@ -58,7 +57,7 @@ class WeatherCommand : BaseCommand() {
|
||||
return emptyImage.toByteArray().encodeToBase64()
|
||||
}
|
||||
|
||||
override suspend fun executeGroup(listener: OneBotListener, message: GroupMessage, args: List<String>) {
|
||||
override suspend fun executeGroup(message: GroupMessage, args: List<String>) {
|
||||
if (args.isEmpty()) {
|
||||
val msg = MessageChain.Builder()
|
||||
.addAt(message.sender.userId)
|
||||
|
||||
@@ -16,7 +16,6 @@ import cn.rtast.fancybot.util.file.insertActionRecord
|
||||
import cn.rtast.rob.entity.GroupMessage
|
||||
import cn.rtast.rob.util.BaseCommand
|
||||
import cn.rtast.rob.util.ob.MessageChain
|
||||
import cn.rtast.rob.util.ob.OneBotListener
|
||||
import org.jsoup.Jsoup
|
||||
|
||||
@CommandDescription("查询wiki百科")
|
||||
@@ -32,7 +31,7 @@ class WikipediaCommand : BaseCommand() {
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun executeGroup(listener: OneBotListener, message: GroupMessage, args: List<String>) {
|
||||
override suspend fun executeGroup(message: GroupMessage, args: List<String>) {
|
||||
if (args.isEmpty()) {
|
||||
val msg = MessageChain.Builder()
|
||||
.addText("发送`/wiki <关键字>`即可查询出最匹配的wiki页面~")
|
||||
|
||||
Reference in New Issue
Block a user