Release beta 1.0.5 primogem economy
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
# game-history
|
||||
|
||||
Author: `jwebot`
|
||||
|
||||
游戏记录
|
||||
|
||||
Help:
|
||||
|
||||
- `/游戏记录 /个人记录 /gamehistory`
|
||||
|
||||
Registered commands:
|
||||
|
||||
- `/游戏记录`
|
||||
- `/个人记录`
|
||||
- `/gamehistory`
|
||||
|
||||
The adapter has no direct Ledger, GUI, environment, shell, or network access.
|
||||
It delegates to the reviewed `game-history` Kernel service profile
|
||||
and returns a structured `ReplyPlan`.
|
||||
@@ -0,0 +1,14 @@
|
||||
id = "game-history"
|
||||
author = "jwebot"
|
||||
description = "游戏记录"
|
||||
help = ["/游戏记录 /个人记录 /gamehistory"]
|
||||
version = "1.0.0"
|
||||
api_version = "1"
|
||||
entrypoint = "game_history:plugin"
|
||||
type = "command"
|
||||
|
||||
[capabilities]
|
||||
commands = ["/游戏记录", "/个人记录", "/gamehistory"]
|
||||
storage = false
|
||||
network_profiles = []
|
||||
service_profiles = ["game-history"]
|
||||
@@ -0,0 +1,45 @@
|
||||
"""Generated reviewed adapter for game-history."""
|
||||
|
||||
from jwebot_sdk import Event, ExtensionResult, ReplyPlan, SingleGroupContext
|
||||
|
||||
|
||||
PROFILE = 'game-history'
|
||||
AUTHOR = 'jwebot'
|
||||
DESCRIPTION = '游戏记录'
|
||||
HELP_ENTRIES = ('/游戏记录 /个人记录 /gamehistory',)
|
||||
COMMANDS = ('/游戏记录', '/个人记录', '/gamehistory')
|
||||
|
||||
|
||||
def _handler(context: SingleGroupContext, command: str):
|
||||
def handle(event: Event, arguments: str) -> ExtensionResult:
|
||||
response = context.services.call(
|
||||
PROFILE,
|
||||
operation="execute",
|
||||
payload={
|
||||
"command": command,
|
||||
"arguments": arguments,
|
||||
"event": event.to_mapping(),
|
||||
},
|
||||
)
|
||||
texts = response.get("texts")
|
||||
if isinstance(texts, list) and texts and all(
|
||||
isinstance(item, str) and item.strip() for item in texts
|
||||
):
|
||||
return ExtensionResult(
|
||||
reply=ReplyPlan.multi_text(texts),
|
||||
metadata={"local_extension": PROFILE, "author": AUTHOR},
|
||||
)
|
||||
text = response.get("text")
|
||||
if not isinstance(text, str) or not text.strip():
|
||||
raise ValueError("local service returned invalid text")
|
||||
return ExtensionResult(
|
||||
reply=ReplyPlan.text(text),
|
||||
metadata={"local_extension": PROFILE, "author": AUTHOR},
|
||||
)
|
||||
|
||||
return handle
|
||||
|
||||
|
||||
def plugin(context: SingleGroupContext) -> None:
|
||||
for command in COMMANDS:
|
||||
context.commands.register(command, _handler(context, command))
|
||||
@@ -0,0 +1,29 @@
|
||||
import sys
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
from unittest import mock
|
||||
|
||||
|
||||
SOURCE = Path(__file__).resolve().parents[1] / "src"
|
||||
sys.path.insert(0, str(SOURCE))
|
||||
|
||||
from game_history import AUTHOR, DESCRIPTION, HELP_ENTRIES, plugin
|
||||
|
||||
|
||||
class PluginTests(unittest.TestCase):
|
||||
def test_registers_declared_commands_and_author(self):
|
||||
context = mock.Mock()
|
||||
plugin(context)
|
||||
registered = [
|
||||
call.args[0]
|
||||
for call in context.commands.register.call_args_list
|
||||
]
|
||||
self.assertEqual(AUTHOR, 'jwebot')
|
||||
self.assertEqual(DESCRIPTION, '游戏记录')
|
||||
self.assertEqual(HELP_ENTRIES, ('/游戏记录 /个人记录 /gamehistory',))
|
||||
self.assertIn('/游戏记录', registered)
|
||||
self.assertEqual(len(registered), 3)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
@@ -0,0 +1,25 @@
|
||||
# primogem-economy
|
||||
|
||||
Author: `jwebot`
|
||||
|
||||
原石系统
|
||||
|
||||
Help:
|
||||
|
||||
- `/原石祈愿 /原石榜;/扫码加权 人;/Taffy发话 [定时HH:MM] 内容`
|
||||
|
||||
Registered commands:
|
||||
|
||||
- `/原石祈愿`
|
||||
- `/祈愿`
|
||||
- `/wish`
|
||||
- `/原石榜`
|
||||
- `/primogem榜`
|
||||
- `/扫码加权`
|
||||
- `/扫码概率`
|
||||
- `/Taffy发话`
|
||||
- `/taffysay`
|
||||
|
||||
The adapter has no direct Ledger, GUI, environment, shell, or network access.
|
||||
It delegates to the reviewed `primogem-economy` Kernel service profile
|
||||
and returns a structured `ReplyPlan`.
|
||||
@@ -0,0 +1,14 @@
|
||||
id = "primogem-economy"
|
||||
author = "jwebot"
|
||||
description = "原石系统"
|
||||
help = ["/原石祈愿 /原石榜;/扫码加权 人;/Taffy发话 [定时HH:MM] 内容"]
|
||||
version = "1.0.0"
|
||||
api_version = "1"
|
||||
entrypoint = "primogem_economy:plugin"
|
||||
type = "command"
|
||||
|
||||
[capabilities]
|
||||
commands = ["/原石祈愿", "/祈愿", "/wish", "/原石榜", "/primogem榜", "/扫码加权", "/扫码概率", "/Taffy发话", "/taffysay"]
|
||||
storage = false
|
||||
network_profiles = []
|
||||
service_profiles = ["primogem-economy"]
|
||||
@@ -0,0 +1,45 @@
|
||||
"""Generated reviewed adapter for primogem-economy."""
|
||||
|
||||
from jwebot_sdk import Event, ExtensionResult, ReplyPlan, SingleGroupContext
|
||||
|
||||
|
||||
PROFILE = 'primogem-economy'
|
||||
AUTHOR = 'jwebot'
|
||||
DESCRIPTION = '原石系统'
|
||||
HELP_ENTRIES = ('/原石祈愿 /原石榜;/扫码加权 人;/Taffy发话 [定时HH:MM] 内容',)
|
||||
COMMANDS = ('/原石祈愿', '/祈愿', '/wish', '/原石榜', '/primogem榜', '/扫码加权', '/扫码概率', '/Taffy发话', '/taffysay')
|
||||
|
||||
|
||||
def _handler(context: SingleGroupContext, command: str):
|
||||
def handle(event: Event, arguments: str) -> ExtensionResult:
|
||||
response = context.services.call(
|
||||
PROFILE,
|
||||
operation="execute",
|
||||
payload={
|
||||
"command": command,
|
||||
"arguments": arguments,
|
||||
"event": event.to_mapping(),
|
||||
},
|
||||
)
|
||||
texts = response.get("texts")
|
||||
if isinstance(texts, list) and texts and all(
|
||||
isinstance(item, str) and item.strip() for item in texts
|
||||
):
|
||||
return ExtensionResult(
|
||||
reply=ReplyPlan.multi_text(texts),
|
||||
metadata={"local_extension": PROFILE, "author": AUTHOR},
|
||||
)
|
||||
text = response.get("text")
|
||||
if not isinstance(text, str) or not text.strip():
|
||||
raise ValueError("local service returned invalid text")
|
||||
return ExtensionResult(
|
||||
reply=ReplyPlan.text(text),
|
||||
metadata={"local_extension": PROFILE, "author": AUTHOR},
|
||||
)
|
||||
|
||||
return handle
|
||||
|
||||
|
||||
def plugin(context: SingleGroupContext) -> None:
|
||||
for command in COMMANDS:
|
||||
context.commands.register(command, _handler(context, command))
|
||||
@@ -0,0 +1,29 @@
|
||||
import sys
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
from unittest import mock
|
||||
|
||||
|
||||
SOURCE = Path(__file__).resolve().parents[1] / "src"
|
||||
sys.path.insert(0, str(SOURCE))
|
||||
|
||||
from primogem_economy import AUTHOR, DESCRIPTION, HELP_ENTRIES, plugin
|
||||
|
||||
|
||||
class PluginTests(unittest.TestCase):
|
||||
def test_registers_declared_commands_and_author(self):
|
||||
context = mock.Mock()
|
||||
plugin(context)
|
||||
registered = [
|
||||
call.args[0]
|
||||
for call in context.commands.register.call_args_list
|
||||
]
|
||||
self.assertEqual(AUTHOR, 'jwebot')
|
||||
self.assertEqual(DESCRIPTION, '原石系统')
|
||||
self.assertEqual(HELP_ENTRIES, ('/原石祈愿 /原石榜;/扫码加权 人;/Taffy发话 [定时HH:MM] 内容',))
|
||||
self.assertIn('/原石祈愿', registered)
|
||||
self.assertEqual(len(registered), 9)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
@@ -6,17 +6,14 @@ Author: `jwebot`
|
||||
|
||||
Help:
|
||||
|
||||
- `/摩拉(兼容 /金币)/wallet;/游戏记录 /gamehistory`
|
||||
- `/抽奖 [金额];/draw`
|
||||
- `/彩票 开始|报名|状态|开奖|取消;/lottery`
|
||||
- `/21点 单人开始|要牌|停牌|状态;多人启动|加入|开始|放200`
|
||||
- `/游戏帮助;/games`
|
||||
- `/摩拉/原石 /抽奖 /彩票 /21点 /游戏帮助`
|
||||
|
||||
Registered commands:
|
||||
|
||||
- `/摩拉`
|
||||
- `/金币`
|
||||
- `/wallet`
|
||||
- `/原石`
|
||||
- `/抽奖`
|
||||
- `/draw`
|
||||
- `/彩票`
|
||||
@@ -25,9 +22,6 @@ Registered commands:
|
||||
- `/21点`
|
||||
- `/二十一点`
|
||||
- `/blackjack`
|
||||
- `/游戏记录`
|
||||
- `/个人记录`
|
||||
- `/gamehistory`
|
||||
- `/游戏帮助`
|
||||
- `/games`
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
id = "single-player-games"
|
||||
author = "jwebot"
|
||||
description = "摩拉游戏"
|
||||
help = ["/摩拉(兼容 /金币)/wallet;/游戏记录 /gamehistory", "/抽奖 [金额];/draw", "/彩票 开始|报名|状态|开奖|取消;/lottery", "/21点 单人开始|要牌|停牌|状态;多人启动|加入|开始|放200", "/游戏帮助;/games"]
|
||||
help = ["/摩拉/原石 /抽奖 /彩票 /21点 /游戏帮助"]
|
||||
version = "1.0.0"
|
||||
api_version = "1"
|
||||
entrypoint = "single_player_games:plugin"
|
||||
type = "command"
|
||||
|
||||
[capabilities]
|
||||
commands = ["/摩拉", "/金币", "/wallet", "/抽奖", "/draw", "/彩票", "/买彩票", "/lottery", "/21点", "/二十一点", "/blackjack", "/游戏记录", "/个人记录", "/gamehistory", "/游戏帮助", "/games"]
|
||||
commands = ["/摩拉", "/金币", "/wallet", "/原石", "/抽奖", "/draw", "/彩票", "/买彩票", "/lottery", "/21点", "/二十一点", "/blackjack", "/游戏帮助", "/games"]
|
||||
storage = false
|
||||
network_profiles = []
|
||||
service_profiles = ["single-player-games"]
|
||||
|
||||
@@ -6,8 +6,8 @@ from jwebot_sdk import Event, ExtensionResult, ReplyPlan, SingleGroupContext
|
||||
PROFILE = 'single-player-games'
|
||||
AUTHOR = 'jwebot'
|
||||
DESCRIPTION = '摩拉游戏'
|
||||
HELP_ENTRIES = ('/摩拉(兼容 /金币)/wallet;/游戏记录 /gamehistory', '/抽奖 [金额];/draw', '/彩票 开始|报名|状态|开奖|取消;/lottery', '/21点 单人开始|要牌|停牌|状态;多人启动|加入|开始|放200', '/游戏帮助;/games')
|
||||
COMMANDS = ('/摩拉', '/金币', '/wallet', '/抽奖', '/draw', '/彩票', '/买彩票', '/lottery', '/21点', '/二十一点', '/blackjack', '/游戏记录', '/个人记录', '/gamehistory', '/游戏帮助', '/games')
|
||||
HELP_ENTRIES = ('/摩拉/原石 /抽奖 /彩票 /21点 /游戏帮助',)
|
||||
COMMANDS = ('/摩拉', '/金币', '/wallet', '/原石', '/抽奖', '/draw', '/彩票', '/买彩票', '/lottery', '/21点', '/二十一点', '/blackjack', '/游戏帮助', '/games')
|
||||
|
||||
|
||||
def _handler(context: SingleGroupContext, command: str):
|
||||
|
||||
@@ -20,9 +20,9 @@ class PluginTests(unittest.TestCase):
|
||||
]
|
||||
self.assertEqual(AUTHOR, 'jwebot')
|
||||
self.assertEqual(DESCRIPTION, '摩拉游戏')
|
||||
self.assertEqual(HELP_ENTRIES, ('/摩拉(兼容 /金币)/wallet;/游戏记录 /gamehistory', '/抽奖 [金额];/draw', '/彩票 开始|报名|状态|开奖|取消;/lottery', '/21点 单人开始|要牌|停牌|状态;多人启动|加入|开始|放200', '/游戏帮助;/games'))
|
||||
self.assertEqual(HELP_ENTRIES, ('/摩拉/原石 /抽奖 /彩票 /21点 /游戏帮助',))
|
||||
self.assertIn('/摩拉', registered)
|
||||
self.assertEqual(len(registered), 16)
|
||||
self.assertEqual(len(registered), 14)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -6,10 +6,11 @@ JWeBot 版本
|
||||
|
||||
Help:
|
||||
|
||||
- `/version`
|
||||
- `/version /版本`
|
||||
|
||||
Registered commands:
|
||||
|
||||
- `/版本`
|
||||
- `/version`
|
||||
|
||||
The adapter has no direct Ledger, GUI, environment, shell, or network access.
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
id = "jwebot-version"
|
||||
author = "official"
|
||||
description = "JWeBot 版本"
|
||||
help = ["/version"]
|
||||
help = ["/version /版本"]
|
||||
version = "1.0.0"
|
||||
api_version = "1"
|
||||
entrypoint = "jwebot_version:plugin"
|
||||
type = "command"
|
||||
|
||||
[capabilities]
|
||||
commands = ["/version"]
|
||||
commands = ["/版本", "/version"]
|
||||
storage = false
|
||||
network_profiles = []
|
||||
service_profiles = ["jwebot-version"]
|
||||
|
||||
@@ -6,8 +6,8 @@ from jwebot_sdk import Event, ExtensionResult, ReplyPlan, SingleGroupContext
|
||||
PROFILE = 'jwebot-version'
|
||||
AUTHOR = 'official'
|
||||
DESCRIPTION = 'JWeBot 版本'
|
||||
HELP_ENTRIES = ('/version',)
|
||||
COMMANDS = ('/version',)
|
||||
HELP_ENTRIES = ('/version /版本',)
|
||||
COMMANDS = ('/版本', '/version')
|
||||
|
||||
|
||||
def _handler(context: SingleGroupContext, command: str):
|
||||
|
||||
@@ -20,9 +20,9 @@ class PluginTests(unittest.TestCase):
|
||||
]
|
||||
self.assertEqual(AUTHOR, 'official')
|
||||
self.assertEqual(DESCRIPTION, 'JWeBot 版本')
|
||||
self.assertEqual(HELP_ENTRIES, ('/version',))
|
||||
self.assertIn('/version', registered)
|
||||
self.assertEqual(len(registered), 1)
|
||||
self.assertEqual(HELP_ENTRIES, ('/version /版本',))
|
||||
self.assertIn('/版本', registered)
|
||||
self.assertEqual(len(registered), 2)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
Author: `official`
|
||||
|
||||
查询当前群已配置人物、基本属性和别名
|
||||
人物索引
|
||||
|
||||
Help:
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
id = "person-directory"
|
||||
author = "official"
|
||||
description = "查询当前群已配置人物、基本属性和别名"
|
||||
description = "人物索引"
|
||||
help = ["/人物列表 [页码] /people;/人物 [名称或别名] /person"]
|
||||
version = "1.0.0"
|
||||
api_version = "1"
|
||||
|
||||
@@ -5,7 +5,7 @@ from jwebot_sdk import Event, ExtensionResult, ReplyPlan, SingleGroupContext
|
||||
|
||||
PROFILE = 'person-directory'
|
||||
AUTHOR = 'official'
|
||||
DESCRIPTION = '查询当前群已配置人物、基本属性和别名'
|
||||
DESCRIPTION = '人物索引'
|
||||
HELP_ENTRIES = ('/人物列表 [页码] /people;/人物 [名称或别名] /person',)
|
||||
COMMANDS = ('/人物列表', '/别名列表', '/people', '/人物', '/个人属性', '/person')
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ class PluginTests(unittest.TestCase):
|
||||
for call in context.commands.register.call_args_list
|
||||
]
|
||||
self.assertEqual(AUTHOR, 'official')
|
||||
self.assertEqual(DESCRIPTION, '查询当前群已配置人物、基本属性和别名')
|
||||
self.assertEqual(DESCRIPTION, '人物索引')
|
||||
self.assertEqual(HELP_ENTRIES, ('/人物列表 [页码] /people;/人物 [名称或别名] /person',))
|
||||
self.assertIn('/人物列表', registered)
|
||||
self.assertEqual(len(registered), 6)
|
||||
|
||||
Reference in New Issue
Block a user