mirror of
https://github.com/ReCloudStudio/WebHooker.git
synced 2026-09-22 16:11:29 +00:00
feat: migrate send logs and discord links to D1
This commit is contained in:
parent
5a98e45544
commit
3a6a2cbbc5
16 changed files with 139 additions and 79 deletions
|
|
@ -48,7 +48,7 @@ export async function dispatchEvent(config: Config, event: WebhookEvent, env: En
|
|||
const message = formatEvent(route, event, tr, showEmoji);
|
||||
const result = await getDriver(route.target).send(message, route.target, env);
|
||||
if (!result.ok) throw new Error(result.error ?? "Send failed");
|
||||
await recordSend(env.KV, {
|
||||
await recordSend(env.DB, {
|
||||
ts: Date.now(),
|
||||
routeId: route.id,
|
||||
event: event.event,
|
||||
|
|
@ -57,7 +57,7 @@ export async function dispatchEvent(config: Config, event: WebhookEvent, env: En
|
|||
ok: true,
|
||||
});
|
||||
} catch (err) {
|
||||
await recordSend(env.KV, {
|
||||
await recordSend(env.DB, {
|
||||
ts: Date.now(),
|
||||
routeId: route.id,
|
||||
event: event.event,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue