RCS Message Skill
Send and receive SMS / RCS via the mobile SMS interface.Use when the user asks to send a text message, check text messages, use SMS, text message, RCS, or needs to forward or mass send received text messages.
Overview
This skill provides message sending capabilities through channel-based delivery with template support, fallback handling, and natural language command parsing.
Requirements
- - Python 3.6 or higher
- requests library
- python-dotenv library (optional)
- Valid API credentials (APPID, APPSECRET)
Configuration
API Endpoint
| Item | Value |
|---|
| API Server | INLINECODE0 (pre-configured) |
| Endpoint |
/messenger/api/v1/group/send |
| Method | POST |
Environment Variables
Set environment variables:
CODEBLOCK0
Or create a .env file in the project root:
CODEBLOCK1
Quick Reference
| Action | Command |
|---|
| Send text message | INLINECODE3 |
| Send template |
python3 send.py --type RCS --template-id "ID" -n "+8613700000001" |
| Validate only |
python3 send.py -n "+8613700000001" --dry-run |
Usage
Natural Language Commands
Use simple commands in Moltbot:
CODEBLOCK2
CODEBLOCK3
Command Line
Basic message sending:
CODEBLOCK4
Template message:
CODEBLOCK5
With fallback channels:
CODEBLOCK6
Parameters
| Parameter | Description |
|---|
| -n, --numbers | Recipient number(s), comma separated |
| -m, --message |
Message content for TEXT type |
| -t, --type | Message type: TEXT, RCS, AIM, MMS, SMS |
| --template-id | Template ID for non-TEXT types |
| --params | Template parameters as key:value pairs |
| --fallback-aim | Fallback template ID for AIM channel |
| --fallback-sms | Fallback content for SMS channel |
| --dry-run | Validate parameters without sending |
Message Types
| Type | Description |
|---|
| TEXT | Direct text content delivery |
| RCS |
Rich Communication Services messaging |
| AIM | Advanced Interactive Messaging |
| MMS | Multimedia Messaging Service |
| SMS | Short Message Service fallback |
Validation Rules
| Rule | Limit |
|---|
| Maximum recipients | 100 per request |
| Maximum message length |
1000 characters |
| Minimum interval | 60 seconds between requests |
| Number format | International format supported |
Troubleshooting
| Problem | Solution |
|---|
| Authentication Error (403) | Verify APPID and APPSECRET are correct. Confirm application is active. |
| Rate Limit Error |
Wait 60 seconds before retry. Adjust MIN
INTERVALSECONDS in config. |
| Format Error | Use international format (+8613700000001) or domestic format (13700000001). |
Enable debug mode for detailed output:
CODEBLOCK7
Project Structure
CODEBLOCK8
Limitations
- - API credentials required for authentication
- Rate limiting applies to prevent abuse
- Session management handled per deployment
Security
- - Credentials stored in environment variables
- No hardcoded sensitive values
- Input validation on all parameters
Version
1.0.0
RCS 消息技能
通过移动短信接口发送和接收短信/RCS。当用户要求发送短信、查看短信、使用短信、RCS,或需要转发或群发接收到的短信时使用。
概述
本技能提供基于渠道的消息发送能力,支持模板、回退处理及自然语言命令解析。
要求
- - Python 3.6 或更高版本
- requests 库
- python-dotenv 库(可选)
- 有效的 API 凭证(APPID、APPSECRET)
配置
API 端点
| 项目 | 值 |
|---|
| API 服务器 | https://5g.fontdo.com(预配置) |
| 端点 |
/messenger/api/v1/group/send |
| 方法 | POST |
环境变量
设置环境变量:
bash
export FIVEGAPP_ID=your-app-id
export FIVEGAPP_SECRET=your-app-secret
或在项目根目录创建 .env 文件:
bash
FIVEGAPP_ID=your-app-id
FIVEGAPP_SECRET=your-app-secret
快速参考
| 操作 | 命令 |
|---|
| 发送短信 | python3 send.py -n +8613700000001 -m Hello |
| 发送模板 |
python3 send.py --type RCS --template-id ID -n +8613700000001 |
| 仅验证 | python3 send.py -n +8613700000001 --dry-run |
使用方法
自然语言命令
在 Moltbot 中使用简单命令:
向 13700000001 发送消息,内容为 hello world
使用 RCS 模板 269000000000000000 向 13700000001 发送模板消息
命令行
基本消息发送:
bash
python3 send.py -n +8613700000001 -m Hello
模板消息:
bash
python3 send.py --type RCS --template-id TEMPLATE_ID -n +8613700000001 --params name:John,code:12345
带回退渠道:
bash
python3 send.py --type RCS --template-id TEMPLATEID -n +8613700000001 --fallback-aim FALLBACKID --fallback-sms SMS Content
参数
| 参数 | 描述 |
|---|
| -n, --numbers | 接收号码,多个号码用逗号分隔 |
| -m, --message |
TEXT 类型的消息内容 |
| -t, --type | 消息类型:TEXT、RCS、AIM、MMS、SMS |
| --template-id | 非 TEXT 类型的模板 ID |
| --params | 模板参数,格式为键:值对 |
| --fallback-aim | AIM 渠道的回退模板 ID |
| --fallback-sms | SMS 渠道的回退内容 |
| --dry-run | 验证参数但不发送 |
消息类型
富通信服务消息 |
| AIM | 高级交互消息 |
| MMS | 多媒体消息服务 |
| SMS | 短消息服务回退 |
验证规则
| 规则 | 限制 |
|---|
| 最大接收人数 | 每次请求最多 100 人 |
| 最大消息长度 |
1000 个字符 |
| 最小间隔 | 请求之间至少间隔 60 秒 |
| 号码格式 | 支持国际格式 |
故障排除
| 问题 | 解决方案 |
|---|
| 认证错误 (403) | 验证 APPID 和 APPSECRET 是否正确。确认应用处于激活状态。 |
| 速率限制错误 |
等待 60 秒后重试。调整配置中的 MIN
INTERVALSECONDS。 |
| 格式错误 | 使用国际格式 (+8613700000001) 或国内格式 (13700000001)。 |
启用调试模式以获取详细输出:
bash
python3 send.py -n +8613700000001 -m Test --debug
项目结构
rcs-message/
├── send.py # 核心发送模块
├── main.py # 入口文件
├── handleuserinput.py # 命令解析器
├── check_config.py # 配置验证器
├── config.example.json # 配置模板
└── USAGE_EXAMPLES.md # 更多示例
限制
- - 需要 API 凭证进行认证
- 存在速率限制以防止滥用
- 会话管理按部署实例处理
安全
- - 凭证存储在环境变量中
- 无硬编码敏感值
- 对所有参数进行输入验证
版本
1.0.0