
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
With a single HTTP request, you can post a message, creating the channel first if it doesn't exist and invite people and groups.
Runs as a server, listening for an HTTP request. Upon receipt of a message, the gateway:
This removes the complexity of orchestrating many Slack API calls behind a simple endpoint.
If you'd like to run Slack Gateway yourself as a Docker container, you can do the following:
docker run -d \ --env SLACK_USER_TOKEN="CHANGEME" \ --env SLACK_CHANNEL_MEMBERS="jsmith,mjones" \ --publish 8080:8080 \ outofcoffee/slack-gateway
Note: See the Environment variables section for the available configuration settings.
Send a message to a channel:
curl http://localhost:8080/messages/raw \ --header "Content-Type: application/json" \ --data '{"channel":"general", text":"Hello World!"}'
Send a message with attachments:
curl http://localhost:8080/messages/raw \ --header "Content-Type: application/json" \ --data '{"channel":"general", text":"Hello World!","attachments":[{"text":"More info","color":"#33ee33"}]}'
For more information on the Slack post message format, see [***]
If you don't want to compose the JSON yourself, you can use a simpler, but slightly more limited, key-value format instead.
Send a message to a channel:
curl http://localhost:8080/messages/text \ --data 'channel=general' \ --data 'text=Hello%20World!'
Send a message as an attachment:
curl http://localhost:8080/messages/text \ --data 'channel=general' \ --data 'text=Hello%20World!' \ --data 'title=Attachment' \ --data 'attachment=true' \ --data 'color=00ff00'
The example above will send the text message as an attachment, with a particular colour and title.
The available options for the key-value format are:
| Key | Required | Type | Purpose |
|---|---|---|---|
| channel | Yes | String | Channel name |
| text | Yes, unless additional message keys used | String | Literal message text |
| attachment | No | Boolean | Whether to send in attachment mode |
| title | No | String | Attachment title |
| color | No | String | Attachment color |
| author_name | No | String | Attachment author name |
| title_link | No | String | Attachment title link URL |
| footer | No | String | Attachment footer text |
| footer_icon | No | String | Attachment footer icon URL |
| Additional message keys | No, unless text is e***y | String | See below |
Additional message keys
When using the key-value format, any additional keys are appended to the text message. For example:
curl http://localhost:8080/messages/text \ --data 'channel=general' \ --data 'key_one=foo' \ --data 'key_two=bar' \ --data 'key_three=baz'
This will result in message text such as the following:
key one: *foo* | key two: *bar* | key three: *baz*
Note that underscores in key names are replaced with spaces, and the values are emboldened.
You can specify the channel type as public or private. This will be used when creating channels, or posting messages.
Set the channel_type query parameter in the HTTP request, or use the DEFAULT_CREATE_CHANNEL_TYPE environment variable.
Valid values:
Example using the query parameter:
curl http://localhost:8080/messages/text \ --data 'channel=some-private-channel' \ --data 'text=Hello%20world' \ --data 'channel_type=private'
As a Slack admin, create a Slack app: [***]
Add a bot user in the 'Bot Users' section:
[***]<your app ID>/bots
Add the required scopes in the 'OAuth & Permissions' section:
[***]<your app ID>/oauth
The scopes are:
chat:write:bot channels:read channels:write groups:read groups:write users:read usergroups:read
Don't forget to save changes after adding scopes.
Install your app to your workspace. This will generate two tokens.
Copy the 'OAuth Access Token' and set it as the SLACK_USER_TOKEN. It should look like this:
xoxp-123456789012-123456789012-123456789012-abcdef***abcdef***
Copy the 'Bot User OAuth Access Token' and set it as the SLACK_BOT_TOKEN. It should look like this:
xoxb-123456789012-123456789012-abcdef***abcdef***
Don't forget to invite your app to any existing private channels, using:
/invite @YourAppName
Slack doesn't permit apps to post to channels unless they have permissions.
Configure the bot using the following environment variables.
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务