user_bot

package
v0.0.0-...-efd361b Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2021 License: LGPL-2.1 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// 自建应用如下,应用商店应用去掉internal/
	FeishuTenantAccessToken = "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal/"
	FeishuBatchGetId        = "https://open.feishu.cn/open-apis/user/v1/batch_get_id"
	FeishuMsgSend           = "https://open.feishu.cn/open-apis/message/v4/send/"
	FeishuMsgBatchSend      = "https://open.feishu.cn/open-apis/message/v4/batch_send/"
)

Variables

This section is empty.

Functions

func FeishuSendCommMsg

func FeishuSendCommMsg(alert *dropbox.AlertPostCommApi) error

func FeishuSendCommMsgV2

func FeishuSendCommMsgV2(alert *dropbox.CommonAlert, groups []interface{}) error

func InitFeishuBot

func InitFeishuBot()

Types

type FeishuBatchGetIdResponse

type FeishuBatchGetIdResponse struct {
	Code int                 `json:"code"`
	Msg  string              `json:"msg"`
	Data FeishuUserBatchData `json:"data"`
}

type FeishuCert

type FeishuCert struct {
	ID     string `json:"app_id"`
	Secret string `json:"app_secret"`
}

func (*FeishuCert) FeishuMsgBatchSendWithPost

func (c *FeishuCert) FeishuMsgBatchSendWithPost(ops dropbox.AlertPostCommApi, users []string) error

func (*FeishuCert) FeishuMsgCardBatchSend

func (c *FeishuCert) FeishuMsgCardBatchSend(content *string, chatids []string) error

func (*FeishuCert) GetToken

func (c *FeishuCert) GetToken() (string, error)

func (*FeishuCert) GetUserId

func (c *FeishuCert) GetUserId(params map[string][]string) []string

func (*FeishuCert) TokenHeader

func (c *FeishuCert) TokenHeader() (*http.HeaderOption, error)

type FeishuMsgPostBatchSend

type FeishuMsgPostBatchSend struct {
	Users   []string          `json:"user_ids"`
	MsgType string            `json:"msg_type"`
	Content map[string]string `json:"content"`
}

func OpsApiDataToFeishuBatchTemp

func OpsApiDataToFeishuBatchTemp(ops dropbox.AlertPostCommApi, users []string) *FeishuMsgPostBatchSend

type FeishuTokenRespon

type FeishuTokenRespon struct {
	Code   uint   `json:"code"`
	Expire int    `json:"expire"`
	Msg    string `json:"msg"`
	Token  string `json:"tenant_access_token"`
}

type FeishuUserBatchData

type FeishuUserBatchData struct {
	Emails         map[string][]*FeishuUserData `json:"email_users"`
	EmailNotExist  []string                     `json:"emails_not_exist"`
	Mobiles        map[string][]*FeishuUserData `json:"mobile_users"`
	MobileNotExist []string                     `json:"mobiles_not_exist"`
}

type FeishuUserData

type FeishuUserData struct {
	OpenId string `json:"open_id"`
	UserId string `json:"user_id"`
}

type MsgCardRequest

type MsgCardRequest struct {
	ChatId  string                 `json:"chat_id"`
	Card    map[string]interface{} `json:"card"`
	MsgType string                 `json:"msg_type"` //interactive"
}

res, err := customBot.CommSendPostMsg(url)

logger.Infof("{\"信息内容\":\"%s\",\"请求返回是\":\"%s\"}", *content, res)
//alert.ReportCC() 暂停统计
if err != nil {
	logger.Error("send msg to group failed by ", err, " group is ", group)
	errors = append(errors, err)

	continue
	//异常组发送失败不退出,继续执行
	//return res, err
}

type MsgCardResponse

type MsgCardResponse struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
}

Jump to

Keyboard shortcuts

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