Commit from m3o/m3o action

This commit is contained in:
m3o-actions
2021-11-03 15:36:34 +00:00
parent aecab5372c
commit 7335a0576f
182 changed files with 1044 additions and 517 deletions

View File

@@ -6,7 +6,7 @@ Endpoints:
## SendMessage
SendMessage a message to the stream.
Send a message to the stream.
[https://m3o.com/stream/api#SendMessage](https://m3o.com/stream/api#SendMessage)
@@ -21,8 +21,8 @@ import(
"go.m3o.com/stream"
)
// SendMessage a message to the stream.
func SendAmessage() {
// Send a message to the stream.
func SendMessage() {
streamService := stream.NewStreamService(os.Getenv("M3O_API_TOKEN"))
rsp, err := streamService.SendMessage(&stream.SendMessageRequest{
Channel: "general",

View File

@@ -0,0 +1,16 @@
package main
import (
"fmt"
"os"
"go.m3o.com/stream"
)
// List all the active channels
func main() {
streamService := stream.NewStreamService(os.Getenv("M3O_API_TOKEN"))
rsp, err := streamService.ListChannels(&stream.ListChannelsRequest{})
fmt.Println(rsp, err)
}

View File

@@ -0,0 +1,18 @@
package main
import (
"fmt"
"os"
"go.m3o.com/stream"
)
// List messages for a given channel
func main() {
streamService := stream.NewStreamService(os.Getenv("M3O_API_TOKEN"))
rsp, err := streamService.ListMessages(&stream.ListMessagesRequest{
Channel: "general",
})
fmt.Println(rsp, err)
}

View File

@@ -0,0 +1,19 @@
package main
import (
"fmt"
"os"
"go.m3o.com/stream"
)
// Send a message to the stream.
func main() {
streamService := stream.NewStreamService(os.Getenv("M3O_API_TOKEN"))
rsp, err := streamService.SendMessage(&stream.SendMessageRequest{
Channel: "general",
Text: "Hey checkout this tweet https://twitter.com/m3oservices/status/1455291054295498752",
})
fmt.Println(rsp, err)
}