Git Product home page Git Product logo

txcnm's People

Contributors

othinus001 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

lvwenzhuo2003

txcnm's Issues

一些改进

  • 适应linux:
    • 路径拼接可以用os.path.join,适应windowslinux的的路径。
    • 杀掉go-cqhttp进程的话windows使用taskkilllinux需要使用killpkill。可以看os.name是不是posix来决定用哪个。不过这个我也没找到python提供的可以适应不同系统下的杀掉进程函数
  • 增加切号昵称:输入要切换的昵称比如xcw而不用输对应的Q号,感觉会更便捷点

然后结合我自己的情况:我同时会开多个go-cqhttp(其中一个接入hoshino其他的就挂机升级),就发现杀掉进程有点棘手:因为taskkill命令或pkill命令根据进程名字杀掉,这会把所有的go-cqhttp都杀掉,而不能精确地杀掉我想要的那个进程。

然后碰巧我之前使用了pm2管理我的go-cqhttp。通过pm2可以精确地控制QQ号对应的go-cqhttp,且通过简单的start stop指令就可以启动、停止相关的任务,以及logs指令查看最新的日志(但不能继上次读取位置往下读,不过也可以指定其日志路径,然后读对应的日志文件,这样相比直接读go-cqhttp少了日期切换时日志文件刷新的麻烦)。而且pm2支持windows,linux,命令行下命令都一样,本身跨平台。

于是我就对您的代码进行了重写,依靠pm2进行日志读取和go-cqhttp的切换,目前在测试中。不过鉴于重写后的代码与您的代码出入过大了,可能会重开一个仓库。

关于go-cqhttp的切换,就是说比如我有两个Q号,实则每个Q号启动了两个任务,其中一个是接入hoshino,另一个单纯挂机(反代是disablego-cqhttp启动时可以指定配置文件),这样当切号时就可以保持两个Q号还上线的情况下,换了另一个号接管hoshino

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.