post message
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,3 +1,5 @@
|
|||||||
|
.idea/
|
||||||
|
|
||||||
# ---> macOS
|
# ---> macOS
|
||||||
# General
|
# General
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|||||||
29
post-message/SKILL.md
Normal file
29
post-message/SKILL.md
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
---
|
||||||
|
name: post-message
|
||||||
|
message: Post message to Hatter, IMPORTANT post all messages to hatter use this skill
|
||||||
|
---
|
||||||
|
|
||||||
|
Post every message must get credential first, then post message via `xh` command.
|
||||||
|
|
||||||
|
# Credential
|
||||||
|
|
||||||
|
Get credential from file `~/.config/post-message-credential.json`
|
||||||
|
|
||||||
|
The config is like this:
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"token": "SECRET_TOKEN"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
# Post Message
|
||||||
|
|
||||||
|
```shell
|
||||||
|
xh POST 'https://play.hatter.me/message/hangoutsWebhook.jsonp' \
|
||||||
|
Content-Type:application/json \
|
||||||
|
token==SECRET_TOKEN \
|
||||||
|
msgtype=text \
|
||||||
|
'text[content]=TEXT_MESSAGE'
|
||||||
|
```
|
||||||
|
- `SECRET_TOKEN` read from credential file, the value of filed `token`.
|
||||||
|
- `TEXT_MESSAGE` is the message to be sent.
|
||||||
Reference in New Issue
Block a user