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

[kook] support kook adapter #1

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

[kook] support kook adapter #1

wants to merge 2 commits into from

Conversation

Krysztal112233
Copy link

TODO List

  • 实现服务器与频道的映射关系
  • 验证是否可以成功接入Kook
  • 实现KMarkdown格式的消息(使用Kook官方工具设计)
  • 验证是否可以接入PSMB

@Krysztal112233
Copy link
Author

@inclyc 这些东西需要你的帮助,我不清楚PSMB的具体情况 还有dotenv的map怎么写我也不清楚

ENVIRONMENT=prod
ENVIRONMENT=dev

kook_bots=[{"token": "1/MTI0MDU=/tD9NHswpnFPvIj1Pmcpk1A=="}]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个是适合写到仓库里的吗?不是的话最好别写(安全性)
你可以force-push这个分支,或者我之后rebase掉

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个文件理应不commit上来,你本地开发过后别stage这个文件就行,远程写成prod

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个地方是公用配置 而且已经是失效的token作为例子,没有安全担忧

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

一般.dot文件里只有一个字段ENVIRONMENT,指定用哪个env。比如用prod则程序会读入.env.prod。你本地开发可以把测试字段写在.env.dev文件当中,而不修改.env文件

@@ -29,5 +29,6 @@


if __name__ == "__main__":
logger.warning("Always use `nb run` to start the bot instead of manually running!")
logger.warning(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

格式化有关的不要出现在同一个commit当中,你可以单独格式化一个commit直接提交到主线,消息中注明NFC,不需要review.

Link: llvm/llvm-project@f749b2d

client_id: int # 客户端ID用来鉴别是否为自己,ID相同,则认为是同一个
client_name: str # 客户端名,用来在MC服务端中写策略
group_id: int # 对哪个群作出反应,群号
psmb_host: str # PSMB Server
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上

@@ -6,5 +6,5 @@ CLIENT_ID=1
CLIENT_NAME=qqbot
PSMB_ID_PATTERN=topic
PSMB_TOPIC=topic
GROUP_ID=123456
GROUP_SERVER_MAPPING={"CHANNEL":"SERVER"}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个CHANNEL是填写类似频道UUID/ID之类的东西还是填写频道名字?最好是频道ID,因为之后可能改名。

"SERVER" 同上,psmb其实是给了每个服务器一个id的

Link: https://github.com/hit-mc/hitmc-messages/blob/52c9910980d6baed48fecb7b27adb99b2550c69f/hitmc_messages/message.py#L23

pydantic
pydantic~=1.9.2

loguru~=0.6.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

似乎没有看到import loguru,这个应该会被按照依赖安装

@inclyc
Copy link
Contributor

inclyc commented Oct 8, 2022

我们可能不是migrate到Kook, 而是support这个平台。

hit-mc/hitmc#3 现在这个平台还不是特别完善。


可能需要一些时间等玩家迁移到Kook, QQ群用于广播消息

@inclyc inclyc changed the title [migrate] Migrate to Kook Adapter [kook] support kook adapter Oct 8, 2022
@inclyc
Copy link
Contributor

inclyc commented Oct 9, 2022

CC @alxndrt0512

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

Successfully merging this pull request may close these issues.

2 participants