From 2130ac1aba09f5a4d3298262646a100270ad7254 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?= <41315874+fumiama@users.noreply.github.com> Date: Mon, 20 Nov 2023 16:24:12 +0900 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20parameter=20`-qq`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 ++++-- main.go | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 865a416..272080d 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,8 @@ ## 命令行参数 > `[]`代表是可选参数 ```bash -nanobot [-Tadhst] ID1 ID2 ... - +nanobot [参数] ID1 ID2 ... +参数: -D enable debug-level log output -T int api timeout (s) (default 60) @@ -26,6 +26,8 @@ nanobot [-Tadhst] ID1 ID2 ... -h print this help -public only listen to public intent + -qq + also listen QQ intent -s string qq secret -sandbox diff --git a/main.go b/main.go index 477f714..f43a6fa 100644 --- a/main.go +++ b/main.go @@ -57,6 +57,7 @@ func main() { loadconfig := flag.String("c", "", "load from config") sandbox := flag.Bool("sandbox", false, "run in sandbox api") onlypublic := flag.Bool("public", false, "only listen to public intent") + addqqintent := flag.Bool("qq", false, "also listen QQ intent") shardindex := flag.Uint("shardindex", 0, "shard index") shardcount := flag.Uint("shardcount", 0, "shard count") savecfg := flag.String("save", "", "save bot config to filename (eg. config.yaml)") @@ -74,6 +75,9 @@ func main() { if *onlypublic { intent = nano.IntentGuildPublic } + if *addqqintent { + intent |= nano.IntentQQ + } sus := make([]string, 0, 16) for _, s := range flag.Args() {