Skip to content

Commit

Permalink
fix:子组件退出后,引起主线程退出的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
dezhishen committed Apr 9, 2022
1 parent b5263ba commit 04e2d56
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 57 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
.vscode/launch.json
plugins
fortune
configs
jrrp
bili-live.db
4 changes: 3 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
"mode": "debug",
"program": "${workspaceFolder}/cmd/main.go",
"cwd": "${workspaceFolder}",
"env": {}
"env": {
"PIXIV_PROXY": "socks5://192.168.31.169:20170"
}
},
{
"name": "examples.plugin",
Expand Down
4 changes: 2 additions & 2 deletions configs/bot.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
http:
schema: "http"
host: 127.0.0.1
host: 192.168.31.6
port: 5700
websocket:
host: 127.0.0.1
host: 192.168.31.6
port: 6700
plugins-path: "./plugins"
6 changes: 2 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/dezhishen/onebot-plus
go 1.17

require (
github.com/dezhishen/onebot-sdk v0.0.0-20220102031503-4457549ac71e
github.com/dezhishen/onebot-sdk v0.0.0-20220409082522-a2a5f0fe4560
github.com/sirupsen/logrus v1.8.1
google.golang.org/grpc v1.43.0
google.golang.org/protobuf v1.27.1
Expand All @@ -12,7 +12,7 @@ require (
require (
github.com/fatih/color v1.13.0 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/hashicorp/go-hclog v1.0.0 // indirect
github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb // indirect
github.com/kr/text v0.2.0 // indirect
Expand All @@ -29,7 +29,6 @@ require (
github.com/fsnotify/fsnotify v1.5.1 // indirect
github.com/hashicorp/go-plugin v1.4.3
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/klauspost/compress v1.10.3 // indirect
github.com/magiconair/properties v1.8.5 // indirect
github.com/mitchellh/mapstructure v1.4.3 // indirect
github.com/pelletier/go-toml v1.9.4 // indirect
Expand All @@ -46,5 +45,4 @@ require (
golang.org/x/text v0.3.7 // indirect
gopkg.in/ini.v1 v1.66.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
nhooyr.io/websocket v1.8.7 // indirect
)
53 changes: 4 additions & 49 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -90,22 +90,8 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dezhishen/onebot-sdk v0.0.0-20211231030002-ffe19b8713b4 h1:0mIBwruOKsUPjaWDdF22pEKiNldcwsJIeMn0dF8BTs8=
github.com/dezhishen/onebot-sdk v0.0.0-20211231030002-ffe19b8713b4/go.mod h1:ln6RQt0ghfMuPzOOhRQT8SHJOVRLZZQTS4dDMp8nRVI=
github.com/dezhishen/onebot-sdk v0.0.0-20211231043850-11b4c9e8649a h1:m6bkisI1ECC9oIUBl9uJVCWzTiXgXylJzFSOmLPVj5g=
github.com/dezhishen/onebot-sdk v0.0.0-20211231043850-11b4c9e8649a/go.mod h1:ln6RQt0ghfMuPzOOhRQT8SHJOVRLZZQTS4dDMp8nRVI=
github.com/dezhishen/onebot-sdk v0.0.0-20211231044434-cd27229f5155 h1:gbMcLiH+lRIzaMlp6BDRWAY+l6b7q2dBrcPxueuGldg=
github.com/dezhishen/onebot-sdk v0.0.0-20211231044434-cd27229f5155/go.mod h1:ln6RQt0ghfMuPzOOhRQT8SHJOVRLZZQTS4dDMp8nRVI=
github.com/dezhishen/onebot-sdk v0.0.0-20220101040945-4ae24177c73b h1:bVuWLstgushcfkpElhi6oCANBq+eiVOdS8GJezyNw5U=
github.com/dezhishen/onebot-sdk v0.0.0-20220101040945-4ae24177c73b/go.mod h1:ln6RQt0ghfMuPzOOhRQT8SHJOVRLZZQTS4dDMp8nRVI=
github.com/dezhishen/onebot-sdk v0.0.0-20220101042618-59ca22650c9e h1:4530vpWjwOar1hFZLA6gNA8X7Hm7jVzD+KxC+weXr0Q=
github.com/dezhishen/onebot-sdk v0.0.0-20220101042618-59ca22650c9e/go.mod h1:ln6RQt0ghfMuPzOOhRQT8SHJOVRLZZQTS4dDMp8nRVI=
github.com/dezhishen/onebot-sdk v0.0.0-20220101044732-c7864f62aa0a h1:0C/Rw2WZu4HH1J0zZjkjS10XD6MmuCusgGeqoaDCFsw=
github.com/dezhishen/onebot-sdk v0.0.0-20220101044732-c7864f62aa0a/go.mod h1:ln6RQt0ghfMuPzOOhRQT8SHJOVRLZZQTS4dDMp8nRVI=
github.com/dezhishen/onebot-sdk v0.0.0-20220101054117-099f770fe77f h1:uVfQoQEDiPaOnXhdMb+Tp98nBGi7LXjs7cNx2Tg9BeE=
github.com/dezhishen/onebot-sdk v0.0.0-20220101054117-099f770fe77f/go.mod h1:ln6RQt0ghfMuPzOOhRQT8SHJOVRLZZQTS4dDMp8nRVI=
github.com/dezhishen/onebot-sdk v0.0.0-20220102031503-4457549ac71e h1:VWmYIkzfo996tZIsBt82JwSErgpXwOwYrZuwFSV4DQ8=
github.com/dezhishen/onebot-sdk v0.0.0-20220102031503-4457549ac71e/go.mod h1:ln6RQt0ghfMuPzOOhRQT8SHJOVRLZZQTS4dDMp8nRVI=
github.com/dezhishen/onebot-sdk v0.0.0-20220409082522-a2a5f0fe4560 h1:BkMzcU38A/UGw2hLgMokA0aRPQTFoX1qpP2sqhFWyKU=
github.com/dezhishen/onebot-sdk v0.0.0-20220409082522-a2a5f0fe4560/go.mod h1:6QUuwA2jnGzTxF+ivPPdRgNeVqMhpg1hRQfRWZtOy/s=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
Expand All @@ -124,31 +110,14 @@ github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYF
github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI=
github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14=
github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M=
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q=
github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8=
github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no=
github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA=
github.com/go-playground/validator/v10 v10.2.0 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY=
github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0=
github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo=
github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8=
github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw=
github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo=
github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
Expand Down Expand Up @@ -225,9 +194,8 @@ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0=
github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM=
github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0=
github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms=
Expand Down Expand Up @@ -271,15 +239,12 @@ github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyX
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/klauspost/compress v1.10.3 h1:OP96hzwJVBIHYU52pVTI6CczrxPvrGfgqF9N5eTO0Q8=
github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
Expand All @@ -291,8 +256,6 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y=
github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII=
github.com/lyft/protoc-gen-star v0.5.3/go.mod h1:V0xaHgaf5oCCqmcxYcWiDfTiKsZsRc87/1qhoTACD8w=
github.com/magiconair/properties v1.8.5 h1:b6kJs+EmPFMYGkow9GiUyCyOvIwYetYJ3fSaWak/Gls=
github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60=
Expand Down Expand Up @@ -322,11 +285,9 @@ github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh
github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGgCcyj8cs=
github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw=
Expand Down Expand Up @@ -393,10 +354,6 @@ github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JT
github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs=
github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM=
github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo=
github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw=
github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs=
github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
Expand Down Expand Up @@ -843,8 +800,6 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
nhooyr.io/websocket v1.8.7 h1:usjR2uOr/zjjkVMy0lW+PPohFok7PCow5sDjLgX4P4g=
nhooyr.io/websocket v1.8.7/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
59 changes: 58 additions & 1 deletion pkg/plugin/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,10 @@ func (m *onebotEventPluginGRPCClientStub) Init(msgCli cli.OnebotCli) error {
go m.broker.AcceptAndServe(brokerID, serverFunc)
_, err := m.client.Init(context.Background(), &wrapperspb.UInt32Value{Value: brokerID})
// Init不会关闭连接
// s.Stop()
if err != nil {
return err
}
s.Stop()
return err
}

Expand All @@ -484,6 +487,9 @@ func (m *onebotEventPluginGRPCClientStub) BeforeExit(msgCli cli.OnebotCli) error
brokerID := m.broker.NextId()
go m.broker.AcceptAndServe(brokerID, serverFunc)
_, err := m.client.BeforeExit(context.Background(), &wrapperspb.UInt32Value{Value: brokerID})
if err != nil {
return err
}
s.Stop()
return err
}
Expand All @@ -507,6 +513,9 @@ func (m *onebotEventPluginGRPCClientStub) MessagePrivate(req *model.EventMessage
Message: msg,
Cli: brokerID,
})
if err != nil {
return err
}
s.Stop()
return err
}
Expand All @@ -530,6 +539,9 @@ func (m *onebotEventPluginGRPCClientStub) MessageGroup(req *model.EventMessageGr
Message: msg,
Cli: brokerID,
})
if err != nil {
return err
}
s.Stop()
return err
}
Expand All @@ -553,6 +565,9 @@ func (m *onebotEventPluginGRPCClientStub) MetaLifecycle(req *model.EventMetaLife
Message: msg,
Cli: brokerID,
})
if err != nil {
return err
}
s.Stop()
return err
}
Expand All @@ -576,6 +591,9 @@ func (m *onebotEventPluginGRPCClientStub) MetaHeartbeat(req *model.EventMetaHear
Message: msg,
Cli: brokerID,
})
if err != nil {
return err
}
s.Stop()
return err
}
Expand All @@ -599,6 +617,9 @@ func (m *onebotEventPluginGRPCClientStub) NoticeGroupUpload(req *model.EventNoti
Message: msg,
Cli: brokerID,
})
if err != nil {
return err
}
s.Stop()
return err
}
Expand All @@ -622,6 +643,9 @@ func (m *onebotEventPluginGRPCClientStub) NoticeGroupAdmin(req *model.EventNotic
Message: msg,
Cli: brokerID,
})
if err != nil {
return err
}
s.Stop()
return err
}
Expand All @@ -645,6 +669,9 @@ func (m *onebotEventPluginGRPCClientStub) NoticeGroupDecrease(req *model.EventNo
Message: msg,
Cli: brokerID,
})
if err != nil {
return err
}
s.Stop()
return err
}
Expand All @@ -668,6 +695,9 @@ func (m *onebotEventPluginGRPCClientStub) NoticeGroupIncrease(req *model.EventNo
Message: msg,
Cli: brokerID,
})
if err != nil {
return err
}
s.Stop()
return err
}
Expand All @@ -691,6 +721,9 @@ func (m *onebotEventPluginGRPCClientStub) NoticeGroupBan(req *model.EventNoticeG
Message: msg,
Cli: brokerID,
})
if err != nil {
return err
}
s.Stop()
return err
}
Expand All @@ -714,6 +747,9 @@ func (m *onebotEventPluginGRPCClientStub) NoticeGroupRecall(req *model.EventNoti
Message: msg,
Cli: brokerID,
})
if err != nil {
return err
}
s.Stop()
return err
}
Expand All @@ -737,6 +773,9 @@ func (m *onebotEventPluginGRPCClientStub) NoticeGroupNotifyPoke(req *model.Event
Message: msg,
Cli: brokerID,
})
if err != nil {
return err
}
s.Stop()
return err
}
Expand All @@ -760,6 +799,9 @@ func (m *onebotEventPluginGRPCClientStub) NoticeGroupNotifyLuckyKing(req *model.
Message: msg,
Cli: brokerID,
})
if err != nil {
return err
}
s.Stop()
return err
}
Expand All @@ -783,6 +825,9 @@ func (m *onebotEventPluginGRPCClientStub) NoticeGroupNotifyHonor(req *model.Even
Message: msg,
Cli: brokerID,
})
if err != nil {
return err
}
s.Stop()
return err
}
Expand All @@ -806,6 +851,9 @@ func (m *onebotEventPluginGRPCClientStub) NoticeFriendAdd(req *model.EventNotice
Message: msg,
Cli: brokerID,
})
if err != nil {
return err
}
s.Stop()
return err
}
Expand All @@ -829,6 +877,9 @@ func (m *onebotEventPluginGRPCClientStub) NoticeFriendRecall(req *model.EventNot
Message: msg,
Cli: brokerID,
})
if err != nil {
return err
}
s.Stop()
return err
}
Expand All @@ -852,6 +903,9 @@ func (m *onebotEventPluginGRPCClientStub) RequestFriend(req *model.EventRequestF
Message: msg,
Cli: brokerID,
})
if err != nil {
return err
}
s.Stop()
return err
}
Expand All @@ -875,6 +929,9 @@ func (m *onebotEventPluginGRPCClientStub) RequestGroup(req *model.EventRequestGr
Message: msg,
Cli: brokerID,
})
if err != nil {
return err
}
s.Stop()
return err
}
Expand Down

0 comments on commit 04e2d56

Please sign in to comment.