package
1.2.1
Repository: https://github.com/sari3l/notify.git
Documentation: pkg.go.dev

# README

Zulip

文档 https://zulip.com/api/send-message

配置信息

关键配置类型zulipyaml读取yaml可选
Webhookstringwebhook
BotEmailstringbotEmail
BotKeystringbotKey
  • Webhook: https://{{zulip.domain}}.zulipchat.com/api/v1/messages

参数配置类型zulipyaml读取yaml可选
Typestringtypetype
Tostringtoto
Contentstringcontentcontent
Topic*stringtopictopic
QueueId*stringqueue_idqueueId
LocalId*stringlocal_idlocalId
  • Type: private | stream
  • To:
    • steam: "xxxxxx"
    • private: "[9,10]"

For stream messages, either the name or integer ID of the stream. For private messages, either a list containing integer user IDs or a list containing string email addresses.

调用

yaml

zulip:
  - notifyLevel: 1
    notifyFormatter: ["{{data}}"]
    webhook: "https://xxxxxxx.zulipchat.com/api/v1/messages"
    botEmail: "[email protected]"
    botKey: "iSaTzykqgY0xxxxxxx"
    type: "stream"
    to: "general"
    content: "Hello from notify. {{data}}"

api

opt := zulip.Option{
    Webhook:  "https://xxxxxxx.zulipchat.com/api/v1/messages",
    BotEmail: "[email protected]",
    BotKey:   "iSaTzykqgY0xxxxxxx",
}
opt.Type = "stream"
opt.To = "general"
opt.Content = "Hello from notify."
err := opt.ToNotifier().Send(nil)
if err != nil {
    fmt.Println(err)
}