fix: Output bot id on talk:bot:install

Signed-off-by: Marcel Müller <marcel-mueller@gmx.de>
This commit is contained in:
Marcel Müller 2025-10-06 16:45:06 +02:00
parent d5acc82ed8
commit 3706e1e928

View file

@ -115,7 +115,7 @@ class Install extends Base {
$bot->setState($noSetup ? Bot::STATE_NO_SETUP : Bot::STATE_ENABLED); $bot->setState($noSetup ? Bot::STATE_NO_SETUP : Bot::STATE_ENABLED);
$bot->setFeatures($featureFlags); $bot->setFeatures($featureFlags);
try { try {
$this->botServerMapper->insert($bot); $botEntity = $this->botServerMapper->insert($bot);
} catch (\Exception $e) { } catch (\Exception $e) {
if ($e instanceof Exception && $e->getReason() === Exception::REASON_UNIQUE_CONSTRAINT_VIOLATION) { if ($e instanceof Exception && $e->getReason() === Exception::REASON_UNIQUE_CONSTRAINT_VIOLATION) {
$output->writeln('<error>Bot with the same secret is already registered</error>'); $output->writeln('<error>Bot with the same secret is already registered</error>');
@ -126,8 +126,8 @@ class Install extends Base {
} }
} }
$output->writeln('<info>Bot installed</info>'); $output->writeln('<info>Bot installed</info>');
$output->writeln('ID: ' . $botEntity->getId());
return 0; return 0;
} }
} }