Skip to content

KwanMan/console-chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

console-chat

Run a chat room in the console

// server.js
const http = require('http')
const createChatServer = require('console-chat/server')
const createTelegramConnector = require('console-chat/connectors/telegram')

// Connect up telegram to see and respond to messages
const telegramConnector = creatTelegramConnector(process.env.BOT_TOKEN, process.env.CHAT_ID)

const server = http.Server()
createChatServer(server, {
  hq: telegramConnector,
  name: 'tommy' // Admin username, messages from telegram will be sent under this name
})

server.listen(3000)
// client.js
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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published