console-chat
Run a chat room in the console
const http = require('http')
const createChatServer = require('console-chat/server')
const createTelegramConnector = require('console-chat/connectors/telegram')
const telegramConnector = creatTelegramConnector(process.env.BOT_TOKEN, process.env.CHAT_ID)
const server = http.Server()
createChatServer(server, {
hq: telegramConnector,
name: 'tommy'
})
server.listen(3000)
const createChatClient = require('console-chat/client')
createChatClient()
Linking to Telegram
The provided Telegram connector allows you to receive and send messages to the chatroom from your Telegram account.
The connector works through the Telegram Bot API.
First you will need to create a bot. Then start a conversation with the bot via your account (security reasons, bots can't initiate chats). Then you just need to provide the BOT_TOKEN and CHAT_ID to the connector constructor.