senryu-bot
RustでDiscord BOT本体を動かし、Python側はトークンを渡して起動するだけの川柳検出BOTです。
PyPI公開後は:
pip install senryu-bot
ソースから直接入れる場合は:
pip install .
from senryu_bot import run
run("DISCORD_BOT_TOKEN")
run() はBOTが終了するまでブロックします。Ctrl+C / SIGTERM で安全に終了します。
維持する機能
- メッセージから 5-7-5 を自動検出・保存
詠め/詠むな/mute//unmute/rank/delete(25件ごとのページ送り・選択・確認)/detect on|off|status|ban|unban|list/channel/doctor/contact/admin stats|backup|contact-message- ユーザーオプトアウト
- チャンネルタイプ別ON/OFF
- 親チャンネルのミュート継承
- 権限不足時の自動ミュート
- SQLite / PostgreSQL
- AES-256-GCM暗号化
- SQLite定期バックアップ
/health/ready/stats/metrics- サーバー参加時ウェルカム
- サーバー脱退時データ削除
- 管理チャンネルへの参加/脱退通知・定期レポート
- Discord推奨シャード数を使った自動シャーディング
利便性
通常は設定ファイル不要です。run("TOKEN") だけで data/senryu.db を自動作成します。スラッシュコマンド登録、DB初期化、シャーディング、ヘルスサーバーまでRust側で行います。
高度な設定が必要なときだけ senryu_bot.toml または config.toml を置きます。
トークン引数が最優先です。
環境変数は SENRYU_BOT_ を推奨し、移行用に FINDSENRYU_ も読めます。
トークンはコードへの直書きより環境変数などから渡す運用を推奨します。API自体は run(token) のままです。
ビルド
python -m pip install maturin
maturin develop --release
wheel:
maturin build --release
PyPI:
maturin publish
Discord設定
Developer Portalで Message Content Intent を有効化してください。
最低限:
- View Channel
- Send Messages
- Read Message History
推奨:
- Embed Links
- Use External Emojis
Attribution
FindSenryu4Discord (u16-io, MIT) の利用者向け挙動を参考にした独立Rust再実装です。元プロジェクトと検出ロジック参照元の表記は THIRD_PARTY_NOTICES.md に収録しています。
Metadata
Release files for senryu-bot 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| senryu_bot-0.1.0.tar.gz | 132.2 kB | Details |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| senryu_bot-0.1.0-cp310-abi3-win_amd64.whl | CPython 3.10 | abi3 | Windows x86-64 | Details |
| senryu_bot-0.1.0-cp310-abi3-manylinux_2_28_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.28+ x86-64 | Details |
| senryu_bot-0.1.0-cp310-abi3-macosx_11_0_arm64.whl | CPython 3.10 | abi3 | macOS 11.0+ ARM64 | Details |
Total release size: 173.6 MB
Release files / senryu_bot-0.1.0.tar.gz
| Download URL | senryu_bot-0.1.0.tar.gz |
|---|---|
| Size | 132.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
42c75facea5c05fdf8e6495d9a5a7ad1944aad64e72a23d1c969629731fadfab
|
|
BLAKE2b-256 checksum How to use checksums |
62254280588e9bf510e3fe20b05bb2f107b8b714d20a51a13252fd1a44bd80a4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 2, 2026.
Transparency logRelease files / senryu_bot-0.1.0-cp310-abi3-win_amd64.whl
| Download URL | senryu_bot-0.1.0-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 57.5 MB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
669b7d4907dbccb43d6d553aca3895606f6849d1b27b1082ec2d76423f4cb6cb
|
|
BLAKE2b-256 checksum How to use checksums |
d29adfd4952848f01eccecd458279b9df4ce862f295746e683e617a197709af6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 2, 2026.
Transparency logRelease files / senryu_bot-0.1.0-cp310-abi3-manylinux_2_28_x86_64.whl
| Download URL | senryu_bot-0.1.0-cp310-abi3-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 57.6 MB |
| Tags | CPython 3.10 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
02e9538452a2a52982d74bcebcb83b4dac59cb78f8c315235a8b9c3eeed8f121
|
|
BLAKE2b-256 checksum How to use checksums |
bb08d086846e75f21907d2557c178b672b2b7021d9ff3f9c3f6ea56f7ea57809
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 2, 2026.
Transparency logRelease files / senryu_bot-0.1.0-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | senryu_bot-0.1.0-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 58.4 MB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
7a1545c1f10345f89b9022e28954d7bfe824792f1c46880e5e1a6c2183a722e3
|
|
BLAKE2b-256 checksum How to use checksums |
79d1b42e5a6b6c26779c0d0cd12bbd8a0aae32380b3474fd5084fab5d44b5a6e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 2, 2026.
Transparency log