Skip to content

Added Incident Webhook Functionality#378

Merged
MonkeyWhisper merged 3 commits intoProject-Sloth:mainfrom
TheMajorMayhem:main
Oct 12, 2023
Merged

Added Incident Webhook Functionality#378
MonkeyWhisper merged 3 commits intoProject-Sloth:mainfrom
TheMajorMayhem:main

Conversation

@TheMajorMayhem
Copy link
Copy Markdown
Contributor

With this PR I have added the ability to have your Incident reports sent to a Discord Webhook.
This works with creating a new Incident as well as with Editing and Saving an incident.

Steps to complete:

  • Add webhook at line 24
  • Restart Resource

This has been tested on my Dev Server, as well as on my live multiplayer server without issue.
Preview of Webhook working: https://i.imgur.com/FpwyAvH.png

Comment thread server/main.lua Outdated
end

function sendIncidentToDiscord(color, name, message, footer)
if ClockinWebhook == '' then
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IncidentWebhook

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xSisyphusx

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My mistake will fix this right now

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait - this is just the clock in webhook for the time clock - this should be correct.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait - this is just the clock in webhook for the time clock - this should be correct.

No, you're using the function sendIncidentToDiscord and sending it to ClockinWebhook, it needs to be sent to IncidentWebhook

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MonkeyWhisper - I have corrected this issue. My fault, for whatever reason I was having a brain fart.

Comment thread server/main.lua Outdated
end

function sendIncidentToDiscord(color, name, message, footer)
if ClockinWebhook == '' then
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait - this is just the clock in webhook for the time clock - this should be correct.

No, you're using the function sendIncidentToDiscord and sending it to ClockinWebhook, it needs to be sent to IncidentWebhook

@MonkeyWhisper MonkeyWhisper merged commit 84a6eb1 into Project-Sloth:main Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants