File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ type ButtonBlock struct {
12
12
value map [string ]interface {}
13
13
confirm * ConfirmBlock
14
14
actionType string
15
+ width string
15
16
}
16
17
17
18
type buttonRenderer struct {
@@ -24,6 +25,7 @@ type buttonRenderer struct {
24
25
Value map [string ]interface {} `json:"value,omitempty"`
25
26
Confirm Renderer `json:"confirm,omitempty"`
26
27
ActionType string `json:"action_type,omitempty"`
28
+ Width string `json:"width,omitempty"`
27
29
}
28
30
29
31
// Render 渲染为 Renderer
@@ -38,6 +40,7 @@ func (b *ButtonBlock) Render() Renderer {
38
40
Type : b .btnType ,
39
41
Value : b .value ,
40
42
ActionType : b .actionType ,
43
+ Width : b .width ,
41
44
}
42
45
if b .multiURL != nil {
43
46
ret .MultiURL = b .multiURL .Render ()
@@ -65,6 +68,12 @@ func (b *ButtonBlock) ActionType(actionType string) *ButtonBlock {
65
68
return b
66
69
}
67
70
71
+ // Width 按钮的宽度
72
+ func (b * ButtonBlock ) Width (w string ) * ButtonBlock {
73
+ b .width = w
74
+ return b
75
+ }
76
+
68
77
// URL 按钮的跳转链接
69
78
func (b * ButtonBlock ) URL (u string ) * ButtonBlock {
70
79
b .url = u
You can’t perform that action at this time.
0 commit comments