Skip to content
This repository has been archived by the owner on Jan 23, 2021. It is now read-only.

Commit

Permalink
RELEASE v1.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Ray-Eldath committed May 18, 2019
1 parent 96f6f34 commit 3c0ea65
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 92 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Avalon v1.3.0 [![GNU Affero General Public License, version 3](https://www.gnu.org/graphics/agplv3-155x51.png)](https://www.gnu.org/licenses/agpl.html) [![GitHub stars](https://img.shields.io/github/stars/Ray-Eldath/Avalon.svg?style=social&label=Stars)](https://github.com/Ray-Eldath/Avalon/stargazers) [![GitHub followers](https://img.shields.io/github/followers/Ray-Eldath.svg?style=social&label=Follow)](https://github.com/Ray-Eldath)
# Avalon v1.3.1 [![GNU Affero General Public License, version 3](https://www.gnu.org/graphics/agplv3-155x51.png)](https://www.gnu.org/licenses/agpl.html) [![GitHub stars](https://img.shields.io/github/stars/Ray-Eldath/Avalon.svg?style=social&label=Stars)](https://github.com/Ray-Eldath/Avalon/stargazers) [![GitHub followers](https://img.shields.io/github/followers/Ray-Eldath.svg?style=social&label=Follow)](https://github.com/Ray-Eldath)

[![Build Status](https://img.shields.io/travis/Ray-Eldath/Avalon/master.svg?style=flat-square)](https://travis-ci.org/Ray-Eldath/Avalon) [![Build status](https://img.shields.io/appveyor/ci/RayEldath/avalon/master.svg?style=flat-square)](https://ci.appveyor.com/project/RayEldath/avalon/branch/master) [![Codeship Status for Ray-Eldath/Avalon](https://img.shields.io/codeship/28b37980-8a1d-0135-1242-62d9615dc8b0/master.svg?style=flat-square)](https://app.codeship.com/projects/248940) [![CircleCI](https://img.shields.io/circleci/project/github/Ray-Eldath/Avalon/master.svg?style=flat-square)](https://circleci.com/gh/Ray-Eldath/Avalon/tree/master) [![](https://jitpack.io/v/Ray-Eldath/Avalon.svg?style=flat-square)](https://jitpack.io/#Ray-Eldath/Avalon) [![Known Vulnerabilities](https://snyk.io/test/github/ray-eldath/avalon/badge.svg?style=flat-square)](https://snyk.io/test/github/ray-eldath/avalon)

Expand Down
2 changes: 1 addition & 1 deletion README.zh_CN.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Avalon v1.3.0 [![GNU Affero General Public License, version 3](https://www.gnu.org/graphics/agplv3-155x51.png)](https://www.gnu.org/licenses/agpl.html) [![GitHub stars](https://img.shields.io/github/stars/Ray-Eldath/Avalon.svg?style=social&label=Stars)](https://github.com/Ray-Eldath/Avalon/stargazers) [![GitHub followers](https://img.shields.io/github/followers/Ray-Eldath.svg?style=social&label=Follow)](https://github.com/Ray-Eldath)
# Avalon v1.3.1 [![GNU Affero General Public License, version 3](https://www.gnu.org/graphics/agplv3-155x51.png)](https://www.gnu.org/licenses/agpl.html) [![GitHub stars](https://img.shields.io/github/stars/Ray-Eldath/Avalon.svg?style=social&label=Stars)](https://github.com/Ray-Eldath/Avalon/stargazers) [![GitHub followers](https://img.shields.io/github/followers/Ray-Eldath.svg?style=social&label=Follow)](https://github.com/Ray-Eldath)

[![Build Status](https://img.shields.io/travis/Ray-Eldath/Avalon/master.svg?style=flat-square)](https://travis-ci.org/Ray-Eldath/Avalon) [![Build status](https://img.shields.io/appveyor/ci/RayEldath/avalon/master.svg?style=flat-square)](https://ci.appveyor.com/project/RayEldath/avalon/branch/master) [![Codeship Status for Ray-Eldath/Avalon](https://img.shields.io/codeship/28b37980-8a1d-0135-1242-62d9615dc8b0/master.svg?style=flat-square)](https://app.codeship.com/projects/248940) [![CircleCI](https://img.shields.io/circleci/project/github/Ray-Eldath/Avalon/master.svg?style=flat-square)](https://circleci.com/gh/Ray-Eldath/Avalon/tree/master) [![](https://jitpack.io/v/Ray-Eldath/Avalon.svg?style=flat-square)](https://jitpack.io/#Ray-Eldath/Avalon) [![Known Vulnerabilities](https://snyk.io/test/github/ray-eldath/avalon/badge.svg?style=flat-square)](https://snyk.io/test/github/ray-eldath/avalon) [![QQ群](https://img.shields.io/badge/QQ%E7%BE%A4-ProgramLeague-blue.svg?style=flat-square)](https://jq.qq.com/?_wv=1027&k=46GveNI)

Expand Down
148 changes: 73 additions & 75 deletions config_example.json
Original file line number Diff line number Diff line change
@@ -1,82 +1,80 @@
{
"max_recorded_group_message_amount": 5000000,
"max_recorded_friend_message_amount": 10000,
"block_words": [
"fuck",
"f**k"
],
"cooling_duration": 3000,
"block_words_punish_frequency": 3,
"block_words_punishment_mode_enabled": true,
"responders": {
"enable": [
"Blacklist",
"Echo",
"Execute",
"ExecuteInfo",
"Flush",
"Heartbeat",
"Help",
"Hitokoto",
"Manager",
"Mo",
"Quote",
"Reboot",
"ShowAdmin",
"Shutdown",
"Version",
"Wolfram"
"max_recorded_group_message_amount": 5000000,
"max_recorded_friend_message_amount": 10000,
"block_words": [
"fuck",
"f**k"
],
"disable": [
"AnswerMe"
]
},
"responder_config": {
"AnswerMe": {
"mojo-weixin_api_address": "http://127.0.0.1:3500"
"cooling_duration": 3000,
"block_words_punish_frequency": 3,
"block_words_punishment_mode_enabled": true,
"responders": {
"enable": [
"Blacklist",
"Echo",
"Execute",
"ExecuteInfo",
"Flush",
"Heartbeat",
"Help",
"Hitokoto",
"Manager",
"Mo",
"Quote",
"ShowAdmin",
"Shutdown",
"Version",
"Wolfram"
],
"disable": [
"AnswerMe"
]
},
"Wolfram": {
"app_id": "XXXXXX-ZZZZZZZZZZ"
"responder_config": {
"AnswerMe": {
"mojo-weixin_api_address": "http://127.0.0.1:3500"
},
"Wolfram": {
"app_id": "XXXXXX-ZZZZZZZZZZ"
},
"Execute": {
"backend": "Glot-Run",
"token": "1111111-aaaa-bbbb-cccc-dddddddddddd"
},
"Hitokoto": {
"push_when_start": true,
"category": "b"
}
},
"function_config": {
"RSS": {
"enable": true,
"feed": [
"http://ice1000.org/feed.xml"
]
},
"BuildStatus": {
"enable": false,
"listen": [
{
"name": "Ray-Eldath/Avalon",
"ci": [
"TravisCI:Ray-Eldath/Avalon",
"AppVeyor:RayEldath/avalon"
]
}
]
}
},
"Execute": {
"backend": "Glot-Run",
"token": "1111111-aaaa-bbbb-cccc-dddddddddddd"
"database": {
"datasource": "H2"
},
"Hitokoto": {
"push_when_start": true,
"category": "b"
}
},
"function_config": {
"RSS": {
"enable": true,
"feed": [
"http://ice1000.org/feed.xml"
]
"backend": {
"backend": "CoolQ",
"listen_address": "http://127.0.0.1:5050",
"api_address": "http://127.0.0.1:5000"
},
"BuildStatus": {
"enable": false,
"listen": [
{
"name": "Ray-Eldath/Avalon",
"ci": [
"TravisCI:Ray-Eldath/Avalon",
"AppVeyor:RayEldath/avalon"
]
}
]
}
},
"database": {
"datasource": "H2"
},
"backend": {
"backend": "CoolQ",
"listen_address": "http://127.0.0.1:5050",
"api_address": "http://127.0.0.1:5000",
"token": "A34543AAA453A34AAAAAA45AAAAAAAA34AAAA453AAAAA34AAAAAAAA45AA"
},
"running_on_pc": true,
"debug": false,
"local_output": false
"running_on_pc": true,
"debug": false,
"local_output": false
}
2 changes: 1 addition & 1 deletion distZip.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@echo off
:: gradle build
set fileName=Avalon-1.3.0
set fileName=Avalon-1.3.1
echo Handling %fileName%.zip, continue?
pause
xcopy /Y /Q .\build\distributions\%fileName%.zip .
Expand Down
29 changes: 15 additions & 14 deletions src/main/kotlin/avalon/group/Execute.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ object Execute : GroupMessageResponder() {
val split = contentM.split("\n")
val first = split[0]
codes = split.subList(1, split.size)
lang = first.replace("avalon execute ", "").trim()
lang = first.replace("avalon execute ", "")
.replace("avalon ex ", "").trim()
}

if (!executive.allLanguages().contains(lang)) {
Expand All @@ -47,14 +48,14 @@ object Execute : GroupMessageResponder() {
val exitcode = result.exitcode
val stderr = handleOutput(result.stderr)
val content =
when (result.status) {
ExecutiveStatus.ERROR -> LANG.getString("group.execute.error")
.format("exitcode: $exitcode} stderr: $stderr error: ${handleOutput(result.error)}")
ExecutiveStatus.STDERR -> LANG.getString("group.execute.stderr")
.format("exitcode: $exitcode stderr: $stderr")
ExecutiveStatus.OK -> LANG.getString("group.execute.ok")
.format("exitcode: $exitcode stdout: ${handleOutput(result.stdout)}")
}
when (result.status) {
ExecutiveStatus.ERROR -> LANG.getString("group.execute.error")
.format("exitcode: $exitcode} stderr: $stderr error: ${handleOutput(result.error)}")
ExecutiveStatus.STDERR -> LANG.getString("group.execute.stderr")
.format("exitcode: $exitcode stderr: $stderr")
ExecutiveStatus.OK -> LANG.getString("group.execute.ok")
.format("exitcode: $exitcode stdout: ${handleOutput(result.stdout)}")
}
message.response("${Flag.at(message)} $content")
}

Expand All @@ -66,11 +67,11 @@ object Execute : GroupMessageResponder() {
}

override fun responderInfo(): ResponderInfo =
ResponderInfo(
Pair("(ex|execute) ${LANG.getString("group.execute.help.first")}",
LANG.getString("group.execute.help.second").format("avalon execute info")),
Pattern.compile("(ex|execute) [^info]*")
)
ResponderInfo(
Pair("(ex|execute) ${LANG.getString("group.execute.help.first")}",
LANG.getString("group.execute.help.second").format("avalon execute info")),
Pattern.compile("(ex|execute) [^info]*")
)

override fun instance(): GroupMessageResponder = this
}

0 comments on commit 3c0ea65

Please sign in to comment.