console-chat
Chatroom in your console!
Last updated 2 years ago by kwanman .
MIT · Original npm · Tarball · package.json
$ cnpm install console-chat 
SYNC missed versions from official npm registry.

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.

Current Tags

  • 0.0.2                                ...           latest (2 years ago)

2 Versions

  • 0.0.2                                ...           2 years ago
  • 0.0.1                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 4
Dependencies (4)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |