# dingding_robot **Repository Path**: xiaoxianlie/dingding_robot ## Basic Information - **Project Name**: dingding_robot - **Description**: 钉钉机器人发送文字/图片消息 - **Primary Language**: Unknown - **License**: GPL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2022-09-26 - **Last Updated**: 2022-09-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ### 获取组件包 ```cgo go get -u -insecure gitee.com/yebetter/dingding_robot ``` ### 使用方式 ``` //机器人申请的token accessToken := "机器人申请的token" //需要发送的消息 msg := "这是测试消息" //初始化 client := Robot.NewRobotApi(accessToken) //发送文字到钉钉群 client.SendMessage(msg) ``` ### 接口说明 ``` /** 发送图片机器人 在钉钉里面申请自定义机器人 @param path string 图片发送的地址 @return error 错误信息(成功返回nil) */ SendImage(path string) error /** 发送文字消息 在钉钉里面申请自定义机器人 @param msg string 发送的消息内容 @return error 错误信息(成功返回nil) */ SendMessage(msg string) error ```