Skip to content
This repository was archived by the owner on Jan 30, 2026. It is now read-only.

Commit db058cf

Browse files
committed
add new quote option
1 parent b477c13 commit db058cf

1 file changed

Lines changed: 23 additions & 8 deletions

File tree

src/api/bot.ts

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,10 @@ export const bot = new Elysia({ prefix: "/bot" }).use(bearer()).guard(
9393
}),
9494
}
9595
)
96-
.post(
96+
.get(
9797
"/quotes/request",
98-
async ({ body }) => {
99-
const Responder = body.Responder;
100-
101-
console.log(Responder || "everyone");
98+
async ({ query }) => {
99+
const User = query.user;
102100

103101
const productsCount = await prisma.quotes.count();
104102
const skip = Math.floor(Math.random() * productsCount);
@@ -111,7 +109,7 @@ export const bot = new Elysia({ prefix: "/bot" }).use(bearer()).guard(
111109
where: {
112110
OR: [
113111
{
114-
Responder: Responder,
112+
Responder: User,
115113
},
116114
{
117115
Responder: "everyone",
@@ -121,12 +119,29 @@ export const bot = new Elysia({ prefix: "/bot" }).use(bearer()).guard(
121119
});
122120
},
123121
{
124-
body: t.Object({
125-
Responder: t.String(),
122+
query: t.Object({
123+
user: t.String(),
126124
}),
127125
}
128126
)
129127
.get("/coreversions", async () => {
130128
return await Updater();
131129
})
130+
.get(
131+
"/quotes",
132+
async ({ query }) => {
133+
const quote = await prisma.quotes.findUnique({
134+
where: {
135+
GlobalId: query.quoteId,
136+
},
137+
});
138+
139+
return quote
140+
},
141+
{
142+
query: t.Object({
143+
quoteId: t.Number(),
144+
}),
145+
}
146+
)
132147
);

0 commit comments

Comments
 (0)