Skip to content
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

Notifications in discord (webhooks) #4651

Closed
vithusel opened this issue Oct 22, 2022 · 7 comments
Closed

Notifications in discord (webhooks) #4651

vithusel opened this issue Oct 22, 2022 · 7 comments

Comments

@vithusel
Copy link

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

A lot of chat services allow the use of webhooks to send messages. I think a lot of users use services such as slack & discord on a regular basis.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Integration of setting up webhook api's so ee can define what server to push webhooks to. Allows users to have a pick of where to send notifications.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

None

Additional context
Add any other context or screenshots about the feature request here.

Services such as uptimerobot and amp gaming server allow for use for webhook api's to send notifications. The login process for discord and slack are also quite secure. Could be a decent consideration for future integration

@Ylianst Ylianst self-assigned this Oct 22, 2022
@Ylianst
Copy link
Owner

Ylianst commented Oct 22, 2022

I am working on adding support for Telegram now and coded it so other services can be supported later like Signal Messenger and Discord.

@Ylianst
Copy link
Owner

Ylianst commented Oct 27, 2022

I just added Discord support in MeshCentral, it will be published with v1.0.91. To help with setup, I added a section on Discord here.

MC2-Discord1

MC2-Discord2

You can also do 2FA with Discord notifications just like it's possible with Telegram. You can setup a MeshCentral server with both Discord and Telegram, but users can only register with a single service.

@JSuenram
Copy link
Contributor

@Ylianst Maybe you can do the same for MS Teams, which also has Webhooks?

@vithusel
Copy link
Author

Awesome! Ill get my instance updated tonight and setup. Ill close this issue once ive confirmed its working 🙂

@Ylianst
Copy link
Owner

Ylianst commented Oct 28, 2022

@vithusel Thanks. Always good to get confirmation that these things work for other people. It's a lot of work to build so, also nice to know it's being used.

@JSuenram For Microsoft Teams, there is a issue open for that (#4655). No need to mention it here. Note that right now, MeshCentral sends notifications only, it does not receive anything so, webhooks are not used.

@vithusel
Copy link
Author

vithusel commented Oct 28, 2022

@vithusel Thanks. Always good to get confirmation that these things work for other people. It's a lot of work to build so, also nice to know it's being used.

@JSuenram For Microsoft Teams, there is a issue open for that (#4655). No need to mention it here. Note that right now, MeshCentral sends notifications only, it does not receive anything so, webhooks are not used.

@Ylianst
You are a absolute legend.

Tested and working fully. There is something thats not included in the documentation.

Privleged Gateway Intents permissions is needed for the bot on Discord if not you get errors
image

This is the error message you get when its not enabled.

/home/meshcentraluser/node_modules/discord.js/src/client/websocket/WebSocketManager.js:250
        throw new DiscordjsError(unrecoverableErrorCodeMap[error.code]);
              ^

Error [DisallowedIntents]: Privileged intent provided is not enabled or whitelisted.
    at WebSocketManager.createShards (/home/meshcentraluser/node_modules/discord.js/src/client/websocket/WebSocketManag>
    at async Client.login (/home/meshcentraluser/node_modules/discord.js/src/client/Client.js:232:7) {
  code: 'DisallowedIntents'
}

I dont know if you want to document this separate to the guide you linked to. so ill leave this open for the moment.

Ylianst added a commit that referenced this issue Oct 29, 2022
@Ylianst
Copy link
Owner

Ylianst commented Oct 29, 2022

Thank you! I just updated the documentation and used your perfectly framed screen shot. Much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants