mirror of
https://github.com/ZZZure/ZZZ-Plugin.git
synced 2025-12-16 13:17:32 +00:00
移动部分文件位置
This commit is contained in:
parent
61ef3854e7
commit
b44c9caa47
2 changed files with 48 additions and 48 deletions
|
|
@ -25,14 +25,6 @@ export class Guide extends ZZZPlugin {
|
||||||
reg: `^${rulePrefix}攻略(说明|帮助)$`,
|
reg: `^${rulePrefix}攻略(说明|帮助)$`,
|
||||||
fnc: 'GuideHelp',
|
fnc: 'GuideHelp',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
reg: `^${rulePrefix}设置默认攻略(\\d+|all)$`,
|
|
||||||
fnc: 'SetDefaultGuide',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
reg: `^${rulePrefix}设置所有攻略显示个数(\\d+)$`,
|
|
||||||
fnc: 'SetMaxForwardGuide',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
reg: `${rulePrefix}(更新)?\\S+攻略(\\d+|all)?$`,
|
reg: `${rulePrefix}(更新)?\\S+攻略(\\d+|all)?$`,
|
||||||
fnc: 'Guide',
|
fnc: 'Guide',
|
||||||
|
|
@ -221,44 +213,4 @@ export class Guide extends ZZZPlugin {
|
||||||
].concat(this.source.map((element, index) => `${index + 1}: ${element}`));
|
].concat(this.source.map((element, index) => `${index + 1}: ${element}`));
|
||||||
await this.e.reply(reply_msg.join('\n'));
|
await this.e.reply(reply_msg.join('\n'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** %设置默认攻略1 */
|
|
||||||
async SetDefaultGuide() {
|
|
||||||
if (!this.e.isMaster) {
|
|
||||||
this.reply('仅限主人设置');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
let match = /设置默认攻略(\d+|all)$/g.exec(this.e.msg);
|
|
||||||
let guide_id = match[1];
|
|
||||||
if (guide_id == 'all') {
|
|
||||||
guide_id = 0;
|
|
||||||
}
|
|
||||||
guide_id = Number(guide_id);
|
|
||||||
if (guide_id > this.maxNum) {
|
|
||||||
let reply_msg = [
|
|
||||||
'绝区零默认攻略设置方式为:',
|
|
||||||
'%设置默认攻略[0123...]',
|
|
||||||
`请增加数字0-${this.maxNum}其中一个,或者增加 all 以显示所有攻略`,
|
|
||||||
'攻略来源请输入 %攻略帮助 查看',
|
|
||||||
];
|
|
||||||
await this.e.reply(reply_msg.join('\n'));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
settings.setSingleConfig('guide', 'default_guide', guide_id);
|
|
||||||
|
|
||||||
let source_name = guide_id == 0 ? 'all' : this.source[guide_id - 1];
|
|
||||||
await this.e.reply(`绝区零默认攻略已设置为: ${guide_id} (${source_name})`);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** %设置所有攻略显示个数3 */
|
|
||||||
async SetMaxForwardGuide() {
|
|
||||||
if (!this.e.isMaster) {
|
|
||||||
this.reply('仅限主人设置');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
let match = /设置所有攻略显示个数(\d+)$/g.exec(this.e.msg);
|
|
||||||
let max_forward_guide = Number(match[1]);
|
|
||||||
this.setSingleConfig('max_forward_guides', max_forward_guide);
|
|
||||||
await this.e.reply(`绝区零所有攻略显示个数已设置为: ${max_forward_guide}`);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,14 @@ export class Panel extends ZZZPlugin {
|
||||||
reg: `${rulePrefix}删除(全部|所有)资源$`,
|
reg: `${rulePrefix}删除(全部|所有)资源$`,
|
||||||
fnc: 'deleteAll',
|
fnc: 'deleteAll',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
reg: `^${rulePrefix}设置默认攻略(\\d+|all)$`,
|
||||||
|
fnc: 'setDefaultGuide',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
reg: `^${rulePrefix}设置所有攻略显示个数(\\d+)$`,
|
||||||
|
fnc: 'setMaxForwardGuide',
|
||||||
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -138,4 +146,44 @@ export class Panel extends ZZZPlugin {
|
||||||
}
|
}
|
||||||
await this.reply('资源图片已删除!');
|
await this.reply('资源图片已删除!');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 设置默认攻略 */
|
||||||
|
async setDefaultGuide() {
|
||||||
|
if (!this.e.isMaster) {
|
||||||
|
this.reply('仅限主人设置');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
let match = /设置默认攻略(\d+|all)$/g.exec(this.e.msg);
|
||||||
|
let guide_id = match[1];
|
||||||
|
if (guide_id == 'all') {
|
||||||
|
guide_id = 0;
|
||||||
|
}
|
||||||
|
guide_id = Number(guide_id);
|
||||||
|
if (guide_id > this.maxNum) {
|
||||||
|
let reply_msg = [
|
||||||
|
'绝区零默认攻略设置方式为:',
|
||||||
|
'%设置默认攻略[0123...]',
|
||||||
|
`请增加数字0-${this.maxNum}其中一个,或者增加 all 以显示所有攻略`,
|
||||||
|
'攻略来源请输入 %攻略帮助 查看',
|
||||||
|
];
|
||||||
|
await this.e.reply(reply_msg.join('\n'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
settings.setSingleConfig('guide', 'default_guide', guide_id);
|
||||||
|
|
||||||
|
let source_name = guide_id == 0 ? 'all' : this.source[guide_id - 1];
|
||||||
|
await this.e.reply(`绝区零默认攻略已设置为: ${guide_id} (${source_name})`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 设置所有攻略显示个数 */
|
||||||
|
async setMaxForwardGuide() {
|
||||||
|
if (!this.e.isMaster) {
|
||||||
|
this.reply('仅限主人设置');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
let match = /设置所有攻略显示个数(\d+)$/g.exec(this.e.msg);
|
||||||
|
let max_forward_guide = Number(match[1]);
|
||||||
|
this.setSingleConfig('max_forward_guides', max_forward_guide);
|
||||||
|
await this.e.reply(`绝区零所有攻略显示个数已设置为: ${max_forward_guide}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue