Skip to content
This repository has been archived by the owner on Aug 15, 2023. It is now read-only.

Commit

Permalink
几个 options 名字正常一点
Browse files Browse the repository at this point in the history
  • Loading branch information
Arondight committed Oct 19, 2021
1 parent fee0e25 commit 7d1e29e
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
12 changes: 6 additions & 6 deletions config_defaults/command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# entrance: # 功能入口(正则 、插件唯一、忽略大小写)
# - string
# options: # 如果 type 为 option ,这里为候选项列表
# option_name: string # 候选项(键禁止修改)
# option_name: string # 候选项(键禁止修改,功能唯一
# ==============================================================================

aby:
Expand Down Expand Up @@ -152,9 +152,9 @@ gacha:
entrance:
- ^卡池
options:
pool_200: 常驻
pool_301: 角色
pool_302: 武器
200: 常驻
301: 角色
302: 武器
select:
type: command
weights: 9799
Expand Down Expand Up @@ -313,8 +313,8 @@ music:
entrance:
- ^音乐源
options:
music_source_qq: QQ
music_source_163: 163
qq: QQ
163: 163

overview:
enable: true
Expand Down
4 changes: 2 additions & 2 deletions config_defaults/command_master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
# name: string # 呈现给用户的功能名称(忽略大小写)
# usage: string # 呈现给用户的功能格式
# description: string # 呈现给用户的功能说明
# entrance: # 功能入口(正则、插件唯一、忽略大小写)
# entrance: # 功能入口(正则 、插件唯一、忽略大小写)
# - string
# options: # 如果 type 为 option ,这里为候选项列表
# option_name: string # 候选项(键禁止修改)
# option_name: string # 候选项(键禁止修改,功能唯一
# ==============================================================================

tools_master:
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/gacha/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ async function Plugin(Message, bot) {
let choice = 301;

switch (cmd) {
case all.functions.options.pool.pool_200:
case all.functions.options.pool[200]:
choice = 200;
break;
case all.functions.options.pool.pool_301:
case all.functions.options.pool[301]:
choice = 301;
break;
case all.functions.options.pool.pool_302:
case all.functions.options.pool[302]:
choice = 302;
break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/music/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ async function Plugin(Message, bot) {
data = await db.get("music", "source", { ID: sendID });
src = data
? data["Source"]
: all.functions.options.music_source.music_source_163 || "163";
: all.functions.options.music_source[163] || "163";
ret = await musicID(msg, src);

if (ret in errMsg) {
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/music/music.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ async function music163(keyword) {
async function musicID(msg, source) {
const [keyword] = msg.split(/(?<=^\S+)\s/).slice(1);
const worker = {
[all.functions.options.music_source.music_source_qq || "qq"]: musicQQ,
[all.functions.options.music_source.music_source_163 || "163"]: music163,
[all.functions.options.music_source.qq || "qq"]: musicQQ,
[all.functions.options.music_source[163] || "163"]: music163,
};

if (!(source in worker)) {
Expand Down
12 changes: 6 additions & 6 deletions src/utils/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
* enable: true
* weights: 9999
* regex:
* - ^HELLO\sworld(!)?\s*$
* - ^hello\sworld(!)?\s*$
* functions:
* Hello_World:
* type: command
Expand All @@ -64,7 +64,7 @@
* usage:
* description: I will say hello to you
* entrance:
* - hello WORLD
* - ^hello
*
* Eat:
* enable: true
Expand All @@ -79,11 +79,11 @@
* usage:
* description: What to eat
* entrance:
* - EAT
* - ^eat
* options:
* Apple: "苹果"
* Banana: "香蕉"
* Egg: "蛋"
* Apple: 苹果
* Banana: 香蕉
* Egg:
* ==========================================================================
*
*
Expand Down

0 comments on commit 7d1e29e

Please sign in to comment.