-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(teams): use better URL format and nicer output (#117)
* fix(teams): use multi-card messages, add title and color fields via pkr * fix(teams): add tests and fix token/url validation * fix(teams): simplify init * feat(teams): add support for custom hosts * fix: add comments and fix names/styling * test(router): test for successful custom URL init
- Loading branch information
Showing
6 changed files
with
347 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,25 @@ | ||
package teams | ||
|
||
// JSON is the actual payload being sent to the teams api | ||
type JSON struct { | ||
CardType string `json:"@type"` | ||
Context string `json:"@context"` | ||
Markdown bool `json:"markdown,bool"` | ||
Text string `json:"text,omitempty"` | ||
type payload struct { | ||
CardType string `json:"@type"` | ||
Context string `json:"@context"` | ||
Markdown bool `json:"markdown,bool"` | ||
Text string `json:"text,omitempty"` | ||
Title string `json:"title,omitempty"` | ||
Summary string `json:"summary,omitempty"` | ||
Sections []section `json:"sections,omitempty"` | ||
ThemeColor string `json:"themeColor,omitempty"` | ||
} | ||
|
||
type section struct { | ||
Text string `json:"text,omitempty"` | ||
ActivityText string `json:"activityText,omitempty"` | ||
StartGroup bool `json:"startGroup"` | ||
Facts []fact `json:"facts,omitempty"` | ||
} | ||
|
||
type fact struct { | ||
Key string `json:"key"` | ||
Value string `json:"value"` | ||
} |
Oops, something went wrong.