dingrobot

package
v1.2.6-sp2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2023 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Robot

type Robot struct {
	// contains filtered or unexported fields
}

Robot represents a dingtalk custom robot that can send messages to groups.

func (*Robot) GetCurrentWebHook

func (r *Robot) GetCurrentWebHook() string

Fetcher Current Webhook

func (Robot) SendActionCard

func (r Robot) SendActionCard(title, text, singleTitle, singleURL, btnOrientation, hideAvatar string) error

SendActionCard send a action card type message.

func (r Robot) SendLink(title, text, messageURL, picURL string) error

SendLink send a link type message.

func (Robot) SendMarkdown

func (r Robot) SendMarkdown(title, text string, atMobiles []string, isAtAll bool) error

SendMarkdown send a markdown type message.

func (Robot) SendText

func (r Robot) SendText(content string, atMobiles []string, isAtAll bool) error

SendText send a text type message.

func (*Robot) SetSecret

func (r *Robot) SetSecret(secret string)

SetSecret set the secret to add additional signature when send request

type Roboter

type Roboter interface {
	SendText(content string, atMobiles []string, isAtAll bool) error
	SendLink(title, text, messageURL, picURL string) error
	SendMarkdown(title, text string, atMobiles []string, isAtAll bool) error
	SendActionCard(title, text, singleTitle, singleURL, btnOrientation, hideAvatar string) error
	SetSecret(secret string)
	GetCurrentWebHook() string
}

Roboter is the interface implemented by Robot that can send multiple types of messages.

func NewRobot

func NewRobot(webHook string) Roboter

NewRobot returns a roboter that can send messages.

type SilenceDingRobot

type SilenceDingRobot struct {
	Roboter
}

func NewSilenceDingRobot

func NewSilenceDingRobot() *SilenceDingRobot

func (*SilenceDingRobot) GetCurrentWebHook

func (s *SilenceDingRobot) GetCurrentWebHook() string

func (*SilenceDingRobot) SendActionCard

func (s *SilenceDingRobot) SendActionCard(title, text, singleTitle, singleURL, btnOrientation, hideAvatar string) error
func (s *SilenceDingRobot) SendLink(title, text, messageURL, picURL string) error

func (*SilenceDingRobot) SendMarkdown

func (s *SilenceDingRobot) SendMarkdown(title, text string, atMobiles []string, isAtAll bool) error

func (*SilenceDingRobot) SendText

func (s *SilenceDingRobot) SendText(content string, atMobiles []string, isAtAll bool) error

func (*SilenceDingRobot) SetSecret

func (s *SilenceDingRobot) SetSecret(secret string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL