Skip to main content

虚実ニュースbot

その日にDiscordで話したユーザーの中からランダムに1人を選び、完全フィクションの「虚実ニュース」を1分〜3時間のランダム間隔で投稿するBotです。

投稿例:

【虚実ニュース・速報】
本日未明、@user が自宅で盛大に脱糞したことが判明し、懲役0.7秒、執行猶予48年を言い渡されました。

専門家は「かなりどうでもいい事件です」と分析しています。

※このニュースは完全なフィクションです。実在の人物・事件・処分とは関係ありません。

インストール

pip install kyozitu-news-bot

初回起動時に、使用しているOS/CPUに合うGo製Bot本体をGitHub Releasesから自動取得します。

対応予定: Windows / Linux / macOS の amd64・arm64。Termuxのarm64環境ではLinux arm64版を使用します。

起動方法

Pythonから:

from kyozitu_news_bot import run

run("DISCORD_BOT_TOKEN")

または環境変数を設定してCLIから:

export DISCORD_BOT_TOKEN="YOUR_BOT_TOKEN"
kyozitu-news-bot

Windows PowerShell:

$env:DISCORD_BOT_TOKEN="YOUR_BOT_TOKEN"
kyozitu-news-bot

動作

  • Bot起動中、その日に発言した非Botユーザーをサーバーごとに記録します。
  • 最初の発言後、次の虚実ニュース投稿時刻を1分〜3時間の範囲でランダム決定します。
  • 時刻になると、その日に発言したユーザーから1人を選んでメンションします。
  • 投稿先は選ばれたユーザーが最後に発言したチャンネルです。
  • 投稿後、次回時刻をもう一度1分〜3時間からランダム決定します。
  • 日付判定は日本時間です。
  • 状態はローカルJSONに保存され、Botを再起動しても保持されます。

Discord Botの権限

最低限、Botに以下を許可してください。

  • View Channels
  • Send Messages
  • Read Message History

このBotはメッセージ本文を判定しないため、Message Content Intentは不要です。

データ保存場所

OSのユーザー設定ディレクトリ内の kyozitu-news-bot/state.json に保存します。 KYOZITU_DATA_DIR 環境変数を指定すると保存先を変更できます。

注意

虚実ニュースbotが生成するニュースはすべてネタ・フィクションです。実在のユーザーについて現実の犯罪や処分を事実として伝える用途ではありません。

開発

Bot本体はGoで実装しています。PyPIパッケージのPython部分は、Goバイナリの取得と起動だけを担当します。

Metadata

Release files for kyozitu-news-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)

Source distribution for kyozitu-news-bot 0.1.0
File Size Uploaded
kyozitu_news_bot-0.1.0.tar.gz 4.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kyozitu-news-bot 0.1.0
File Interpreter ABI Platform
kyozitu_news_bot-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.8 kB

Release files / kyozitu_news_bot-0.1.0.tar.gz

Download URL kyozitu_news_bot-0.1.0.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
9a7645de0631bc4b33865e93441d07778f1ea4bc884752f88926e211c88f34f5
BLAKE2b-256 checksum
How to use checksums
0e4e82e1ce3def31d1cd28a2f6b3a1d25e80ee52c8907a262eac5c88184542ff
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 10, 2026.

Transparency log

Release files / kyozitu_news_bot-0.1.0-py3-none-any.whl

Download URL kyozitu_news_bot-0.1.0-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c02cef02a3e0a0b331be1627773cd0282e53cf74d0c1d93eecdb2392a0b97ab8
BLAKE2b-256 checksum
How to use checksums
013739bd4bfba1bf47a901f926e0a550c744d3416c544a2a8af015010f1223e3
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 10, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.3

2 release files

0.1.1

2 release files

This release

0.1.0 This release

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