Ten szablon workflow n8n stanowi gotowy schemat bota AI na Telegramie, który obsługuje zarówno wiadomości głosowe, jak i tekstowe. Można go uruchomić szybko, przy minimalnej konfiguracji.
Bot zapamiętuje ostatnie wiadomości (domyślnie 10), rozumie komendy i odpowiada w formacie HTML. Istnieje możliwość wymiany modeli GPT-4 i Whisper na inne rozwiązania do przetwarzania języka i zamiany mowy na tekst.
Szablon można rozbudować poprzez dodanie narzędzi LangChain.
Jeśli jesteś nowy w tworzeniu botów Telegram, sprawdź nasz przewodnik krok po kroku dotyczący konfiguracji pierwszego bota i dostępu do OpenAI.
Ten szablon automatyzacji znajduje zastosowanie w wielu obszarach, usprawniając komunikację i procesy biznesowe. Oto kilka potencjalnych scenariuszy wykorzystania:
Szablon można rozszerzyć o dodatkowe funkcjonalności:
inline fixed-width code
npre-formatted fixed-width code blockn2. Any code that you send should be wrapped in these tags:
pre-formatted fixed-width code block written in the Python programming language
nOther programming languages are supported as well.n3. All <, > and & symbols that are not a part of a tag or an HTML entity must be replaced with the corresponding HTML entities (< with <, > with > and & with &)n4. If the user sends you a message starting with / sign, it means this is a Telegram bot command. For example, all users send /start command as their first message. Try to figure out what these commands mean and reply accodringlyn"}},"typeVersion":1.1},{"id":"2c56536d-1a86-4a49-b495-3e877adb308a","name":"Determine content type","type":"n8n-nodes-base.switch","position":[-180,480],"parameters":{"rules":{"values":[{"outputKey":"Text","conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"operator":{"type":"string","operation":"notEmpty","singleValue":true},"leftValue":"={{ $json.message.text }}","rightValue":"/"}]},"renameOutput":true},{"outputKey":"Voice","conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"dd41bbf0-bee0-450b-9160-b769821a4abc","operator":{"type":"object","operation":"exists","singleValue":true},"leftValue":"={{ $json.message.voice}}","rightValue":""}]},"renameOutput":true}]},"options":{"fallbackOutput":"extra"}},"typeVersion":3.2}],"active":false,"pinData":{},"settings":{"executionOrder":"v1"},"versionId":"15ae799b-6868-4519-b579-3f202e4de5b2","connections":{"AI Agent":{"main":[[{"node":"Send final reply","type":"main","index":0}]]},"Send final reply":{"main":[[],[{"node":"Correct errors","type":"main","index":0}]]},"OpenAI Chat Model":{"ai_languageModel":[[{"node":"AI Agent","type":"ai_languageModel","index":0}]]},"Download voice file":{"main":[[{"node":"Convert audio to text","type":"main","index":0}]]},"Window Buffer Memory":{"ai_memory":[[{"node":"AI Agent","type":"ai_memory","index":0}]]},"Convert audio to text":{"main":[[{"node":"Combine content and set properties","type":"main","index":0}]]},"Determine content type":{"main":[[{"node":"Combine content and set properties","type":"main","index":0}],[{"node":"Download voice file","type":"main","index":0}],[{"node":"Send error message","type":"main","index":0}]]},"Listen for incoming events":{"main":[[{"node":"Determine content type","type":"main","index":0},{"node":"Send Typing action","type":"main","index":0}]]},"Combine content and set properties":{"main":[[{"node":"AI Agent","type":"main","index":0}]]}}}