matrix-notify

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Matrix Notify — Matrix Protocol Messaging

Matrix Notify — Matrix协议消息发送工具

Send messages to Matrix (Element) chat rooms with support for rich formatting and file uploads.
向Matrix(Element)聊天室发送消息,支持富文本格式和文件上传。

Overview

概述

This skill provides:
  • Text Messages: Plain text, markdown, and HTML
  • Rich Content: Images, files, and code blocks
  • Room Management: Join, leave, and list rooms
  • Thread Support: Reply to specific messages
  • Typing Indicators: Show typing status
  • Read Receipts: Mark messages as read
该技能提供以下功能:
  • 文本消息:纯文本、markdown和HTML格式
  • 富内容:图片、文件和代码块
  • 房间管理:加入、离开和列出房间
  • 线程支持:回复特定消息
  • 输入状态提示:显示输入状态
  • 已读回执:标记消息为已读

Configuration

配置

json
{
  "homeserver": "https://matrix.org",
  "access_token": "YOUR_ACCESS_TOKEN",
  "default_room": "!roomid:matrix.org"
}
json
{
  "homeserver": "https://matrix.org",
  "access_token": "YOUR_ACCESS_TOKEN",
  "default_room": "!roomid:matrix.org"
}

API

API

javascript
const { sendMessage, uploadFile } = require('./matrix-notify');

// Send text message
await sendMessage({
  room: '!roomid:matrix.org',
  text: 'Hello from PopeBot!',
  format: 'markdown'
});

// Send image
await uploadFile({
  room: '!roomid:matrix.org',
  file: '/path/to/image.png',
  caption: 'Check this out'
});
javascript
const { sendMessage, uploadFile } = require('./matrix-notify');

// Send text message
await sendMessage({
  room: '!roomid:matrix.org',
  text: 'Hello from PopeBot!',
  format: 'markdown'
});

// Send image
await uploadFile({
  room: '!roomid:matrix.org',
  file: '/path/to/image.png',
  caption: 'Check this out'
});

CLI

CLI

bash
matrix-notify send --room "!roomid:matrix.org" --text "Hello!"
matrix-notify upload --room "!roomid:matrix.org" --file image.png
matrix-notify rooms
bash
matrix-notify send --room "!roomid:matrix.org" --text "Hello!"
matrix-notify upload --room "!roomid:matrix.org" --file image.png
matrix-notify rooms