-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Feature Request: Message Could Mention All Members in Room but Not Announcement. #2394
Comments
I would like to vote design one, seems like that one is more common across different IMs. |
I feel design two is more clear to me, and at the same time there will also be no problem across other IMs? (please correct me if I'm wrong @windmemory ) @su-chang Please feel free to go ahead to create a PR to demonstrate your design two, let's continue discussing based on the PR, and thank you very much for your new feature RFC! |
Could we just put a string Like: room.announce('Attention! @all Please read: ...', false) Does that fulfill your requirement? |
I think this might cause unintended bugs to Wechaty. What if the user call this function like this:
Currently it is not possible to create such announcement with @ALL in the middle of the message, but this is allowed by the method. And actually @ALL message is just a message, not an announcement, we should keep that two concepts clearly separated. |
I don't think it will be an issue because the Wechaty will not care about the @ in the message string. Users can put whatever they want into that string, and wechaty will just pass it as a string. Is there anything I have missed? |
This is passing a wrong message to the developer, which is saying: announcement would support @ALL in the middle of the message, but actually it is not. Besides the reason above, the most important reason is:
|
I think I got your idea. So let's just ignore the Does this look good to you? |
I think we are discussing about how to implement Shall we continue discuss the |
I like design one because it mentioning all is sending a message, not setting a room announcement. So to use room.say is much better than room. announce. |
Thanks for the PR. I'll think about the magic string '@ALL' for some time. Basically, I do not like magic strings. (An alternate would use a |
I don't like it either. Perhaps we can create a special Contact Instance representing 'all contacts'? Or define a static string in wechaty-puppet? |
@huan Have you thought it through? We may also add a method like |
Neither the special contact nor static string in puppet make me feel comfortable.
Adding a method for this tiny feature looks like a overkill
How do you think about the design 2? @su-chang raise the propose and I feel it is acceptable for me. |
I don't know...After all we are sending a text message in a room, use announce doesn't make much sense... |
Hold on a moment before I start this PR cause I just found that you can @Someone more than once in both Lark and Whatsapp. (and that effects the content, not just the notification). Any idea about implementing that in |
@huan ping |
I can not understand what's the point of mentioning one user name twice in one message? And could you explain why "@ALL is just a regular member in mention list"? What do you mean a "regular"? |
e.g. there is a new member in the company, and we want to give the new comer a warm welcome:
I mean in this mentionList Array, '@ALL' is just like any other member (Contact instances), it can show up in any position of the text, there can be more than one '@ALL', etc. |
Could you please convert this requirement into a end user source code to express it? I think the current API design will not stop you doing them. |
const room = bot.room.find({ name: 'dev' })
const contact = bot.contact.find({ name: '王楠' })
room.say`${@all}${contact}刚刚修复了一个bug` // i'm not sure if I have used templateStringArray correctly
const room = bot.room.find({ name: 'dev' })
const contact = bot.contact.find({ name: '王楠' })
room. announce('@王楠刚刚修复了一个bug', false) The thing is, the '@王楠' in the second approach will not be a real mention. You can not click to get the contact nor the text will be blue in Lark. |
No, the above usage of the The correct usage is: room.say`@all ${contact} 刚刚修复了一个bug` I have discussed the Tagged Template topic with @wechaty/juzi before about the |
@huan I have updated my example. |
The magic string proposal is not a good idea so let's not use it as possible as we can. According to your example code, I think the below code is what you need: room. announce`@所有人 ${contact} 刚刚修复了一个bug` BTW: I think this is a Lark-related rich feature? Is the Wechaty Puppet Lark able to be used in production now? |
This will require room.announce to accept templateStringArray also. This does solve the problem so I'm happy with it. For Puppet-Lark, I don't think so. But whatsapp have similar feature, you can mention the same person more than once in the one message. |
Glad to know. Then the next question will be how can we pass another argument to the TemplateStringArray method. |
Also how should we pass this to the puppet. puppet.sendMessageText() accepts ContactId[], and if we pass '@ALL' we are kinda using magic string again. |
I think we should use
I think this is just a |
Maybe we can treat all TemplateStringArray room announces as a mention all message. |
Brilliant! I agree with you and feel this is a perfect solution. |
After discussion in Wechaty Community Meeting (brief here)
|
Hi, @su-chang. I'm Dosu, and I'm helping the wechaty team manage their backlog. I wanted to let you know that we are marking this issue as stale. From what I understand, this issue is a feature request to add the ability to mention all members in a room without setting an announcement. There have been two design options proposed: one is to add a special parameter to the Before we proceed, we would like to confirm if this issue is still relevant to the latest version of the wechaty repository. If it is, please let us know by commenting on the issue. Otherwise, feel free to close the issue yourself or it will be automatically closed in 7 days. Thank you for your understanding and contribution to the wechaty community. |
@dosubot I'll take care about it, please keep it open. |
Background
When we want to send message which could mention all members in the room, we could set room announcement for it.
But it will stay on the board until the next new announcement coming. If this message is not so much important to set on the board, we really need some other method to suit this case.
For example, mention all members only. Just like:
@all hello, everybody here.
And this feature has been supported in
WeCom
now.Feature Request
Design One
Above all, I'd like to make it into method
room.say()
and could transfer a special params like:[ @all ]
.Interface
Example
This design in common sense. But will process with the special params
[ '@all' ]
, and with a little trouble for some puppets adaption.Design Two
Another way to support it.
Interface
Example
This design could make use and implement it easily. If you don't want to set an announcement, just transfer a
false
params. It will be a text message which could only mention all members in room.Todo List
The text was updated successfully, but these errors were encountered: