https://github.com/ekkx/yaylib
nanameue, Inc. Yay! (イェイ) - API ライブラリ 🛠️
https://github.com/ekkx/yaylib
api automation bot client framework library nanameue python sdk wrapper yay
Last synced: 21 days ago
JSON representation
nanameue, Inc. Yay! (イェイ) - API ライブラリ 🛠️
- Host: GitHub
- URL: https://github.com/ekkx/yaylib
- Owner: ekkx
- License: mit
- Created: 2023-04-08T07:17:25.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2026-05-17T08:04:00.000Z (2 months ago)
- Last Synced: 2026-05-17T08:31:19.943Z (2 months ago)
- Topics: api, automation, bot, client, framework, library, nanameue, python, sdk, wrapper, yay
- Language: Python
- Homepage: https://ekkx.github.io/yaylib
- Size: 5.44 MB
- Stars: 145
- Watchers: 3
- Forks: 14
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
Yay! の API を [Go](https://github.com/ekkx/yaylib) / [TypeScript](https://github.com/ekkx/yaylib/tree/master/packages/typescript) / [Python](https://github.com/ekkx/yaylib/tree/master/packages/python) / [Rust](https://github.com/ekkx/yaylib/tree/master/packages/rust) から扱うための非公式 SDK です。
### インストール
```sh
go get github.com/ekkx/yaylib/v2 # Go
npm install yaylib # TypeScript
pip install yaylib # Python
cargo add yaylib # Rust
```
### クイックスタート (Go)
```go
package main
import (
"context"
"github.com/ekkx/yaylib/v2"
)
func main() {
ctx := context.Background()
client := yaylib.NewClient()
// ログイン(セッションは透過的にキャッシュされます)
client.LoginWithEmail(ctx).Email("...").Password("...").Execute()
// タイムラインを取得
tl, _, _ := client.GetTimeline(ctx, yaylib.NoreplyModeFalse).Number(20).Execute()
_ = tl
// 投稿する
client.CreatePost(ctx).
XJwt(client.GenerateXJwt()).
PostType("text").
Text("hello from yaylib").
Execute()
}
```
すべてのオペレーションは `client.` として直接呼び出せます。
### イベントストリーム
```go
stream, _ := client.OpenEventStream(ctx)
sub, _ := stream.Subscribe(ctx, yaylib.ChatRoomChannel())
for ev := range sub.Events() {
switch e := ev.(type) {
case *yaylib.NewMessageEvent:
// 新着メッセージを受信
fmt.Println("new message:", e)
}
}
```
### サンプル
実行できるサンプルを [`examples/`](https://github.com/ekkx/yaylib/tree/master/examples/go) に用意しています(全言語共通)。
- 認証 + タイムライン取得
- テキスト投稿
- イベントストリームの簡単なボット
- セッション永続化とエラー処理
```bash
YAY_EMAIL=... YAY_PASSWORD=... go run ./examples/go/timeline
```
### ⚖️ ライセンス
MIT © ekkx