Files
moeka-project/services/telegram-bot
Neko Ayaka 372125fb89 chore(deps): bump dependencies
Notice: after bumping up to three 0.180.0 with @types/three 0.180.0,
  Argument of type 'Group<Object3DEventMap>' is not assignable to parameter of type 'Object3D<Object3DEventMap>'.
    Type 'Group<Object3DEventMap>' is missing the following properties from type 'Object3D<Object3DEventMap>': setPointerCapture, releasePointerCapture, hasPointerCapture

Currently, AFAIK, clearly, three, and @types/three doesn't have the setPointerCapture, releasePointerCapture, hasPointerCapture method / getters
The only place I found on GitHub, points out that https://github.com/pmndrs/xr/blob/456aa380206e93888cd3a5741a1534e672ae3106/packages/pointer-events/src/pointer.ts#L69-L100 declares

```js
declare module 'three' {
  interface Object3D {
    setPointerCapture(pointerId: number): void
    releasePointerCapture(pointerId: number): void
    hasPointerCapture(pointerId: number): boolean

    intersectChildren?: boolean
    interactableDescendants?: Array<Object3D>
    /**
     * @deprecated
     */
    ancestorsHaveListeners?: boolean
    ancestorsHavePointerListeners?: boolean
    ancestorsHaveWheelListeners?: boolean
  }
}
```

And in @tresjs/core v5, it uses the @pmndrs/pointer-events internally.
Somehow the Object3D from @types/three and the one augmented by @pmndrs/pointer-events are not compatible.

`new Object3D() as unknown as Object3D` works as workaround here but there should be no need to do such a thing since these two Object3D should be the same.
With no updates from `typescript`, I assume there is no breaking change or regression from `typescript` side.
2025-09-26 17:07:07 +08:00
..
2025-06-30 02:23:40 +08:00
2025-03-24 02:09:35 +08:00
2025-09-10 21:18:48 +08:00
2025-09-26 17:07:07 +08:00
2025-03-24 02:09:35 +08:00

telegram-bot

Allow アイリ to talk to you and many other users in Telegram.

Getting started

Clone & install dependencies:

git clone git@github.com:moeru-ai/airi.git
pnpm i
pnpm run build:packages

Start Ollama instance for embedding models

ollama start
ollama pull nomic-embed-text

Create a .env.local file:

cd services/telegram-bot
cp .env .env.local

Fill-in the following credentials as configurations:

DATABASE_URL=postgres://postgres:123456@localhost:5432/postgres
TELEGRAM_BOT_TOKEN=''

LLM_API_BASE_URL=''
LLM_API_KEY=''
LLM_MODEL=''
LLM_RESPONSE_LANGUAGE=''

LLM_VISION_API_BASE_URL=''
LLM_VISION_API_KEY=''
LLM_VISION_MODEL=''

EMBEDDING_API_BASE_URL=''
EMBEDDING_API_KEY=''
EMBEDDING_MODEL=''
EMBEDDING_DIMENSION=''

For example:

DATABASE_URL=postgres://postgres:123456@localhost:5433/postgres
TELEGRAM_BOT_TOKEN='<Bot ID>:<Token>' # get one from @BotFather

LLM_API_BASE_URL='https://openrouter.ai/api/v1/' # if you use OpenRouter too
LLM_API_KEY='sk-or-v1-<token>'
LLM_MODEL='deepseek/deepseek-chat-v3-0324:free'
LLM_RESPONSE_LANGUAGE='English'

LLM_VISION_API_BASE_URL='https://openrouter.ai/api/v1/'
LLM_VISION_API_KEY='sk-or-v1-<token>'
LLM_VISION_MODEL='openai/gpt-4o' # as long as the model supports image input

EMBEDDING_API_BASE_URL='http://localhost:11434/v1/' # ollama
EMBEDDING_API_KEY=''
EMBEDDING_MODEL='nomic-embed-text' # embedding model
EMBEDDING_DIMENSION='768' # must set

Start both DB and the bot:

docker compose up -d
pnpm run -F @proj-airi/telegram-bot start