Swiftpack.co - iWECon/dingbot as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by iWECon.
iWECon/dingbot 2.0.5
钉钉机器人 Swift, Dingbot, DingtalkBot
⭐️ 0
🕓 11 weeks ago
iOS macOS linux
.package(url: "https://github.com/iWECon/dingbot.git", from: "2.0.5")


DingTalk bot (webhook).

钉钉自定义机器人,支持文本消息(Text Message)、链接消息(Link Message)以及Markdown Message.

支持 Vapor.


支持全局统一或单独定义 accessToken、加签 signKey;

// 全局统一, 这里配置完成后, 使用 Dingbot.shared.send(_:) 默认均使用该配置
Dingbot.shared.configure = Dingbot.Configure(accessToken: String, signKey: String)

// 独立定义, 使用 .send(_:configure:) 时,将独立配置添加进去即优先使用独立配置
Dingbot.shared.send(_ message: DingbotMessage, configure: Dingbot.Configure)


// 文本消息 TextMessage

Dingbot.TextMessage("Input your text message", at: `Dingbot.At?`)

// 链接消息 LinkMessage
Dingbot.LinkMessage(title: String, text: String, messageUrl: String, picUrl: String? = nil)

// 富文本 MarkdownMessage
Dingbot.MarkdownMessage(title: String, content: String, at: Dingbot.At? = nil)

// Dingbot.At
Dingbot.At(atMobiles: [String]? = nil, atUserIds: [String]? = nil, isAtAll: Bool = false)

// send
let (data, response) = try await Dingbot.shared.send(Dingbot.TextMessage/LinkMessage/MarkdownMessage)
     ⬆️ Data, ⬆️ URLResponse

Platform version

使用 concurrency,可能需要支持的系统版本偏高:

iOS v13 or up;

macOS v12 or up;

linux swift >= 5.6.1;

Vapor Support

import Vapor
import Dingbot

public extension Request {

    var dingbot: Dingbot {


public extension Application {

    var dingbot: Dingbot {



.package(url: "https://github.com/iWECon/Dingbot.git", from: "2.0.0")


Stars: 0
Last commit: 11 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

Swift 5.6.1 +
11 weeks ago

Fix on Swift 5.6.1+, test on Ubuntu 20.04 Swift 5.6.1-focal

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics