File tree 1 file changed +9
-0
lines changed 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ var _ Element = (*SelectMenuBlock)(nil)
4
4
5
5
// SelectMenuBlock 菜单元素
6
6
type SelectMenuBlock struct {
7
+ name string
7
8
tag string
8
9
placeholder string
9
10
initialOption string
@@ -14,6 +15,7 @@ type SelectMenuBlock struct {
14
15
15
16
type selectMenuRenderer struct {
16
17
ElementTag
18
+ Name string `json:"name,omitempty"`
17
19
Placeholder Renderer `json:"placeholder,omitempty"`
18
20
InitialOption string `json:"initial_option,omitempty"`
19
21
Options []Renderer `json:"options,omitempty"`
@@ -31,6 +33,7 @@ func (s *SelectMenuBlock) Render() Renderer {
31
33
Options : renderElements (s .options ),
32
34
Value : s .value ,
33
35
Placeholder : Text (s .placeholder ).Render (),
36
+ Name : s .name ,
34
37
}
35
38
if s .confirm != nil {
36
39
ret .Confirm = s .confirm .Render ()
@@ -50,6 +53,12 @@ func SelectMenu(opt ...*OptionBlock) *SelectMenuBlock {
50
53
return ret
51
54
}
52
55
56
+ // Name 菜单的标识
57
+ func (s * SelectMenuBlock ) Name (n string ) * SelectMenuBlock {
58
+ s .name = n
59
+ return s
60
+ }
61
+
53
62
// SelectPerson 选人模式,value应设置为人员的open_id,options 为空则候选人员为当前群组
54
63
func (s * SelectMenuBlock ) SelectPerson () * SelectMenuBlock {
55
64
s .tag = "select_person"
You can’t perform that action at this time.
0 commit comments