Local files before sync with remote
This commit is contained in:
24
tools/kb-bot/send.sh
Executable file
24
tools/kb-bot/send.sh
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
# send.sh —— 手动发一条 markdown 消息到飞书群(P2-a 验证发消息通路)
|
||||
#
|
||||
# 用法:
|
||||
# bash tools/kb-bot/send.sh <chat-id> "markdown 内容"
|
||||
# # chat-id 用 lark-cli im +chat-search --query "群名" 查
|
||||
#
|
||||
# 加 --dry-run 只打印不发。
|
||||
set -euo pipefail
|
||||
export PATH="$HOME/.npm-global/bin:$PATH"
|
||||
|
||||
CHAT_ID="${1:-}"
|
||||
CONTENT="${2:-}"
|
||||
|
||||
if [ -z "$CHAT_ID" ] || [ -z "$CONTENT" ]; then
|
||||
echo "用法: bash tools/kb-bot/send.sh <chat-id> \"markdown 内容\"" >&2
|
||||
echo "提示: 先用 lark-cli im +chat-search --query \"群名\" 查 chat-id" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
lark-cli im +messages-send \
|
||||
--chat-id "$CHAT_ID" \
|
||||
--markdown "$CONTENT" \
|
||||
--as bot
|
||||
Reference in New Issue
Block a user