Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

go-cqhttp 增加了一个 Account.SignServer 字段用来配置签名服务器,有考虑加上吗? #653

Closed
TheLZY opened this issue Jun 27, 2023 · 6 comments · Fixed by #654
Labels
enhancement New feature or request

Comments

@TheLZY
Copy link
Contributor

TheLZY commented Jun 27, 2023

Mrs4s/go-cqhttp#2242

还是直接改template比较方便?

@mnixry
Copy link
Owner

mnixry commented Jun 27, 2023

这个字段能留空吗(
能留空的话你PR一个把这个加到默认Template里面吧,留空加一行注释

@mnixry mnixry added the enhancement New feature or request label Jun 27, 2023
@TheLZY
Copy link
Contributor Author

TheLZY commented Jun 27, 2023

https://github.com/Mrs4s/go-cqhttp/blob/9c1390c75c97bbed5b153abffaa45b2ed3a1c360/cmd/gocq/main.go#L167C2-L173C3
看起来是可以留空的

不过鉴于大概率很多人会蹭别人搭的服务,会经常改,似乎留一个配置比较好(
晚上我有电脑了研究研究再扔叭(

@TheLZY
Copy link
Contributor Author

TheLZY commented Jun 29, 2023

试了一下,并不能留空,默认是 sign-server: '-'
当然设置为 '' 也不会使用
其他版本的go-cqhttp倒是不会读这个字段,加进去似乎不会影响运行
姑且先提一个pr罢(

不过按照评论 Mrs4s/go-cqhttp#2245 (comment) ,用了自建的签名服务器后冻结的概率仍然很高,有没有效果还是可以再观望一下(

@mnixry
Copy link
Owner

mnixry commented Jun 29, 2023

我过会可能还需要改一下生成device.json的逻辑,现在生成的Android ID是每个账号不一样的,会比较麻烦

@moemeow233
Copy link

moemeow233 commented Jul 1, 2023

大佬,试了一下在config.yml里添加sign-server: 'http://127.0.0.1:8080'之后启动bot,但是还是输出未使用签名服务器,请问如何解决?
log
config

@TheLZY
Copy link
Contributor Author

TheLZY commented Jul 1, 2023

大佬,试了一下在config.yml里添加sign-server: 'http://127.0.0.1:8080'之后启动bot,但是还是输出未使用签名服务器,请问如何解决? log config

if not self.config.exists:
self.config.generate()
self.config.before_run()

def before_run(self):
template_string = self.read()
host = (
"127.0.0.1"
if driver_config.host.is_loopback or driver_config.host.is_unspecified
else driver_config.host
)
rendered_string = chevron.render(
template_string,
data={
"account": self.account,
"server_address": f"ws://{host}:{driver_config.port}/onebot/v11/ws",
"access_token": onebot_config.onebot_access_token or "",
},
)
return self.config_path.write_text(rendered_string, encoding="utf-8")

每次开启应该都会根据template重新生成
所以可以试试直接改template(

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants