mirror of
https://github.com/pockethost/pockethost.git
synced 2025-03-30 15:08:30 +00:00
add default URL param to discordAlert
This commit is contained in:
parent
e48e422ecd
commit
a11e819d5e
@ -3,8 +3,11 @@ import { stringify } from '../common'
|
||||
|
||||
const cache: { [_: string]: NodeJS.Timeout } = {}
|
||||
|
||||
export const discordAlert = (message: { toString: () => string }) => {
|
||||
const url = DISCORD_ALERT_CHANNEL_URL()
|
||||
export const discordAlert = (
|
||||
message: { toString: () => string },
|
||||
_url?: string,
|
||||
) => {
|
||||
const url = _url || DISCORD_ALERT_CHANNEL_URL()
|
||||
if (!url) return
|
||||
const m = `${message}${message instanceof Error ? `\n${message.stack}` : ''}`
|
||||
const isCached = !!cache[m]
|
||||
|
Loading…
x
Reference in New Issue
Block a user