Documentation ¶
Index ¶
- type Article
- type CommonSend
- type FileType
- type ImageType
- type MarkdownType
- type NewsType
- type SendReq
- type SendResponse
- type Sender
- type TemplateCard
- type TemplateCardAction
- type TemplateCardActionMenu
- type TemplateCardButtonList
- type TemplateCardButtonSelection
- type TemplateCardEmphasisContent
- type TemplateCardHorizontal
- type TemplateCardImage
- type TemplateCardImageText
- type TemplateCardMainTitle
- type TemplateCardQuoteArea
- type TemplateCardSource
- type TemplateCardVerticalContent
- type TemplateJumpList
- type TextType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommonSend ¶
type MarkdownType ¶
type MarkdownType struct { //markdown内容,最长不超过4096个字节,必须是utf8编码。点击查看目前支持的markdown语法 //特殊的,content中支持<@userid>的@人语法,开发者可以通过回调事件中获取userid Content string `json:"content"` }
type SendReq ¶
type SendReq struct { CommonSend Text *TextType `json:"text,omitempty"` Markdown *MarkdownType `json:"markdown,omitempty"` Image *ImageType `json:"image,omitempty"` News *NewsType `json:"news,omitempty"` File *FileType `json:"file,omitempty"` TemplateCard *TemplateCard `json:"template_card,omitempty"` }
type SendResponse ¶
type Sender ¶
type Sender interface { Text(chatID string, msg string, mentionedList []string) error Markdown(chatID string, msg string) error Image(chatID string, b []byte) error News(chatID string, arts []Article) error TextNoticeCard(chatID string, t *TemplateCard) error NewsNoticeCard() error ButtonCard() error VoteCard() error MultipleCard() error }
type TemplateCard ¶
type TemplateCard struct { //模版卡片的模版类型,文本通知模版卡片的类型为text_notice CardType string `json:"card_type"` //卡片来源样式信息,不需要来源样式可不填写 Source *TemplateCardSource `json:"source,omitempty"` //卡片右上角更多操作按钮 ActionMenu *TemplateCardActionMenu `json:"action_menu,omitempty"` //模版卡片的主要内容,包括一级标题和标题辅助信息 MainTitle *TemplateCardMainTitle `json:"main_title,omitempty"` //关键数据样式,建议不与引用样式共用 EmphasisContent *TemplateCardEmphasisContent `json:"emphasis_content,omitempty"` //引用文献样式,建议不与关键数据共用 QuoteArea *TemplateCardQuoteArea `json:"quote_area,omitempty"` //二级普通文本,建议不超过112个字。模版卡片主要内容的一级标题main_title.title和二级普通文本sub_title_text必须有一项填写 SubTitleText string `json:"sub_title_text,omitempty"` //二级标题+文本列表,该字段可为空数组,但有数据的话需确认对应字段是否必填,列表长度不超过6 HorizontalContentList []*TemplateCardHorizontal `json:"horizontal_content_list,omitempty"` //跳转指引样式的列表,该字段可为空数组,但有数据的话需确认对应字段是否必填,列表长度不超过3 JumpList []*TemplateJumpList `json:"jump_list,omitempty"` //整体卡片的点击跳转事件,text_notice模版卡片中该字段为必填项 CardAction *TemplateCardAction `json:"card_action"` //图片样式,news_notice类型的卡片,card_image和image_text_area两者必填一个字段,不可都不填 CardImage *TemplateCardImage `json:"card_image,omitempty"` //左图右文样式 ImageText *TemplateCardImageText `json:"image_text,omitempty"` //卡片二级垂直内容,该字段可为空数组,但有数据的话需确认对应字段是否必填,列表长度不超过4 VerticalContent []*TemplateCardVerticalContent `json:"vertical_content,omitempty"` //下拉式的选择器 ButtonSelection *TemplateCardButtonSelection `json:"button_selection,omitempty"` //按钮列表,列表长度不超过6 ButtonList []*TemplateCardButtonList `json:"button_list,omitempty"` //任务id,当文本通知模版卡片有action_menu字段的时候,该字段必填。 //同一个机器人任务id不能重复,只能由数字、字母和“_-@”组成,最长128字节。任务id只在发消息时候有效,更新消息的时候无效。 //任务id将会在相应的回调事件中返回 TaskID string `json:"task_id,omitempty"` }
type TemplateCardAction ¶
type TemplateCardAction struct { //卡片跳转类型,0或不填代表不是链接,1 代表跳转url,2 代表打开小程序。text_notice模版卡片中该字段取值范围为[1,2] Type int `json:"type"` //跳转事件的url,card_action.type是1时必填 URL string `json:"url,omitempty"` //跳转事件的小程序的appid,card_action.type是2时必填 AppID string `json:"appid,omitempty"` //跳转事件的小程序的pagepath,card_action.type是2时选填 Pagepath string `json:"pagepath,omitempty"` }
type TemplateCardActionMenu ¶
type TemplateCardButtonList ¶
type TemplateCardButtonSelection ¶
type TemplateCardButtonSelection struct { //下拉式的选择器的key,用户提交选项后,会产生回调事件,回调事件会带上该key值表示该题,最长支持1024字节 QuestionKey string `json:"question_key"` //下拉式的选择器左边的标题 Title string `json:"title,omitempty"` //下拉式的选择器是否不可选,false为可选,true为不可选。仅在更新模版卡片的时候该字段有效 Disable bool `json:"disable,omitempty"` //选项列表,下拉选项不超过 10 个,最少1个 OptionList struct { //下拉式的选择器选项的id,用户提交后,会产生回调事件,回调事件会带上该id值表示该选项,最长支持128字节,不可重复 ID string `json:"id"` //下拉式的选择器选项的文案,建议不超过16个字 Text string `json:"text"` } `json:"option_list"` //默认选定的id,不填或错填默认第一个 SelectedID string `json:"selected_id"` }
type TemplateCardHorizontal ¶
type TemplateCardHorizontal struct { //链接类型,0或不填代表是普通文本,1 代表跳转url,2 代表下载附件,3 代表点击跳转成员详情 Type int `json:"type,omitempty"` //二级标题,建议不超过5个字 Keyname string `json:"keyname"` //二级文本,如果horizontal_content_list.type是2,该字段代表文件名称(要包含文件类型),建议不超过26个字 Value string `json:"value,omitempty"` //链接跳转的url,horizontal_content_list.type是1时必填 URL string `json:"url,omitempty"` //附件的media_id,horizontal_content_list.type是2时必填 MediaID string `json:"media_id,omitempty"` //成员详情的userid,horizontal_content_list.type是3时必填 UserID string `json:"user_id,omitempty"` }
type TemplateCardImage ¶
type TemplateCardImageText ¶
type TemplateCardImageText struct { //左图右文样式区域点击事件,0或不填代表没有点击事件,1 代表跳转url,2 代表跳转小程序 Type int `json:"type,omitempty"` //点击跳转的url,image_text_area.type是1时必填 URL string `json:"url,omitempty"` //点击跳转的小程序的appid,必须是与当前应用关联的小程序,image_text_area.type是2时必填 AppID string `json:"appid,omitempty"` //点击跳转的小程序的pagepath,image_text_area.type是2时选填 Pagepath string `json:"pagepath,omitempty"` //左图右文样式的标题 Title string `json:"title,omitempty"` //左图右文样式的描述 Desc string `json:"desc,omitempty"` //左图右文样式的图片url ImageURL string `json:"image_url"` }
type TemplateCardMainTitle ¶
type TemplateCardQuoteArea ¶
type TemplateCardQuoteArea struct { //引用文献样式区域点击事件,0或不填代表没有点击事件,1 代表跳转url,2 代表跳转小程序 Type int `json:"type,omitempty"` //点击跳转的url,quote_area.type是1时必填 URL string `json:"url,omitempty"` //点击跳转的小程序的appid,必须是与当前应用关联的小程序,quote_area.type是2时必填 AppID string `json:"appid,omitempty"` //点击跳转的小程序的pagepath,quote_area.type是2时选填 Pagepath string `json:"pagepath,omitempty"` //引用文献样式的标题 Title string `json:"title,omitempty"` //引用文献样式的引用文案 QuoteText string `json:"quote_text,omitempty"` }
type TemplateCardSource ¶
type TemplateJumpList ¶
type TemplateJumpList struct { //跳转链接类型,0或不填代表不是链接,1 代表跳转url,2 代表跳转小程序 Type int `json:"type,omitempty"` //跳转链接样式的文案内容,建议不超过13个字 Title string `json:"title"` //跳转链接的url,jump_list.type是1时必填 URL string `json:"url,omitempty"` //跳转链接的小程序的appid,jump_list.type是2时必填 AppID string `json:"appid,omitempty"` //跳转链接的小程序的pagepath,jump_list.type是2时选填 Pagepath string `json:"pagepath,omitempty"` }
type TextType ¶
type TextType struct { Content string `json:"content"` //userid的列表,提醒群中的指定成员(@某个成员),@all表示提醒所有人,开发者可以通过回调事件中获取userid。 //如果开发者获取不到userid,可以使用mentioned_mobile_list MentionedList []string `json:"mentioned_list,omitempty"` //手机号列表,提醒手机号对应的群成员(@某个成员),@all表示提醒所有人 MentionedMobileList []string `json:"mentioned_mobile_list,omitempty"` }
Click to show internal directories.
Click to hide internal directories.