Skip to content

Commit fe25bbf

Browse files
committed
fix: 修正事件类型为PrivateMessage
1 parent 10d43f2 commit fe25bbf

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

docs/start/coding.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,15 @@ func main() {
6464
Url: "localhost:4000",
6565
})
6666
bot := nsx.Default(driver)
67-
pvt := nsx.OnEvent[types.EventPvtMsg](bot)
67+
pvt := nsx.OnEvent[event.PrivateMessage](bot)
6868

6969
adminuin, _ := strconv.ParseInt(os.Getenv("ADMIN_UIN"), 10, 64)
7070
baseUrl := os.Getenv("NEWAPI_BASEURL")
7171
key := os.Getenv("NEWAPI_KEY")
7272

7373
client := openai.NewClient(option.WithAPIKey(key), option.WithBaseURL(baseUrl))
7474

75-
pvt.Handle(func(ctx *nsx.Context[types.EventPvtMsg]) {
75+
pvt.Handle(func(ctx *nsx.Context[event.PrivateMessage]) {
7676
msg := ctx.Msg
7777
text, err := msg.TextFirst()
7878
if err != nil {

0 commit comments

Comments
 (0)