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

nonebot2-beta1 分支的一些修复工作 #118

Merged

Conversation

shirokurakana
Copy link

现在这个分支其实根本没办法正常使用吧(
于是我做了点小工作,让所有功能能够正常使用。
首先要说的一点是,不要再用CQ码发消息了!!!
在接收消息时用CQ码去做正则匹配是没问题的,直接发CQ码的话首先nonebot和gocq官方都不推荐这种方式,其次有被注入的风险,再说了写起来也没MessageSegment方便吧(
于是我把发消息的地方全都改成构造MessageSegment的方式了(有个地方甚至神奇地直接构造Message然后往里面塞了个CQ码,叹为观止.jpg)
然后就是计划任务里面,获取Bot对象为啥不用get_bot我有点看不懂,在我看来就属于搁这搁这呢(而且也没写对啊x
还有就是获取命令参数那里写的也太扭曲了,看的血压飙升(小声bb)

@KimigaiiWuyi
Copy link
Owner

get_bot()方法在我的VPS环境下会出错,所以我一直用的(bot,) = nonebot.get_bots().values(),不知道beta1版本有无变化
MessageSegment这点确实,过段时间同步到a16版本

@KimigaiiWuyi KimigaiiWuyi merged commit 9597a6d into KimigaiiWuyi:nonebot2-beta1 Feb 16, 2022
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