mirror of https://github.com/thaldrin/brevis.git
logs and apikeys
This commit is contained in:
parent
f70b096b29
commit
76825d3fd3
|
@ -2,4 +2,6 @@
|
||||||
|
|
||||||
Brevis is the API handling shortens on [t8.pm]
|
Brevis is the API handling shortens on [t8.pm]
|
||||||
|
|
||||||
|
To get access to this API, [join Thaldrin's Support Server](https://t8.pm/support) and become a [10€ Patron](https://t8.pm/patreon)
|
||||||
|
|
||||||
[t8.pm]: https://t8.pm
|
[t8.pm]: https://t8.pm
|
||||||
|
|
|
@ -3,3 +3,10 @@ export type Shorten = {
|
||||||
url: string
|
url: string
|
||||||
slug: string
|
slug: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type Key = {
|
||||||
|
id: string
|
||||||
|
key: string
|
||||||
|
owner: string
|
||||||
|
reason: string
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
import axios from "axios"
|
||||||
|
|
||||||
|
|
||||||
|
export async function logToDiscord(message: string, webhook?: string) {
|
||||||
|
|
||||||
|
if (process.env.BREVIS_WEBHOOK) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
let req = await axios.post(process.env.BREVIS_WEBHOOK, {
|
||||||
|
username: "Brevis",
|
||||||
|
content: message
|
||||||
|
})
|
||||||
|
|
||||||
|
return req
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error)
|
||||||
|
}
|
||||||
|
|
||||||
|
} else return
|
||||||
|
}
|
Loading…
Reference in New Issue