Commit from m3o/m3o action

This commit is contained in:
m3o-actions
2022-03-09 17:11:54 +00:00
parent 418f914253
commit 2eb4296382
21 changed files with 1205 additions and 1205 deletions

View File

@@ -31,33 +31,6 @@ Name: "general",
})
fmt.Println(rsp, err)
}
```
## Delete
Delete a chat room
[https://m3o.com/chat/api#Delete](https://m3o.com/chat/api#Delete)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/chat"
)
// Delete a chat room
func DeleteAchat() {
chatService := chat.NewChatService(os.Getenv("M3O_API_TOKEN"))
rsp, err := chatService.Delete(&chat.DeleteRequest{
})
fmt.Println(rsp, err)
}
```
## Invite
@@ -85,6 +58,38 @@ func InviteAuser() {
})
fmt.Println(rsp, err)
}
```
## Send
Connect to a chat to receive a stream of messages
Send a message to a chat
[https://m3o.com/chat/api#Send](https://m3o.com/chat/api#Send)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/chat"
)
// Connect to a chat to receive a stream of messages
// Send a message to a chat
func SendAmessage() {
chatService := chat.NewChatService(os.Getenv("M3O_API_TOKEN"))
rsp, err := chatService.Send(&chat.SendRequest{
Client: "web",
Subject: "Random",
Text: "Hey whats up?",
})
fmt.Println(rsp, err)
}
```
## Join
@@ -127,12 +132,12 @@ func JoinAroom() {
}
}
```
## Kick
## Leave
Kick a user from a chat room
Leave a chat room
[https://m3o.com/chat/api#Kick](https://m3o.com/chat/api#Kick)
[https://m3o.com/chat/api#Leave](https://m3o.com/chat/api#Leave)
```go
package example
@@ -144,10 +149,10 @@ import(
"go.m3o.com/chat"
)
// Kick a user from a chat room
func KickAuserFromAroom() {
// Leave a chat room
func LeaveAroom() {
chatService := chat.NewChatService(os.Getenv("M3O_API_TOKEN"))
rsp, err := chatService.Kick(&chat.KickRequest{
rsp, err := chatService.Leave(&chat.LeaveRequest{
})
fmt.Println(rsp, err)
@@ -181,13 +186,12 @@ func ListChatRooms() {
}
```
## Send
## Delete
Connect to a chat to receive a stream of messages
Send a message to a chat
Delete a chat room
[https://m3o.com/chat/api#Send](https://m3o.com/chat/api#Send)
[https://m3o.com/chat/api#Delete](https://m3o.com/chat/api#Delete)
```go
package example
@@ -199,15 +203,11 @@ import(
"go.m3o.com/chat"
)
// Connect to a chat to receive a stream of messages
// Send a message to a chat
func SendAmessage() {
// Delete a chat room
func DeleteAchat() {
chatService := chat.NewChatService(os.Getenv("M3O_API_TOKEN"))
rsp, err := chatService.Send(&chat.SendRequest{
Client: "web",
Subject: "Random",
Text: "Hey whats up?",
rsp, err := chatService.Delete(&chat.DeleteRequest{
})
fmt.Println(rsp, err)
@@ -240,12 +240,12 @@ func GetChatHistory() {
}
```
## Leave
## Kick
Leave a chat room
Kick a user from a chat room
[https://m3o.com/chat/api#Leave](https://m3o.com/chat/api#Leave)
[https://m3o.com/chat/api#Kick](https://m3o.com/chat/api#Kick)
```go
package example
@@ -257,10 +257,10 @@ import(
"go.m3o.com/chat"
)
// Leave a chat room
func LeaveAroom() {
// Kick a user from a chat room
func KickAuserFromAroom() {
chatService := chat.NewChatService(os.Getenv("M3O_API_TOKEN"))
rsp, err := chatService.Leave(&chat.LeaveRequest{
rsp, err := chatService.Kick(&chat.KickRequest{
})
fmt.Println(rsp, err)