feat(phase4): !auto on/off 명령어 - Discord에서 Antigravity 자동승인 토글
This commit is contained in:
26
bot.py
26
bot.py
@@ -445,8 +445,30 @@ class GravityBot(commands.Bot):
|
||||
conv_id = cid
|
||||
break
|
||||
|
||||
if conv_id and message.content.strip():
|
||||
self.bridge.write_command(conv_id, message.content.strip())
|
||||
text = message.content.strip()
|
||||
|
||||
# Special command: !auto on/off
|
||||
if text in ("!auto on", "!auto off"):
|
||||
if conv_id:
|
||||
self.bridge.write_command(conv_id, text)
|
||||
enabled = text == "!auto on"
|
||||
emoji = "🟢" if enabled else "🔴"
|
||||
mode = "자동 승인" if enabled else "수동 승인"
|
||||
embed = discord.Embed(
|
||||
title=f"{emoji} {mode} 모드",
|
||||
description=f"Antigravity IDE 설정이 변경됩니다.\n"
|
||||
f"`chat.tools.autoApprove = {enabled}`\n"
|
||||
f"`chat.agent.autoApprove = {enabled}`",
|
||||
color=discord.Color.green() if enabled else discord.Color.red(),
|
||||
)
|
||||
await message.channel.send(embed=embed)
|
||||
else:
|
||||
await message.reply("⚠️ 채널에 연결된 세션이 없습니다.")
|
||||
return
|
||||
|
||||
# General text relay
|
||||
if conv_id and text:
|
||||
self.bridge.write_command(conv_id, text)
|
||||
await message.add_reaction("📨")
|
||||
|
||||
await self.process_commands(message)
|
||||
|
||||
Reference in New Issue
Block a user