I18 With AI...
A Telegram UserBot that provides real-time message translation capabilities, allowing users to seamlessly communicate across language barriers.
- 🔄 Real-time message translation(but only for yourself)
- 🎯 Custom target language settings per chat
- 🤖 Easy-to-use commands
- Clone the repository
git clone https://github.com/sudoskys/i18n_me.git
pnpm install- Create a
.envfile in the root directory with the following variables:
OAI_BASE_URL=https://api.openai.com/v1
DB_FILE_NAME=file:group.db
OAI_API_KEY=sk-xxxxx
OAI_MODEL=gpt-4o- Edit
tgsnake.config.js
nano tgsnake.config.jsget your apiHash and apiId from my.telegram.org
/** @type {import('tgsnake').Options } */
const config = {
apiHash : 'xxxx',
apiId : 123456,
login : {
botToken : '',
sessionName : 'user',
forceDotSession : true,
},
logLevel : ['error','info'],
clientOptions : {"ipv6":false},
plugins : []
}
module.exports = configConnect to your Telegram account and start the bot:
pnpm run startThen, Ctrl+C to stop the bot and run the following command to start the bot in production mode:
Build for production:
apt install npm
npm install -g pm2
# In the repo root directory
pm2 start pm2.json
pm2 statusDo not share your .env file or .session file with others.
/ping- Test if the bot is active and get current chat ID/local- Toggle translation feature on/off/use [target_language]- Set target language for translationstl [text]- Translate the following text (prefix any message with 'tl' to translate)
- tgsnake - Telegram MTProto framework
- instructor-ai - Translate text with AI
- Bun - For the amazing runtime and tooling
Made with ❤️ by @sudoskys