Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: 添加启用/禁用指令 alias 功能 #298

Closed
Seidko opened this issue Sep 13, 2023 · 5 comments
Closed

Feature: 添加启用/禁用指令 alias 功能 #298

Seidko opened this issue Sep 13, 2023 · 5 comments

Comments

@Seidko
Copy link
Member

Seidko commented Sep 13, 2023

Describe the problem related to the feature request

为 commands 插件添加启用/禁用指令 shortcut 功能。

Describe the solution you'd like

为 commands 插件添加启用/禁用指令 shortcut 功能。

Describe alternatives you've considered

No response

Additional context

No response

@Seidko Seidko added the feature label Sep 13, 2023
@Hieuzest
Copy link

借个楼
希望添加禁用alias功能

此处的逻辑为

commands : alias <-> dialogue/action/* : shortcut
command.shortcut <-> predefined shortcut
command.alias <-> predefined alias

@shigma
Copy link
Member

shigma commented Sep 13, 2023

借个楼 希望添加禁用alias功能

现在没有吗?

@Hieuzest
Copy link

Hieuzest commented Sep 13, 2023

现在没有吗?

你看 shoutcut并不能从commands定义,所以我们讨论shortcut指的都是由代码定义的
所以alias也如是指

实际上我希望这些定义在代码里的逻辑成为开发者提供的建议,从美学上不应该写任何这种可定制的逻辑,但事实上不写的结果仍然是让用户遵循一份指南去手动往配置中添加这些内容。

也许更好的方案是在第一次初始化时将这些内容写进配置?我不清楚运行时由插件写配置的实践如何了,不过想来还需考虑控制台同步的问题,以及这毫无疑问从来不会是文档内容

EDIT:

从美学上不应该写任何这种可定制的逻辑

这里依据上下文指的是 【不应该在代码里写死这种可定制的逻辑】的意思

@ilharp
Copy link
Member

ilharp commented Sep 13, 2023

从美学上不应该写任何这种可定制的逻辑

Koishi 希望尽可能地满足任何用户的需求。插件中定义的指令配置是 Koishi 前几代均提供了的功能,保留此功能能够提升开发者升级和迁移的信心;同时这些功能仍然适合不使用插件逻辑规划功能的 Koishi 用户——他们可以将自己机器人的所有功能按逻辑分布在 ts 文件中,而不是将一个微小指令的逻辑和配置分离在两个文件。这么做是不使用 Koishi 配置文件的 Koishi 应用的美学(虽然既不提倡,也已经没有人这么做了)。


也许更好的方案是在第一次初始化时将这些内容写进配置?

我支持这个。


附:给不了解背景的同学一份前文:https://k.ilharp.cc/2666

@shigma shigma transferred this issue from koishijs/koishi Jan 18, 2024
@shigma
Copy link
Member

shigma commented Jan 18, 2024

更新:shortcut 功能现在已经废弃,推荐使用 alias。因此这个 issue 将用于讨论「添加启用/禁用指令 alias 功能」。

@shigma shigma changed the title Feature(commands): 添加启用/禁用指令 shortcut 功能 Feature: 添加启用/禁用指令 alias 功能 Jan 18, 2024
@shigma shigma closed this as completed in 82ed283 Jan 19, 2024
CyanChanges pushed a commit to CyanForks/webui that referenced this issue Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants