mirror of
https://github.com/kevin-DL/m3o-go.git
synced 2026-01-16 20:54:36 +00:00
Commit from m3o/m3o action
This commit is contained in:
@@ -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",
|
||||
|
||||
16
examples/stream/listChannels/listChannels/main.go
Executable file
16
examples/stream/listChannels/listChannels/main.go
Executable 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)
|
||||
|
||||
}
|
||||
18
examples/stream/listMessages/listMessages/main.go
Executable file
18
examples/stream/listMessages/listMessages/main.go
Executable 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)
|
||||
|
||||
}
|
||||
19
examples/stream/sendMessage/sendMessage/main.go
Executable file
19
examples/stream/sendMessage/sendMessage/main.go
Executable 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)
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user