Closed horenso closed 10 months ago
@markus2330 thanks for created the two test accounts, that works better now. Regarding 2) I will do what I suggested and just ignore messages coming from users that have "opensesame" in their name to move forward.
I don't quite know what to do if multiple Opensesame instances listen to the same commands chat, because they will pick up each others responses. I would need a list of user_names or a pattern, maybe something like ignore all usernames containering "opensesame". If it's not possible to have multiple Opensesame instances listen to the same commands chat, the @username prefix doesn't make sense in my opinion.
It is possible and even common that several Opensesame instances are in the same chat, e.g. a garage and house door. Without @mention
you could not say which door you want to open, so @mention
is a quite essential part of the nextcloud talk usecase.
But we can merge an intermediate step (without @mention
) or at least review a PR, so I am looking forward to your PR as soon as possible, regardless of if @mention
is implemented (or works).
You can simply append some special UTF-8 character to messages, so that you know the message is to be ignored. Maybe ACK or XON (if Nextcloud does not bother about these characters being send).
In some cases, e.g. alarm!
all instances however should interpret the message and also go into the alarm mode. If you are already in alarm, you simply don't do anything. See also #117.
Alternatively, you could simply mention back the person who wrote a command, then all instances know (because they are not addressed in the mention) that they are not meant.
The invisible unicode is a greate idea, I didn't think of that! For now I'm just all usernames with "opensesame" in their name since that's what I have now.
Hi,
I have some question regarding the logic of the
@username
prefix for our Nextcloud commands and how the command chat should handle multiple instances.I listen to commands in the configured commands chat by polling all unread messages in a regular interval.
API documentation
The issue is that after responding to a command, I receive my own response message with the next get request and (without additional logic) I try to interpret it as a command, I get into an infinit loop.
1) @markus2330 Could you please create two test users on your Nextcloud instance (like opensesame_dev1 and opensesame_dev2 or similar) for me to test the commands more comfortably, since right now I use my own user for Opensesame. I can filter the messages to ignore Opensesame's own messages then.
2) I don't quite know what to do if multiple Opensesame instances listen to the same commands chat, because they will pick up each others responses. I would need a list of user_names or a pattern, maybe something like ignore all usernames containering
"*opensesame*"
. If it's not possible to have multiple Opensesame instances listen to the same commands chat, the@username
prefix doesn't make sense in my opinion.