This is the source code repository for Nakayoshi, a tool for bridging communities across different chat services. Currently we support three chat platforms:
- Telegram supergroups
- Gitter rooms
- Chatgroups on any Rocketchat-based platform. Tested on version 3.12.3
This project uses sbt as a build system.
Requirements
Following commands should be ran in the cloned repository folder.
$ sbt buildTelegramLibrarySnapshot
$ sbt docker:publishLocal
After that you will find an image tagged nakayoshi
Building telegram library this way is temporary until the new version is published. This command will checkout a fixed commit of the telegram library and build it locally. Make sure to have mill
and git
installed for the sbt buildTelegramLibrarySnapshot
to be executed successfully.
Example docker-compose.yml
:
version: '3'
services:
bot:
image: nakayoshi:latest
volumes:
- ./files:/opt/docker/files:rw
- ./settings:/opt/docker/settings:rw
The configuration file should be put in ./data/local.conf
An example of configuration file contents:
telegram.token = "<tg-token>"
gitter.token = "<gitter-token>"
gitter.username = "<gitter-bot-username>"
rocketchat.path = "localhost"
rocketchat.user = "<rocketchat-bot-username>"
rocketchat.password = "<rocketchat-password>"
telegram.admin = ["<tg-id-without-@>"]
http.enabled = false
For more available fields and details see Configuration.scala.
The fastest way to set up Rocketchat on localhost is with docker-compose, see rocketchat docs.
Pay attention to also add this lines to ./data/local.conf
if you are not running a local SSL proxy:
rocketchat.ssl-enabled = false
rocketchat.port = 3000
Then before starting the Nakayoshi, follow this guide to create a Rocketchat bot user.
Obtain gitter token for a registered (bot) user at the developer portal.
Create a telegram bot with BotFather as specified in Telegram docs. Be sure to record the bot token.
Once the bot is started, send it a direct message in Telegram with the command /help
. It will print a list of bot command and how to use them to connect the chats in Telegram, Gitter and Rocketchat.