Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to send nailing Robot message by Golang

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces the relevant knowledge of "how to send nailing robot messages by Golang". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

To create a nailing robot, you must use the endorsement method.

1. Install the ding module package

Go get-u github.com/wanghuiyt/ding

two。 Ordinary group messages are used

Use your own generated AccessToken and Secret

D: = ding.Webhook {AccessToken: "8c03f...", Secret: "SECef..."}

_ = d.SendMessage ("this is a normal group message")

Effect:

Detailed tutorial

Create a nailing robot (you must use endorsement)

Get access_token and Secret:

Access_token is a parameter in the url of Webhook.

Secret is the value of the endorsement.

Using Golang docking

We use the https://www.cnblogs.com/wanghuiyt/p/github.com/wanghuiyt/ding package.

Installation:

Go get-u github.com/wanghuiyt/ding

Use:

Package mainimport "github.com/wanghuiyt/ding" func main () {d: = ding.Webhook {AccessToken: "8c03f234ddf2a7555.", / / the access_token Secret obtained above: "SECefded9b38b761f." / / the value of the endorsement obtained above} _ = d.SendMessage ("this is an ordinary group message")} "how to send nailing robot messages by Golang" is introduced here. Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report