-
Notifications
You must be signed in to change notification settings - Fork 1
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
[IMPROVEMENT] Make it work in private channels and DMs by default #1
Comments
Why is this? You can use the notifier interface: https://rocketchat.github.io/Rocket.Chat.Apps-ts-definition/interfaces/inotifier.html#notifyuser this way they get notified in whatever room they did the command instead of relying on a user being in a room |
Nice!! @graywolf336 ! I did not know about that interface. I'll try to use that & will report back 😃 |
@graywolf336 I tried this approach but I can't figure out two things:
modify.getNotifer().notifyRoom(context.getRoom(), {
room: context.getRoom(),
sender: context.getSender(),
text: `@${context.getSender().username} shared a new paper: [${result.data.title || 'Untitled'}](https://paper.dropbox.com/doc/${result.data.doc_id})`
}) Also note there's a typo in |
I was able to modify the avatar and alias of the bot 😄 Like this: const message = modify.getNotifer().getMessageBuilder()
.setSender(botUser)
.setRoom(context.getRoom())
.setUsernameAlias('Dropbox Paper')
.setAvatarUrl('https://cardo.so/Rocket.Chat.Dropbox.Paper/icon.png')
.setText(`@${context.getSender().username} shared a new paper: [${result.data.title || 'Untitled'}](https://paper.dropbox.com/doc/${result.data.doc_id})`)
.getMessage();
await modify.getNotifer().notifyRoom(context.getRoom(), message); But to disable 'only you can see this message' is probably something that needs to be modified in the rocketchat-apps bridge |
@graywolf336 I just realized these notifications are not persistent 😞. No good for this use case. |
Right now you need to invite the bot to the private group for the integration to work.
This may need improvement in the Rocket.Chat.Apps framework.
PS: notifyUser & notifyRoom is not good yet because
The text was updated successfully, but these errors were encountered: