Skip to content

Commit

Permalink
Merge pull request #2 from WindowsSov8forUs/master
Browse files Browse the repository at this point in the history
add: 添加 Interaction 资源 model,修改部分错误命名字段,添加了一处测试用例
  • Loading branch information
WindowsSov8forUs committed Apr 15, 2024
2 parents 07d2aa2 + 6322ed6 commit bdf6644
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 22 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.vscode/
18 changes: 0 additions & 18 deletions .vscode/launch.json

This file was deleted.

8 changes: 4 additions & 4 deletions pkg/guildmember/guildmember.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package guildmember
import "github.com/satori-protocol-go/satori-model-go/pkg/user"

type GuildMember struct {
User *user.User `json:"user"`
Nick string `json:"nick"`
Avatar string `json:"avatar"`
JoinAt int64 `json:"join_at"`
User *user.User `json:"user"`
Nick string `json:"nick"`
Avatar string `json:"avatar"`
JoinedAt int64 `json:"joined_at"`
}

type GuildMemberList struct {
Expand Down
11 changes: 11 additions & 0 deletions pkg/interaction/interaction.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package interaction

type Argv struct {
Name string `json:"name"`
Arguments []interface{} `json:"arguments"`
Options map[string]interface{} `json:"options"`
}

type Button struct {
Id string `json:"id"`
}
7 changes: 7 additions & 0 deletions pkg/message/parser_test_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ func _getRawMessage() map[string][]string {
raw_message["meta"] = _getMetaRawMessage()
raw_message["interact"] = _getInteractRawMessage()
raw_message["extend"] = _getExtendRawMessage()
raw_message["escape"] = _getEscapeRawMessage()
return raw_message
}

Expand Down Expand Up @@ -71,3 +72,9 @@ func _getExtendRawMessage() []string {
`<test:test test="test">test</test:test>`,
}
}

func _getEscapeRawMessage() []string {
return []string{
`<author id="&lt;test&gt;" name="&quot;u&amp;i&quot;">&lt;film&amp;audio&gt;&quot;inner&quot;</author>`,
}
}

0 comments on commit bdf6644

Please sign in to comment.