Metadata-Version: 2.4
Name: lineoa
Version: 4.4.3
Summary: LINE Official User API wrapper library for Python
Author: madoa5561
License: MIT
Project-URL: Homepage, https://github.com/madoa5561/LINELib
Project-URL: Repository, https://github.com/madoa5561/LINELib
Project-URL: Issues, https://github.com/madoa5561/LINELib/issues
Keywords: LINE,API,bot,messaging
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.32.5
Requires-Dist: selenium>=4.40.0
Requires-Dist: sseclient-py>=1.9.0
Dynamic: license-file

# LINEOALib

LINEOALibは、LINE公式アカウントの管理・チャット・認証・自動化をPythonから簡単に扱えるライブラリです。

## 特徴
- Seleniumによる認証・Cookie管理
- 複数Bot・チャットの取得・送信・監視

## インストール
```
pip install -r requirements.txt
```

## 使い方
### 1. 初回認証（SeleniumによるCookie保存）
```python
from LINELib import LINELib
COOKIE_PATH = os.environ.get("LINEOA_COOKIE_PATH", "lineoa_cookie.json")
lib = LINELib(storage=COOKIE_PATH)  # 初回はSeleniumで手動ログイン
#storageを設定することによりcookieを保存
```

### 2. 以降はCookie自動復元
```python
COOKIE_PATH = os.environ.get("LINEOA_COOKIE_PATH", "lineoa_cookie.json")
lib = LINELib(storage=COOKIE_PATH)
#次回からcookieを利用してログイン
```

### 3. Bot一覧・チャット一覧取得
```python
bots = lib.bots.ids  # {bot名: botId}
chats = lib.chats.user.ids  # ユーザーchatId一覧
```

### 4. メッセージ送信
```python
lib.send_message(user_id, "こんにちは！", bot_id)
```

### 5. 画像送信
```python
lib.send_file(chat_id, "sample.png", bot_id)
```

### 6. メッセージ監視
```python
lib.listen_messages(bot_id, chat_id, on_message=lambda msg: print(msg))
```

## サンプル
`example` を参照してください。

## クラス構成
- `LINELib` ... 全機能統合のメインクラス
- `AuthService` ... 認証・Cookie管理
- `ChatService` ... チャットAPI
- `LINEOAError` ... 例外クラス

## ライセンス
MIT License


