# bridge/

Wiring between Gitea and Discord. Handles webhook events, maps IDs between platforms, and stores the mappings in SQLite.

## Barrel Exports

```ts
function handleGiteaWebhook(
  payload: unknown,
  eventType: "issue_comment" | "pull_request" | "pull_request_comment",
): Promise<void>

function createPRComment(
  prData: { gitea_pr_id: number; repo: string; pr_number: number; discord_thread_id: string },
  body: string,
  discordMessageId: string,
): Promise<{ id: number; body: string; user: { login: string }; created_at: string; updated_at: string }>

function convertDiscordMentionsToGitea(content: string): Promise<string>

function getPRByDiscordThreadId(discordThreadId: string):
  { gitea_pr_id: number; repo: string; pr_number: number; discord_thread_id: string } | null
```
