セットアップ
Python 3.10+ と Discord BOT トークンがあれば動かせます。
1. 取得と依存関係
git clone https://github.com/coffin299/discord-bot-spam-blocker.git cd discord-bot-spam-blocker pip install -r requirements.txt
Windows では start.bat でも起動できます(初回に依存関係を入れます)。
2. Discord BOT
- Developer Portal で Application と Bot を作成し、トークンを控える
- Privileged Intents: Message Content / Server Members / Moderation(あれば)
- 招待時のスコープ:
botとapplications.commands。権限: Manage Messages, Kick, Ban, Moderate Members, Manage Roles, View Audit Log など
3. 設定
初回の python main.py で config.yaml が作られます。
bot_token: "YOUR_BOT_TOKEN_HERE" admin_ids: - "YOUR_ADMIN_USER_ID"
機能スイッチ(true/false)は
bot_token の直後にまとまっています。各キー直上のコメントを読んでから切り替えてください。ハニーポットを使う場合は honeypot_enabled: true と honeypot.channel_ids を設定します。
4. 起動
python main.py
起動時にスラッシュコマンドが同期されます。招待に applications.commands が含まれていれば、!!! と / の両方が使えます。
トラブル時は、BOT権限・Intent・監視チャンネルID・ロール階層(KICK/BAN対象より上か)を確認してください。