GithubHelp home page GithubHelp logo

drruisseau / telegrambot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kgribov/telegrambot

0.0 1.0 0.0 100 KB

Create your own telegram bot on Scala with metrics in 3 minutes!

Scala 97.50% Shell 2.50%

telegrambot's Introduction

alt text

TelegramBot

Overview

This project is a simplest way to create a Telegram bot with Scala API: TelegramBotScalaApi.

It have all dependencies that you need, CLI parsing, logging, monitoring and packaging into docker. You will have you own bot platform.

Requirements for your environmet:

  • SBT and Scala version 2.12 or higher
  • Docker and Docker Compose version 2 or higher

Getting started

To create your own bot just follow next steps:

  1. Create your bot in Telegram and get bot API key, instructions: Creating your bot in Telegram
  2. Clone this repository to your computer: git clone https://github.com/kgribov/TelegramBot.git
  3. Go to directory with project: cd TelegramBot
  4. Build it using SBT: sbt docker
  5. Grand permissions for start script: chmod +x startup.sh
  6. Start bot with script: ./startup.sh <Bot API key>

That's all, your bot is running now!

You can type something to him and he will calculate your message size or type /random command to get a random number.

Open bot dashboard Bot Dashboard to see metrics of your bot.

If you don't see any data on dashboard, don't panic! Give some time to system to fully start-up (like 1-2 minutes).

Creating your bot in Telegram

To create your bot in Telegram follow official instructions from Telegram team: Instructions.

Don't forget to disable privacy rules for your bot, to read all messages in chat, BotFather could do it with command: /setprivacy, set status to DISABLED.

Customize your bot

If you want to implement your own message processing, your own commands and dialogs with bot, open and modify class CreateBotSchema. To discover all bot Scala API features, read documentation in Scala API repo: API features

Logging

TODO

Monitoring

With your bot, in docker we start next services: Logstash, Graphite, Grafana.

Logstash post metrics from logs to Graphite, and Grafana show dashboard with your metrics.

Your Grafana dashboard is here: Bot Dashboard

Example of dashboard view:

Dashboard screen

You could read more about this frameworks here:

telegrambot's People

Contributors

kgribov 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.