generated from nhcarrigan/template
feat: post Discord webhook on prestige, transcendence, and apotheosis
This commit is contained in:
@@ -7,6 +7,7 @@ import {
|
||||
buildPostApotheosisState,
|
||||
isEligibleForApotheosis,
|
||||
} from "../services/apotheosis.js";
|
||||
import { postMilestoneWebhook } from "../services/webhook.js";
|
||||
|
||||
export const apotheosisRouter = new Hono<HonoEnv>();
|
||||
|
||||
@@ -61,5 +62,11 @@ apotheosisRouter.post("/", async (context) => {
|
||||
},
|
||||
});
|
||||
|
||||
void postMilestoneWebhook(discordId, "apotheosis", {
|
||||
prestige: newState.prestige.count,
|
||||
transcendence: newState.transcendence?.count ?? 0,
|
||||
apotheosis: newApotheosisData.count,
|
||||
});
|
||||
|
||||
return context.json({ newApotheosisCount: newApotheosisData.count });
|
||||
});
|
||||
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
computeRunestoneMultipliers,
|
||||
isEligibleForPrestige,
|
||||
} from "../services/prestige.js";
|
||||
import { postMilestoneWebhook } from "../services/webhook.js";
|
||||
|
||||
export const prestigeRouter = new Hono<HonoEnv>();
|
||||
|
||||
@@ -87,6 +88,12 @@ prestigeRouter.post("/", async (context) => {
|
||||
},
|
||||
});
|
||||
|
||||
void postMilestoneWebhook(discordId, "prestige", {
|
||||
prestige: newPrestigeData.count,
|
||||
transcendence: newState.transcendence?.count ?? 0,
|
||||
apotheosis: newState.apotheosis?.count ?? 0,
|
||||
});
|
||||
|
||||
return context.json({
|
||||
runestones: runestonesEarned,
|
||||
newPrestigeCount: newPrestigeData.count,
|
||||
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
computeTranscendenceMultipliers,
|
||||
isEligibleForTranscendence,
|
||||
} from "../services/transcendence.js";
|
||||
import { postMilestoneWebhook } from "../services/webhook.js";
|
||||
|
||||
export const transcendenceRouter = new Hono<HonoEnv>();
|
||||
|
||||
@@ -66,6 +67,12 @@ transcendenceRouter.post("/", async (context) => {
|
||||
},
|
||||
});
|
||||
|
||||
void postMilestoneWebhook(discordId, "transcendence", {
|
||||
prestige: newState.prestige.count,
|
||||
transcendence: newTranscendenceData.count,
|
||||
apotheosis: newState.apotheosis?.count ?? 0,
|
||||
});
|
||||
|
||||
return context.json({
|
||||
echoes: echoesEarned,
|
||||
newTranscendenceCount: newTranscendenceData.count,
|
||||
|
||||
Reference in New Issue
Block a user