Versions in this module Expand all Collapse all v2 v2.1.0 Jan 10, 2024 Changes in this version type BotOptions + HookAfterMessageApply func(body *MessageBody) error + func (opts *BotOptions) SetHookAfterMessageApply(f func(body *MessageBody) error) *BotOptions v2.0.0 Jan 2, 2024 Changes in this version + func TextAtEveryone() string + func TextAtPerson(id, name string) string + type Bot interface + SendCard func(globalConf *CardGlobalConfig, card *CardBuilder, multiLanguage ...*CardBuilder) error + SendCardViaTemplate func(id string, variables any) error + SendGroupBusinessCard func(chatID string) error + SendImage func(imgKey string) error + SendMessage func(msg Message) error + SendRichText func(rt *RichTextBuilder, multiLanguage ...*RichTextBuilder) error + SendText func(content string) error + func NewBot(webhook string, opts *BotOptions) Bot + type BotOptions struct + BaseURL string + LimiterPerMinute int + LimiterPerSecond int + SecretKey string + func NewBotOptions() *BotOptions + func (opts *BotOptions) SetBaseURL(s string) *BotOptions + func (opts *BotOptions) SetLimiterPerMinute(n int) *BotOptions + func (opts *BotOptions) SetLimiterPerSecond(n int) *BotOptions + func (opts *BotOptions) SetSecretKey(s string) *BotOptions + type CardBuilder struct + func NewCard(language Language, title string) *CardBuilder + func (cb *CardBuilder) Elements(elements []CardElement) *CardBuilder + func (cb *CardBuilder) HeaderSubtitle(subtitle string) *CardBuilder + func (cb *CardBuilder) HeaderTextTags(tags []CardHeaderTextTag) *CardBuilder + type CardElement interface + Entity func() any + func NewCardElementHorizontalRule() CardElement + type CardElementAction struct + func NewCardElementAction() *CardElementAction + func (e *CardElementAction) Actions(actions []CardElementActionComponent) *CardElementAction + func (e *CardElementAction) Entity() any + func (e *CardElementAction) Layout(layout CardElementActionLayout) *CardElementAction + type CardElementActionButton struct + func NewCardElementActionButton(mode CardElementDivTextMode, content string) *CardElementActionButton + func (e *CardElementActionButton) ActionEntity() any + func (e *CardElementActionButton) Confirm(title, text string) *CardElementActionButton + func (e *CardElementActionButton) MultiURL(defaultURL, pc, ios, android string) *CardElementActionButton + func (e *CardElementActionButton) Type(typ CardElementActionButtonType) *CardElementActionButton + func (e *CardElementActionButton) URL(s string) *CardElementActionButton + type CardElementActionButtonType string + const CardElementActionButtonTypeDanger + const CardElementActionButtonTypeDefault + const CardElementActionButtonTypePrimary + type CardElementActionComponent interface + ActionEntity func() any + type CardElementActionLayout string + const CardElementActionLayoutBisected + const CardElementActionLayoutFlow + const CardElementActionLayoutTrisection + type CardElementActionOverflow struct + func NewCardElementActionOverflow() *CardElementActionOverflow + func (e *CardElementActionOverflow) ActionEntity() any + func (e *CardElementActionOverflow) AddOptionWithMultiURL(text, defaultURL, pc, ios, android string) *CardElementActionOverflow + func (e *CardElementActionOverflow) AddOptionWithURL(text, defaultURL string) *CardElementActionOverflow + func (e *CardElementActionOverflow) Confirm(title, text string) *CardElementActionOverflow + type CardElementColumnSet struct + func NewCardElementColumnSet() *CardElementColumnSet + func (e *CardElementColumnSet) ActionMultiURL(defaultURL, pc, ios, android string) *CardElementColumnSet + func (e *CardElementColumnSet) BackgroundStyle(bs CardElementColumnSetBackgroundStyle) *CardElementColumnSet + func (e *CardElementColumnSet) Columns(columns []*CardElementColumnSetColumn) *CardElementColumnSet + func (e *CardElementColumnSet) Entity() any + func (e *CardElementColumnSet) FlexMode(mode CardElementColumnSetFlexMode) *CardElementColumnSet + func (e *CardElementColumnSet) HorizontalSpacing(hs CardElementColumnSetHorizontalSpacing) *CardElementColumnSet + type CardElementColumnSetBackgroundStyle string + const CardElementColumnSetBackgroundStyleDefault + const CardElementColumnSetBackgroundStyleGrey + type CardElementColumnSetColumn struct + func NewCardElementColumnSetColumn() *CardElementColumnSetColumn + func (e *CardElementColumnSetColumn) Elements(elements []CardElement) *CardElementColumnSetColumn + func (e *CardElementColumnSetColumn) VerticalAlign(va CardElementColumnSetColumnVerticalAlign) *CardElementColumnSetColumn + func (e *CardElementColumnSetColumn) Weight(n int) *CardElementColumnSetColumn + func (e *CardElementColumnSetColumn) Width(width CardElementColumnSetColumnWidth) *CardElementColumnSetColumn + type CardElementColumnSetColumnVerticalAlign string + const CardElementColumnSetColumnVerticalAlignBottom + const CardElementColumnSetColumnVerticalAlignCenter + const CardElementColumnSetColumnVerticalAlignTop + type CardElementColumnSetColumnWidth string + const CardElementColumnSetColumnWidthAuto + const CardElementColumnSetColumnWidthWeighted + type CardElementColumnSetFlexMode string + const CardElementColumnSetFlexModeBisect + const CardElementColumnSetFlexModeFlow + const CardElementColumnSetFlexModeNone + const CardElementColumnSetFlexModeStretch + const CardElementColumnSetFlexModeTrisect + type CardElementColumnSetHorizontalSpacing string + const CardElementColumnSetHorizontalSpacingDefault + const CardElementColumnSetHorizontalSpacingSmall + type CardElementDiv struct + func NewCardElementDiv() *CardElementDiv + func (e *CardElementDiv) Entity() any + func (e *CardElementDiv) ExtraAction(component CardElementActionComponent) *CardElementDiv + func (e *CardElementDiv) ExtraImage(imgKey string, preview bool, altContent string) *CardElementDiv + func (e *CardElementDiv) Fields(fields []CardElementDivFieldText) *CardElementDiv + func (e *CardElementDiv) LarkMarkdown(content string) *CardElementDiv + func (e *CardElementDiv) PlainText(content string, lines int) *CardElementDiv + type CardElementDivFieldText struct + Content string + IsShort bool + Lines int + Mode CardElementDivTextMode + type CardElementDivTextMode string + const CardElementDivTextModeLarkMarkdown + const CardElementDivTextModePlainText + type CardElementHorizontalRule struct + func (e *CardElementHorizontalRule) Entity() any + type CardElementImage struct + func NewCardElementImage(imgKey, altContent string) *CardElementImage + func (e *CardElementImage) CompactWidth(b bool) *CardElementImage + func (e *CardElementImage) CustomWidth(px int) *CardElementImage + func (e *CardElementImage) Entity() any + func (e *CardElementImage) Mode(mode CardElementImageMode) *CardElementImage + func (e *CardElementImage) Preview(b bool) *CardElementImage + func (e *CardElementImage) TitleWithLarkMarkdown(title string) *CardElementImage + func (e *CardElementImage) TitleWithPlainText(title string) *CardElementImage + type CardElementImageMode string + const CardElementImageModeCropCenter + const CardElementImageModeFitHorizontal + const CardElementImageModeLarge + const CardElementImageModeMedium + const CardElementImageModeSmall + const CardElementImageModeStretch + const CardElementImageModeTiny + type CardElementMarkdown struct + func NewCardElementMarkdown(content string) *CardElementMarkdown + func (e *CardElementMarkdown) Content(content string) *CardElementMarkdown + func (e *CardElementMarkdown) Entity() any + func (e *CardElementMarkdown) Href(defaultURL, pc, ios, android string) *CardElementMarkdown + func (e *CardElementMarkdown) TextAlign(textAlign CardElementMarkdownTextAlign) *CardElementMarkdown + type CardElementMarkdownTextAlign string + const CardElementMarkdownTextAlignCenter + const CardElementMarkdownTextAlignLeft + const CardElementMarkdownTextAlignRight + type CardElementNote struct + func NewCardElementNote() *CardElementNote + func (e *CardElementNote) AddElementWithImage(imgKey string, preview bool, altContent string) *CardElementNote + func (e *CardElementNote) AddElementWithLarkMarkdown(s string) *CardElementNote + func (e *CardElementNote) AddElementWithPlainText(s string) *CardElementNote + func (e *CardElementNote) Entity() any + type CardGlobalConfig struct + func NewCardGlobalConfig() *CardGlobalConfig + func (gConf *CardGlobalConfig) CardLink(defaultURL, pc, ios, android string) *CardGlobalConfig + func (gConf *CardGlobalConfig) ConfigEnableForward(b bool) *CardGlobalConfig + func (gConf *CardGlobalConfig) ConfigUpdateMulti(b bool) *CardGlobalConfig + func (gConf *CardGlobalConfig) HeaderIcon(imgKey string) *CardGlobalConfig + func (gConf *CardGlobalConfig) HeaderTemplate(template CardHeaderTemplate) *CardGlobalConfig + type CardHeaderTemplate string + const CardHeaderTemplateBlue + const CardHeaderTemplateCarmine + const CardHeaderTemplateDefault + const CardHeaderTemplateGreen + const CardHeaderTemplateGrey + const CardHeaderTemplateIndigo + const CardHeaderTemplateOrange + const CardHeaderTemplatePurple + const CardHeaderTemplateRed + const CardHeaderTemplateTurquoise + const CardHeaderTemplateViolet + const CardHeaderTemplateWathet + const CardHeaderTemplateYellow + type CardHeaderTextTag struct + Color CardHeaderTextTagColor + Content string + type CardHeaderTextTagColor string + const CardHeaderTextTagColorBlue + const CardHeaderTextTagColorCarmine + const CardHeaderTextTagColorGreen + const CardHeaderTextTagColorIndigo + const CardHeaderTextTagColorLime + const CardHeaderTextTagColorNeutral + const CardHeaderTextTagColorOrange + const CardHeaderTextTagColorPurple + const CardHeaderTextTagColorRed + const CardHeaderTextTagColorTurquoise + const CardHeaderTextTagColorViolet + const CardHeaderTextTagColorWathet + const CardHeaderTextTagColorYellow + type Language string + const LanguageChinese + const LanguageEnglish + const LanguageJapanese + type Message interface + Apply func(body *MessageBody) error + type MessageBody struct + Card *json.RawMessage + Content *MessageBodyContent + MsgType string + type MessageBodyCard struct + CardLink *json.RawMessage + Config *json.RawMessage + Elements *json.RawMessage + Header *json.RawMessage + I18nElements *json.RawMessage + type MessageBodyCardTemplate struct + Data MessageBodyCardTemplateData + Type string + type MessageBodyCardTemplateData struct + TemplateID string + TemplateVariable *json.RawMessage + type MessageBodyContent struct + ImageKey string + Post *json.RawMessage + ShareChatID string + Text string + type RichTextBuilder struct + func NewRichText(language Language, title string) *RichTextBuilder + func (rtb *RichTextBuilder) At(id, name string) *RichTextBuilder + func (rtb *RichTextBuilder) AtEveryone() *RichTextBuilder + func (rtb *RichTextBuilder) Hyperlink(text, href string) *RichTextBuilder + func (rtb *RichTextBuilder) Image(imgKey string) *RichTextBuilder + func (rtb *RichTextBuilder) Text(text string, unEscape bool) *RichTextBuilder Other modules containing this package github.com/electricbubble/feishu-bot-api