You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
555 B
28 lines
555 B
7 months ago
|
import logger from './helpers/logger.ts'
|
||
|
|
||
|
/**
|
||
|
* Webhook
|
||
|
*
|
||
|
* @author Björn Hase <me@herr-hase.wtf>
|
||
|
* @license http://opensource.org/licenses/MIT The MIT License
|
||
|
* @link https://git.node001.net/HerrHase/super-hog.git
|
||
|
*
|
||
|
*/
|
||
|
|
||
|
class Webhook {
|
||
|
static send(message: string) {
|
||
|
|
||
|
const query = new URLSearchParams({
|
||
|
'message': message
|
||
|
})
|
||
|
|
||
|
try {
|
||
|
fetch(process.env.WEBHOOK_URL + '?' + query.toString())
|
||
|
} catch(error) {
|
||
|
logger().error(error)
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
export default Webhook
|