AiotraQ-Bot
Async ready traQ Bot library written in Python.
Requirements
AiotraQ-Bot は以下のライブラリを使用しています。
Installation
pip install aiotraq-bot
Usage
TraqHttpBot を使って http bot を作成することができます。
traQ->BOTサーバーへのイベント受け取り部分を補助します。
BOTサーバー->traQへのイベント送信は AiotraQ、AiotraQ-Message 等を利用してください。
import os
from aiotraq_bot import TraqHttpBot
bot = TraqHttpBot(verification_token=os.getenv("BOT_VERIFICATION_TOKEN"))
@bot.event()
async def on_message(payload: MessageCreatedPayload):
print(payload)
if __name__ == "__main__":
bot.run()
Event handler の登録
イベントの登録は @bot.event() デコレータを使って行うことができます。
event の引数として対象のイベントを指定するか、関数の型ヒントを使って指定することができます。
MESSAGE_CREATED イベントを型ヒントを使って指定する場合
@bot.event()
async def on_message(payload: MessageCreatedPayload):
print(payload)
MESSAGE_CREATEDイベントを引数を用いて指定する場合
@bot.event("MESSAGE_CREATED")
async def on_message(payload):
print(payload)
詳細は ドキュメント|Bot サーバーの作成を参照してください。
Acknowledgements
This project is inspired by python-traq-bot.
License
This project is licensed under the terms of the MIT license.
Release files for aiotraq-bot 0.2.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| aiotraq_bot-0.2.5.tar.gz | 8.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aiotraq_bot-0.2.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.5 kB
Release files / aiotraq_bot-0.2.5.tar.gz
| Download URL | aiotraq_bot-0.2.5.tar.gz |
|---|---|
| Size | 8.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8c68990b2e3efe4eab78e0ba706b61f5f4a62ff51c5a2055ebbd94b111d26e2f
|
|
BLAKE2b-256 checksum How to use checksums |
9eaff37a482b0810228d0e3361174576f7e18810da7a8f8048b771221570fc3a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 13, 2025.
Transparency logRelease files / aiotraq_bot-0.2.5-py3-none-any.whl
| Download URL | aiotraq_bot-0.2.5-py3-none-any.whl |
|---|---|
| Size | 9.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5f7ea3547cdeb8d2a17df8e3c5ca6c0f008175c45a7d50ef67ea80e9678963fc
|
|
BLAKE2b-256 checksum How to use checksums |
a0bd3bd7618a55b64b5a6e5665e136db689c8963a54c564ad82153b2da53352c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 13, 2025.
Transparency log