mirror of
https://github.com/ZZZure/ZZZ-Plugin.git
synced 2025-12-17 13:47:44 +00:00
移除apps插件非必要return false,拦截指令向后传递 #138
This commit is contained in:
parent
3273f256fc
commit
9d676fa70a
17 changed files with 82 additions and 173 deletions
|
|
@ -3,24 +3,21 @@ import settings from '../../lib/settings.js';
|
|||
/** 设置渲染精度 */
|
||||
export async function setRenderPrecision() {
|
||||
if (!this.e.isMaster) {
|
||||
this.reply('仅限主人设置', false, { at: true, recallMsg: 100 });
|
||||
return false;
|
||||
return this.reply('仅限主人设置', false, { at: true, recallMsg: 100 });
|
||||
}
|
||||
const match = /渲染精度(\d+)$/g.exec(this.e.msg);
|
||||
const render_precision = Number(match[1]);
|
||||
if (render_precision < 50) {
|
||||
await this.e.reply('渲染精度不能小于50', false, {
|
||||
return this.e.reply('渲染精度不能小于50', false, {
|
||||
at: true,
|
||||
recallMsg: 100,
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (render_precision > 200) {
|
||||
await this.e.reply('渲染精度不能大于200', false, {
|
||||
return this.e.reply('渲染精度不能大于200', false, {
|
||||
at: true,
|
||||
recallMsg: 100,
|
||||
});
|
||||
return false;
|
||||
}
|
||||
settings.setSingleConfig('config', 'render', {
|
||||
scale: render_precision,
|
||||
|
|
@ -31,24 +28,21 @@ export async function setRenderPrecision() {
|
|||
/** 设置刷新抽卡间隔 */
|
||||
export async function setRefreshGachaInterval() {
|
||||
if (!this.e.isMaster) {
|
||||
this.reply('仅限主人设置', false, { at: true, recallMsg: 100 });
|
||||
return false;
|
||||
return this.reply('仅限主人设置', false, { at: true, recallMsg: 100 });
|
||||
}
|
||||
const match = /刷新抽卡间隔(\d+)$/g.exec(this.e.msg);
|
||||
const refresh_gacha_interval = Number(match[1]);
|
||||
if (refresh_gacha_interval < 0) {
|
||||
await this.e.reply('刷新抽卡间隔不能小于0秒', false, {
|
||||
return this.e.reply('刷新抽卡间隔不能小于0秒', false, {
|
||||
at: true,
|
||||
recallMsg: 100,
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (refresh_gacha_interval > 1000) {
|
||||
await this.e.reply('刷新抽卡间隔不能大于1000秒', false, {
|
||||
return this.e.reply('刷新抽卡间隔不能大于1000秒', false, {
|
||||
at: true,
|
||||
recallMsg: 100,
|
||||
});
|
||||
return false;
|
||||
}
|
||||
settings.setSingleConfig('gacha', 'interval', refresh_gacha_interval);
|
||||
await this.e.reply(`绝区零刷新抽卡间隔已设置为: ${refresh_gacha_interval}`);
|
||||
|
|
@ -57,24 +51,21 @@ export async function setRefreshGachaInterval() {
|
|||
/** 设置刷新面板间隔 */
|
||||
export async function setRefreshPanelInterval() {
|
||||
if (!this.e.isMaster) {
|
||||
this.reply('仅限主人设置', false, { at: true, recallMsg: 100 });
|
||||
return false;
|
||||
return this.reply('仅限主人设置', false, { at: true, recallMsg: 100 });
|
||||
}
|
||||
const match = /刷新面板间隔(\d+)$/g.exec(this.e.msg);
|
||||
const refresh_panel_interval = Number(match[1]);
|
||||
if (refresh_panel_interval < 0) {
|
||||
await this.e.reply('刷新面板间隔不能小于0秒', false, {
|
||||
return this.e.reply('刷新面板间隔不能小于0秒', false, {
|
||||
at: true,
|
||||
recallMsg: 100,
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (refresh_panel_interval > 1000) {
|
||||
await this.e.reply('刷新面板间隔不能大于1000秒', false, {
|
||||
return this.e.reply('刷新面板间隔不能大于1000秒', false, {
|
||||
at: true,
|
||||
recallMsg: 100,
|
||||
});
|
||||
return false;
|
||||
}
|
||||
settings.setSingleConfig('panel', 'interval', refresh_panel_interval);
|
||||
await this.e.reply(
|
||||
|
|
@ -87,24 +78,21 @@ export async function setRefreshPanelInterval() {
|
|||
/** 设置角色刷新间隔 */
|
||||
export async function setRefreshCharInterval() {
|
||||
if (!this.e.isMaster) {
|
||||
this.reply('仅限主人设置', false, { at: true, recallMsg: 100 });
|
||||
return false;
|
||||
return this.reply('仅限主人设置', false, { at: true, recallMsg: 100 });
|
||||
}
|
||||
const match = /刷新角色间隔(\d+)$/g.exec(this.e.msg);
|
||||
const refresh_char_interval = Number(match[1]);
|
||||
if (refresh_char_interval < 0) {
|
||||
await this.e.reply('刷新角色间隔不能小于0秒', false, {
|
||||
return this.e.reply('刷新角色间隔不能小于0秒', false, {
|
||||
at: true,
|
||||
recallMsg: 100,
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (refresh_char_interval > 1000) {
|
||||
await this.e.reply('刷新角色间隔不能大于1000秒', false, {
|
||||
return this.e.reply('刷新角色间隔不能大于1000秒', false, {
|
||||
at: true,
|
||||
recallMsg: 100,
|
||||
});
|
||||
return false;
|
||||
}
|
||||
settings.setSingleConfig('panel', 'roleInterval', refresh_char_interval);
|
||||
await this.e.reply(`绝区零刷新角色间隔已设置为: ${refresh_char_interval}秒`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue