From 3c0ea6517989dfb474eb0bee4ac2d44802d9bf39 Mon Sep 17 00:00:00 2001 From: Ray Eldath Date: Sat, 18 May 2019 23:46:30 +0800 Subject: [PATCH] RELEASE v1.3.1 --- README.md | 2 +- README.zh_CN.md | 2 +- config_example.json | 148 ++++++++++++------------ distZip.bat | 2 +- src/main/kotlin/avalon/group/Execute.kt | 29 ++--- 5 files changed, 91 insertions(+), 92 deletions(-) diff --git a/README.md b/README.md index 693cdf5..203ae08 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/README.zh_CN.md b/README.zh_CN.md index be0bdf9..38f4723 100644 --- a/README.zh_CN.md +++ b/README.zh_CN.md @@ -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) diff --git a/config_example.json b/config_example.json index 89a29f2..6d84948 100644 --- a/config_example.json +++ b/config_example.json @@ -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 } \ No newline at end of file diff --git a/distZip.bat b/distZip.bat index cda1938..9cb7047 100644 --- a/distZip.bat +++ b/distZip.bat @@ -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 . diff --git a/src/main/kotlin/avalon/group/Execute.kt b/src/main/kotlin/avalon/group/Execute.kt index bb93c4f..0a1f808 100644 --- a/src/main/kotlin/avalon/group/Execute.kt +++ b/src/main/kotlin/avalon/group/Execute.kt @@ -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)) { @@ -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") } @@ -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 } \ No newline at end of file