Skip to content

Commit 6063740

Browse files
csenetclaude
andcommitted
Add /kill command for emergency bot restart
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 21541ff commit 6063740

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

app/app.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,13 @@ async def bye(interaction: discord.Interaction):
343343
await bot.close()
344344

345345

346+
@tree.command(name="kill", description="ボットプロセスを強制終了します")
347+
async def kill(interaction: discord.Interaction):
348+
await interaction.response.send_message("ボットプロセスを強制終了します。")
349+
cleanup_processes()
350+
os._exit(1)
351+
352+
346353
@tree.command(name="get", description="辞書の内容を取得するよ")
347354
async def get(interaction: discord.Interaction):
348355
await interaction.response.send_message(showDict())

0 commit comments

Comments
 (0)