Skip to content

Commit 729cb42

Browse files
committed
fix logger
1 parent 5d7e740 commit 729cb42

File tree

7 files changed

+11
-35
lines changed

7 files changed

+11
-35
lines changed

src/main/kotlin/GithubTask.kt

-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ class GithubTask {
4545
var timerTask: TimerTask? = null
4646

4747

48-
@OptIn(DelicateCoroutinesApi::class)
4948
suspend fun openTask() {
5049
logger.info("Github推送通知已开启")
5150
try{

src/main/kotlin/github/Branches.kt

+2
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ class Branches {
6868

6969
list[project.toString()] = tempList
7070
}
71+
72+
7173
return list
7274
}catch (e: SocketTimeoutException){
7375
logger.warning("请求超时")

src/main/kotlin/github/Commits.kt

+2-19
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class Commits {
115115
html = html.toString(),
116116
avatar = avatar.toString(),
117117
time = time.toString(),
118-
name = name.toString()+ "推送了代码",
118+
name = name.toString()+ "${projects.toString()}推送了代码",
119119
event = bot.getFriendOrGroup(e.toString().toLong())
120120
)
121121
)
@@ -130,7 +130,7 @@ class Commits {
130130
html = html.toString(),
131131
avatar = avatar.toString(),
132132
time = time.toString(),
133-
name = name.toString()+ "推送了代码",
133+
name = name.toString()+ "${projects.toString()}推送了代码",
134134
event = bot.getFriendOrGroup(u.toString().toLong())
135135
)
136136
)
@@ -150,22 +150,5 @@ class Commits {
150150
}
151151
}
152152

153-
/**
154-
* 返回卡片
155-
*/
156-
@OptIn(MiraiExperimentalApi::class)
157-
@Throws(Exception::class)
158-
fun process(
159-
message: String,
160-
html: String,
161-
avatar: String,
162-
name: String,
163-
time: String,
164-
): Message {
165-
val contact: String =
166-
"{\"app\":\"com.tencent.structmsg\",\"desc\":\"新闻\",\"view\":\"news\",\"ver\":\"0.0.0.1\",\"prompt\":\"Github更新通知\",\"appID\":\"\",\"sourceName\":\"\",\"actionData\":\"\",\"actionData_A\":\"\",\"sourceUrl\":\"\",\"meta\":{\"news\":{\"app_type\":1,\"appid\":\"100951776\",\"desc\":\"${message}\",\"jumpUrl\":\"${html}\",\"preview\":\"${avatar}\",\"tag\":\"哔哩哔哩\",\"title\":\"${name}推送了\"}},\"config\":{\"autosize\":true,\"ctime\":${Date().time},\"forward\":true,\"type\":\"normal\"},\"text\":\"\",\"extraApps\":[],\"sourceAd\":\"\",\"extra\":\"{\\\"app_type\\\":1,\\\"appid\\\":100951776,\\\"uin\\\":895018766}\"}"
167-
// return RichMessage.share(url = html, title = name + "推送了代码", content = message + "\n${time}", coverUrl = avatar)
168-
return LightApp(contact)
169-
}
170153

171154
}

src/main/kotlin/github/Issues.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class Issues {
8282
html = issueItem.htmlUrl.toString(),
8383
avatar = issueItem.user!!.avatarUrl.toString(),
8484
time = time.toString(),
85-
name = issueItem.user.login.toString()+ "提交了新问题",
85+
name = issueItem.user.login.toString()+ "${projects.toString()}提交了新问题",
8686
event = bot.getFriendOrGroup(e.toString().toLong())
8787
)
8888
)
@@ -97,7 +97,7 @@ class Issues {
9797
html = issueItem.htmlUrl.toString(),
9898
avatar = issueItem.user!!.avatarUrl.toString(),
9999
time = time.toString(),
100-
name = issueItem.user.login.toString()+ "提交了新问题",
100+
name = issueItem.user.login.toString()+ "${projects.toString()}提交了新问题",
101101
event = bot.getFriendOrGroup(u.toString().toLong())
102102
)
103103
)

src/main/kotlin/github/Pulls.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class Pulls {
8181
html = pullItem.htmlUrl.toString(),
8282
avatar = pullItem.user!!.avatarUrl.toString(),
8383
time = time.toString(),
84-
name = pullItem.user.login.toString()+ "发起了合并请求",
84+
name = pullItem.user.login.toString()+ "${projects.toString()}发起了合并请求",
8585
event = bot.getFriendOrGroup(e.toString().toLong())
8686
)
8787
)
@@ -96,7 +96,7 @@ class Pulls {
9696
html = pullItem.htmlUrl.toString(),
9797
avatar = pullItem.user!!.avatarUrl.toString(),
9898
time = time.toString(),
99-
name = pullItem.user.login.toString()+ "发起了合并请求",
99+
name = pullItem.user.login.toString()+ "${projects.toString()}发起了合并请求",
100100
event = bot.getFriendOrGroup(u.toString().toLong())
101101
)
102102
)

src/main/kotlin/github/Releases.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class Releases {
7979
html = release.htmlUrl.toString(),
8080
avatar = release.author!!.avatarUrl.toString(),
8181
time = time.toString(),
82-
name = release.assets!![0]!!.uploader!!.login.toString()+ "更新了版本",
82+
name = release.assets!![0]!!.uploader!!.login.toString()+ "${projects.toString()}更新了版本",
8383
event = bot.getFriendOrGroup(e.toString().toLong())
8484
)
8585
)
@@ -94,7 +94,7 @@ class Releases {
9494
html = release.htmlUrl.toString(),
9595
avatar = release.author!!.avatarUrl.toString(),
9696
time = time.toString(),
97-
name = release.assets!![0]!!.uploader!!.login.toString() + "更新了版本",
97+
name = release.assets!![0]!!.uploader!!.login.toString() + "${projects.toString()}更新了版本",
9898
event = bot.getFriendOrGroup(u.toString().toLong())
9999
)
100100
)

src/main/kotlin/utils/CardUtil.kt

+1-9
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,8 @@ class CardUtil {
3333
}
3434

3535

36-
val builder = Image.Builder.newBuilder(imageId)
37-
builder.height = 50
38-
builder.width = 50
3936

40-
builder.type = ImageType.PNG
41-
42-
val image = builder.build();
43-
44-
45-
return image.plus(name).plus("\n")
37+
return Image(imageId).plus(name).plus("\n")
4638
.plus("时间:$time").plus("\n")
4739
.plus("介绍:$message").plus("\n")
4840
.plus("网址:$html").plus("\n")

0 commit comments

Comments
 (0)