-
Notifications
You must be signed in to change notification settings - Fork 437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(bots): Add events for enabling and disabling bots #12551
feat(bots): Add events for enabling and disabling bots #12551
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should also be documented in https://github.com/nextcloud/spreed/blob/main/docs/bots.md if possible
@nickvergessen resolved all the suggestions and also updated the docs please verify, specially the bots.md :) |
Thanks @sanskar-soni-9 |
Head branch was pushed to by a user without write access
fixed linting |
@nickvergessen Integration test is failing, with |
lib/Command/Bot/Remove.php
Outdated
$output->writeln('<info>Remove bot from given conversations</info>'); | ||
|
||
foreach ($tokens as $token) { | ||
$event = new BotDisabledEvent($this->roomManager->getRoomByToken($token), $botServer); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And similarly we need to check if the room existed here:
$event = new BotDisabledEvent($this->roomManager->getRoomByToken($token), $botServer); | |
try { | |
$room = $this->roomManager->getRoomByToken($token); | |
} catch (RoomNotFoundException) { | |
continue; | |
} | |
$event = new BotDisabledEvent($room, $botServer); |
(+ importing the OCA\Talk\Exceptions\RoomNotFoundException
exception)
oops dont know how that happened, let me fix this |
Signed-off-by: Sanskar Soni <[email protected]>
also rebased to the current head |
It was always broken, just was not a problem so far as the missing room object was not attempted to be used. |
No no I used both |
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
☑️ Resolves
Overview
This allows the bot server to be notified when a bot is enabled or disabled, enabling it to take appropriate action.
Demo Example
2024-06-20.17-30-59.mp4
🏁 Checklist
docs/
has been updated or is not required