AiotraQ-Message
streamlit 風の構文を用いてインタラクティブなメッセージ送信に対応するプラグインです。
Installation
pip install aiotraq-message
Requirements
AiotraQ-Message は AiotraQ に依存しています
Usage
import os
import asyncio
from aiotraq_bot import TraqHttpBot
from aiotraq_message import TraqMessage
async def component(am: TraqMessage, payload: str):
am.write("Hello, World!")
am.write(payload)
with am.spinner():
# heavy task
asyncio.sleep(3)
am.write(":done: Done!")
bot = TraqHttpBot(verification_token=os.getenv("BOT_VERIFICATION_TOKEN"))
response = TraqMessageManager(bot, os.getenv("BOT_ACCESS_TOKEN"), "https://q.trap.jp/api/v3", "https://q.trap.jp")
@bot.event("MESSAGE_CREATED")
async def on_message_created(payload) -> None:
channel_id = payload.message.channelId
message = payload.message.plainText
await response(component, channnel_id=channel_id, payload=message)
if __name__ == "__main__":
bot.run(port=8080)
Component
write, spinner, clear などのメソッドを使うことができます
- write: メッセージを送信します
- spinner: スピナーを表示します
- clear: 送信したメッセージを空にします
- clear_message: write で送信したメッセージ 1 つを削除します
- image: 画像を送信します
- pyplot: matplotlib のグラフを送信します
- dataframe: pandas の dataframe を表形式で表示します
License
This project is licensed under the terms of the MIT license.
Release files for aiotraq-message 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_message-0.2.5.tar.gz | 8.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aiotraq_message-0.2.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.7 kB
Release files / aiotraq_message-0.2.5.tar.gz
| Download URL | aiotraq_message-0.2.5.tar.gz |
|---|---|
| Size | 8.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
853734da8c96f82f5ed9735c95e61154ff8088d081a6d47cc30f1d1215c5239f
|
|
BLAKE2b-256 checksum How to use checksums |
5d1343c66d873d2e090a54550c0fc59a4e9a4b794cc83fafd085a328a1425a35
|
| 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_message-0.2.5-py3-none-any.whl
| Download URL | aiotraq_message-0.2.5-py3-none-any.whl |
|---|---|
| Size | 8.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0cf6d567adea477c23e1f9fc4cb5d8f6c103933ccecc5a4f9d4c843cb112d440
|
|
BLAKE2b-256 checksum How to use checksums |
5c516b81b2f74f93511cc01975068e712b00c28d4d25a894dbde0965e894c0ff
|
| 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