This is an app to communicate with a Telegram bot. To use this app you can let it associated to my bot or associate with your own.
#####Use my own bot Start the bot in your Telebot with this link: https://web.telegram.org/#/im?p=%40Rotelebot
#####Use your bot
Create your bot and put it's key in BOT_KEY
in /src/back/config.js
####Database
- Start MongoDB
- Create
telebot
database (use telebot
) - Create
chats
collection (db.createCollection(chats)
)
All set here.
MongoDB connection settings: /back/config.js
####Server Start 2 services in NodeJs:
- Front:
/src/front/index.js
(port: 3001) - Back:
/src/back/index.js
(port: 3000)
####Application
-
Access http://localhost:3001
-
Do login by e-mail or SMS
Since the login needs a HTTPS connection, you may use a tunneler (like ngrok). If you use a tunneler, you will have to setup a Facebook Account Kit application and configure it here in front/views/authentication/config.js However, the Websocket uses a HTTP connection and, therefore, won't work with the HTTPS. Said that, you may try authentication, but to use the app you may enter the page directly.
In fact, loggin isn't implemented right (there is no real authentication process)
-
Enter http://localhost:3001/chatRoom
HTTP Websocket and HTTP connection
-
Start a connection with the Bot in Telegram
-
Talk
- Persist loggin with Facebook Account Kit
- Don't send empty message
- /start checks for previous registration
- Mobile responsive
- Minify bundle.js
- Get user avatar
- Handle 'if no user'
- If large message: hide
- Send only the messages for the active chat, not for all chats at once
- Create tests for backend files