Telegram bot based on gramjs and gemini-pro using 'advanced' AI technologies to annoy chat participants.
The bot requires a real Telegram account and is not managed by BotFather. See how it works.
- Install Bun
- Clone the repository
- Rename
.env.example
to.env
- Generate API_ID and API_HASH here
- Generate SESSION key Learn how or run
bun scripts/getSession.js
- Get your GAPI key here
- Login as a bot and send a message to @RawDataBot. Use
message.from.id
as BOT_ID - In .env set your BOT_USERNAME to your bot username including @
After completing the above steps, you can proceed with the following commands:
# Install
bun install
# Start
bun start
Customize the bot's behavior by editing the app/config.ts
file. Key configuration options include:
isTelegramPremium
: Enable automatic transcription of media messages if your bot account has Telegram premium.maxHistoryLength
: Set the maximum length of chat history passed to the bot. Longer histories result in more expensive API calls.featureFlags
: Enable/disable feature flags.pollTimeoutMs
: Poll timeout before kick. In milliseconds, so change only first value. e.g. 5 * 60 * 1000 is 5 minutes.maxHistoryLength
: Conversation length for the bot to know context. Longer histories result in more expensive API calls.genAImodelName
: Gemini api model to use.safetySettings
: Safety, always off. See safety settings.generativeModelOptions.systemInstruction
: Default bot behavior. Modify as you want.
When you reply to the bot's message, it will always respond.
If you reply to a person's message and tag the bot, it will reply to that person.
Mentioning the bot will trigger a reply.
/recap
- Generates a summary of the recent conversation based on the provided message limit value. Example:/recap 200
/clear
- Clears the chat bot's history file. This command is useful for debugging purposes or when bot acts silly./scan
- Requires channel admin rights. Scans for inactive chat participants and removes them./votekick
- Requires channel admin rights. Proposes a vote to kick chat participant. Kicks a user if vote passes. Example:/votekick @user
/users
- Prints csv ready info about chat participants. KGB uses same functionality to track you in public chats so be aware.
fly.io does everything out of the box and supports Bun.