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.3

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.3
File Size Uploaded
kyozitu_news_bot-0.1.3.tar.gz 4.9 kB Details

Built distribution (wheel)

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

Total release size: 10.1 kB

Release files / kyozitu_news_bot-0.1.3.tar.gz

Download URL kyozitu_news_bot-0.1.3.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
27222470df94c9efa82e7a9c2573a7428b5d355b294390fd0607eddd43193bd7
BLAKE2b-256 checksum
How to use checksums
65074167fed34a88b05f2005b5a0621ab3dec2775f1ddaa399b9d2e880833272
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.3-py3-none-any.whl

Download URL kyozitu_news_bot-0.1.3-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
54ce26ecbaca2229577104fbb85d5471e0aeea5ccc480108d550856e461fd577
BLAKE2b-256 checksum
How to use checksums
ae501c3cd1bc67243d49bc6504e0298a529c00c8119a1ef2e7da1a470fee2e77
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

This release

0.1.3 This release

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