Commit from m3o/m3o action

This commit is contained in:
m3o-actions
2022-02-18 11:13:00 +00:00
parent 29b773ac62
commit 018ae85f91
25 changed files with 1268 additions and 1268 deletions

View File

@@ -4,12 +4,12 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/chat/api](http
Endpoints:
## Delete
## List
Delete a chat room
List available chats
[https://m3o.com/chat/api#Delete](https://m3o.com/chat/api#Delete)
[https://m3o.com/chat/api#List](https://m3o.com/chat/api#List)
```go
package example
@@ -21,37 +21,10 @@ import(
"go.m3o.com/chat"
)
// Delete a chat room
func DeleteAchat() {
// List available chats
func ListChatRooms() {
chatService := chat.NewChatService(os.Getenv("M3O_API_TOKEN"))
rsp, err := chatService.Delete(&chat.DeleteRequest{
})
fmt.Println(rsp, err)
}
```
## Invite
Invite a user to a chat room
[https://m3o.com/chat/api#Invite](https://m3o.com/chat/api#Invite)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/chat"
)
// Invite a user to a chat room
func InviteAuser() {
chatService := chat.NewChatService(os.Getenv("M3O_API_TOKEN"))
rsp, err := chatService.Invite(&chat.InviteRequest{
rsp, err := chatService.List(&chat.ListRequest{
})
fmt.Println(rsp, err)
@@ -88,33 +61,6 @@ Text: "Hey whats up?",
})
fmt.Println(rsp, err)
}
```
## History
List the messages in a chat
[https://m3o.com/chat/api#History](https://m3o.com/chat/api#History)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/chat"
)
// List the messages in a chat
func GetChatHistory() {
chatService := chat.NewChatService(os.Getenv("M3O_API_TOKEN"))
rsp, err := chatService.History(&chat.HistoryRequest{
})
fmt.Println(rsp, err)
}
```
## Join
@@ -213,12 +159,12 @@ Name: "general",
}
```
## List
## Delete
List available chats
Delete a chat room
[https://m3o.com/chat/api#List](https://m3o.com/chat/api#List)
[https://m3o.com/chat/api#Delete](https://m3o.com/chat/api#Delete)
```go
package example
@@ -230,10 +176,64 @@ import(
"go.m3o.com/chat"
)
// List available chats
func ListChatRooms() {
// Delete a chat room
func DeleteAchat() {
chatService := chat.NewChatService(os.Getenv("M3O_API_TOKEN"))
rsp, err := chatService.List(&chat.ListRequest{
rsp, err := chatService.Delete(&chat.DeleteRequest{
})
fmt.Println(rsp, err)
}
```
## Invite
Invite a user to a chat room
[https://m3o.com/chat/api#Invite](https://m3o.com/chat/api#Invite)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/chat"
)
// Invite a user to a chat room
func InviteAuser() {
chatService := chat.NewChatService(os.Getenv("M3O_API_TOKEN"))
rsp, err := chatService.Invite(&chat.InviteRequest{
})
fmt.Println(rsp, err)
}
```
## History
List the messages in a chat
[https://m3o.com/chat/api#History](https://m3o.com/chat/api#History)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/chat"
)
// List the messages in a chat
func GetChatHistory() {
chatService := chat.NewChatService(os.Getenv("M3O_API_TOKEN"))
rsp, err := chatService.History(&chat.HistoryRequest{
})
fmt.Println(rsp, err)