We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4c72d55 commit 38ac7b7Copy full SHA for 38ac7b7
1 file changed
src/database/index.ts
@@ -3,12 +3,13 @@ import "./patch";
3
export async function increaseViews(username: string, env: Cloudflare.Env): Promise<number> {
4
if (username === "example") return 0;
5
6
+ // No views for thebabayaga or thebabayagakiller, don't spam the api bro
7
+ if (username === "thebabayaga" || username === "thebabayagakiller") return 0;
8
+
9
const kv = env.views;
10
if (!kv) throw new Error("KV Namespace not available! Check your configuration - The KV namespace should be named 'views'.");
11
12
const currentViews = Number((await kv.get(username)) || 0);
-
- // Increase views by 1
13
const newViews = currentViews + 1;
14
await kv.put(username, newViews.toString());
15
0 commit comments