Skip to main content

AiotraQ-Bot

Async ready traQ Bot library written in Python.

PyPI - Version GitHub license CI

Requirements

AiotraQ-Bot は以下のライブラリを使用しています。

Installation

pip install aiotraq-bot

Usage

TraqHttpBot を使って http bot を作成することができます。

traQ->BOTサーバーへのイベント受け取り部分を補助します。 BOTサーバー->traQへのイベント送信は AiotraQAiotraQ-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)

Source distribution for aiotraq-bot 0.2.5
File Size Uploaded
aiotraq_bot-0.2.5.tar.gz 8.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aiotraq-bot 0.2.5
File Interpreter ABI Platform
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 log

Release 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

Release history Release notifications | RSS feed

This release

0.2.5 This release

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page