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: callme服务 #1035

Open
Coin0804 opened this issue Mar 23, 2023 · 4 comments
Open

Feature: callme服务 #1035

Coin0804 opened this issue Mar 23, 2023 · 4 comments
Labels
feature 新特性

Comments

@Coin0804
Copy link

Describe the problem related to the feature request

我现在在开发trpgdice这个插件发现callme之后我就尝试去使用它来为我的插件增添一个定制昵称的功能,以更加符合跑团时的称呼。但我发现,callme只是把name写进了数据库,而我要调用的话实际上没有一个接口,而是要到数据库里直接读取。我就想,要是callme是一个服务就好了。

Describe the solution you'd like

如果把callme做成一个可选服务的话,在其他插件中就可以尝试通过callme服务的某些方法,例如callme.getNick来获取可能的昵称,而不必非得直接依赖于数据库读取不一定存在的昵称。

Describe alternatives you've considered

我还考虑过新写一个插件,来提供callme的服务,这个插件依赖database,也是可以实现的,但既然单独把callme已经做成插件了,那由callme直接提供callme服务显然是更佳选择。

Additional context

No response

@Coin0804 Coin0804 added the feature 新特性 label Mar 23, 2023
@shigma
Copy link
Member

shigma commented Mar 23, 2023

目前来说直接从 database 读取是很方便的(指令中直接配置 userFields 即可)。

此外 callme 的功能也在考虑继续完善,你有什么建议的话也可以在下面说。

@Coin0804
Copy link
Author

目前来说直接从 database 读取是很方便的(指令中直接配置 userFields 即可)。

此外 callme 的功能也在考虑继续完善,你有什么建议的话也可以在下面说。

唔,如果将callme作为完整的全功能称呼插件,我希望能提供以下功能:

  • 当平台为onebot且处于群聊时,以群名片作为默认称呼
  • 为每个群单独保存昵称
  • 高权限者可以设置其他人的昵称,最好能批量设置
  • 为其他插件提供服务,输入session,按照如下规则返回称呼
    • 处于群聊
      • 数据库中有该群聊中该用户的昵称
        • 返回昵称
      • 数据库中没有该群聊中该用户的昵称
        • 处于onebot平台
          • 返回群名片
        • 处于其他平台
          • 同私聊
    • 处于私聊
      • 数据库中有昵称
        • 返回昵称
      • 数据库中无昵称
        • 返回用户名

当然,这其中的实现涉及到依赖问题,作为官方插件,callme实际上不该有过多依赖,具体的功能未必需要这么复杂,如果能起到一些帮助作用就足够了。

@purerosefallen
Copy link
Member

Why don't you use session.username?

@Coin0804
Copy link
Author

Why don't you use session.username?

When people playing TRPG(Tabletop Role-Playing Game), they always playing in a role.
Forexample, my name is Alice in the game.
When I roll a dice, the bot return a info like "coin0804 rolled 1d100=50"(session.username is coin0804).
However, it supposed to be "Alice rolled 1d100=50".
Player won't like to change is't name which is used as session.username.
So I need another way to set nickname.
The 'callme' plugin is already exists and is offical.
I hope it could be well used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 新特性
Projects
None yet
Development

No branches or pull requests

3 participants