feat: auto-create Discord channel when new project registration detected

This commit is contained in:
2026-03-07 14:59:15 +09:00
parent d227ba57f7
commit c8c9920dd0

6
bot.py
View File

@@ -355,6 +355,12 @@ class GravityBot(commands.Bot):
# Reload conv→project registrations each cycle # Reload conv→project registrations each cycle
self._load_registrations() self._load_registrations()
# Ensure channels exist for all registered projects
for project in set(self.conv_to_project.values()):
if project not in self.project_channels:
await self._get_channel(project)
logger.info(f"Auto-created channel for registered project: {project}")
requests = self.bridge.get_pending_requests() requests = self.bridge.get_pending_requests()
for req in requests: for req in requests:
if req.request_id in self._sent_approval_ids: if req.request_id in self._sent_approval_ids: