This is a Next.js project bootstrapped with create-next-app.
First, clone the repository:
git clone https://github.com/WarFiN123/id-lookup && cd id-lookupThen, install all dependencies:
pnpm installCreate a .env.local file in the root directory with the value:
BOT_TOKEN=<BOT_TOKEN_HERE>
Finally, run the development environment by running:
pnpm run devVisit https://vercel.com/new/git/third-party, paste in https://github.com/WarFiN123/id-lookup/ and press Continue
Add your BOT_TOKEN as an environmental variable and hit Deploy
Go to the Firewall tab and enable Bot Protection
You can even set a custom domain
Replace all the contents of next.config.ts with this:
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
images: {
remotePatterns: [
{
hostname: "cdn.discordapp.com",
},
],
},
};
export default nextConfig;- Delete the
import { checkBotId } from "botid/server";import on top of the page and delete
const verification = await checkBotId();
if (verification.isBot) {
return NextResponse.json({ error: "Access denied" }, { status: 403 });
}- Define edge runtime below the imports
import { NextRequest, NextResponse } from "next/server";
const runtime = "edge"; // cloudflare pages only supports edge runtime for dynamic routesStep 6: Head over to https://dash.cloudflare.com and the Workers & Pages tab under Compute (Workers)
- DiscordLookup (recommended) by Felix
- discord.id by Nerrix