chatwork

package module
v0.0.0-...-dfcd9c2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 28, 2022 License: MIT Imports: 13 Imported by: 0

README

cw

The dead simple API client & CLI for Chatwork.

Installation

$ go get github.com/maenet/cw

Usage

Please check the example cli.

Note

Chatwork is trademark or registered trademark of Chatwork Co., Ltd.

Author

Takahiro Maeda

Documentation

Index

Constants

View Source
const BaseURLV2 = "https://api.chatwork.com/v2"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	URL        *url.URL
	HTTPClient *http.Client
	Token      string
	Logger     *log.Logger
}

func NewClient

func NewClient(urlStr string, token string, logger *log.Logger) (*Client, error)

func (*Client) PostMessage

func (c *Client) PostMessage(ctx context.Context, roomID string, form *PostMessageForm) (*PostMessageResponseBody, error)

type PostMessageForm

type PostMessageForm struct {
	Body       string `url:"body"`
	SelfUnread bool   `url:"self_unread,int"`
}

type PostMessageResponseBody

type PostMessageResponseBody struct {
	MessageID string `json:"message_id"`
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL