removed depricated parameters from slack functions, resolves #1402

pull/1412/head
Scott Anderson 2020-09-08 14:11:04 -06:00
parent 23047509b1
commit 63a9c8b536
2 changed files with 1 additions and 34 deletions

View File

@ -67,11 +67,8 @@ _**Data type:** Function_
The returned record must include the following fields:
- `username`
- `channel`
- `workspace`
- `text`
- `iconEmoji`
- `color`
_For more information, see [`slack.message()`](/influxdb/v2.0/reference/flux/stdlib/slack/message/)_
@ -92,11 +89,8 @@ crit_statuses = from(bucket: "example-bucket")
crit_statuses
|> e(mapFn: (r) => ({
username: r.username,
channel: r.channel,
workspace: r.workspace,
text: r.text,
iconEmoji: r.iconEmoji,
color: r.color,
})
)()

View File

@ -24,11 +24,8 @@ import "slack"
slack.message(
url: "https://slack.com/api/chat.postMessage",
token: "mySuPerSecRetTokEn",
username: "Fluxtastic",
channel: "#flux",
workspace: "",
channel: "#flux",,
text: "This is a message from the Flux slack.message() function.",
iconEmoji: "wave",
color: "good"
)
```
@ -57,39 +54,16 @@ A token is only required if using the Slack chat.postMessage API.
_**Data type:** String_
### username
The username to use when posting the message to a Slack channel. <span class="required">Required</span>
_**Data type:** String_
### channel
The name of channel to post the message to. <span class="required">Required</span>
_**Data type:** String_
### workspace
The name of the Slack workspace to use if there are multiple.
Defaults to `""`.
_**Data type:** String_
### text
The text to display in the Slack message. <span class="required">Required</span>
_**Data type:** String_
### iconEmoji
The name of emoji to use as the user avatar when posting the message to Slack.
<span class="required">Required</span>
_**Data type:** String_
{{% note %}}
#### Things to know about iconEmoji
- **Do not** enclose the name in colons `:` as you do in the Slack client.
- `iconEmoji` only appears as the user avatar when using the Slack chat.postMessage API.
{{% /note %}}
### color
The color to include with the message.
<span class="required">Required</span>
@ -120,7 +94,6 @@ lastReported =
slack.message(
url: "https://slack.com/api/chat.postMessage",
token: "mySuPerSecRetTokEn",
username: "johndoe",
channel: "#system-status",
text: "The last reported status was \"${lastReported.status}\"."
)