-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
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
async say (sayable: Sayable | TemplateStringsArray, ...varList: unknown[]): Promise<void | MessageInterface>
Example
const room = wechaty.Room.find({ name: 'Mention all members room' })
await room.say('hello, everybody here.', ...[ '@all' ])
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
async announce (text: string, pin: boolean = true) : Promise<void>
Maybe the params
pin
could be replaced by a better name.
Example
const room = wechaty.Room.find({ name: 'Mention all members room' })
await room.announce('hello, everybody here.', false) // would regard it as text message with mention only
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
- PR in wechaty
- PR in puppet
- PR in puppet-service
- PR in grpc