Giter Club home page Giter Club logo

jbtgbotjava8's Introduction

This is JBTelegramBot Front part on Java 8. The Back part writed on .Net C# located here: [](https://github.com/prhobb/JbTlsClient)

JBTelegramBot Front consists of two parts:

  1. Telegram connector: JBTgBot
  2. TLS Server: JBTlsServer

Back part connects to Front via SSL.

What do you have to do by yourself before start:

  1. Make application.properties file in \src\main\resources tgbot.name= tgbot.token= tgbot.otpfile=

tlsserver.port= tlsserver.tlsversion=TLSv1.2 tlsserver.keystore= tlsserver.keystorepassword= tlsserver.truststore=<jks Key store with trusted (client's) certificates> tlsserver.truststorepassword=<password jks Key store with trusted (client's) certificates>

db.driverClassName=org.sqlite.JDBC db.url= db.username= db.password= spring.jpa.database-platform=org.sqlite.hibernate.dialect.SQLiteDialect spring.jpa.hibernate.ddl-auto=update

  1. Place keystore.jks and truststore.jks in \src\main\resources
  2. Set Java8 JDK in IDE

How it works:

  1. When JBTgBot receives message it verifies UserID via JbTgAuthentication. Authentificated users locate in DataBase. 1.1. If there is no UserID in DataBase, JbTgAuthentication compare message.text with otpfile (IneTimePasssword). If OTP exists - user adds to DataBase, if not - message silently discards. 1.2. If there is UserID in DataBase - message sends to Backend via SSL.
  2. When JbTlsClientSocket receives message it sends this message to JBTgBot. 2.1. If chatID provided message will be sent to chat with this ID. 2.2. If chatID=0 message will be sent to all known chats.

There can be only one Backend connected to JBTelegramBotFront. If new Backend connects old Backend will be disconnected.

Otpfile and Database will be created while first run.

You can add OTP to Otpfile mannualy or via JbTgAuthentication.AddOtp(String otp) method.

Keepalive for Backend enabled by default. You can mange it with JbTlsClientSocket.setKeepalive(boolean keepalive) method.

jbtgbotjava8's People

Contributors

prhobb avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.