Giter Club home page Giter Club logo

telegrambottutorial's Introduction

Telegram Bot Tutorial

Introduction before introduction :)

This project uses Gradle build tool and there is high chance to see gradle in the other kotlin configuration. Each part will be included in separated gradle module as Plugin from PlaguBot. Of course, that does not mean that all the logic of each plugin will be only in one file, but I will try hard to not forget mention it.

Basically, PlaguBot uses this template of config, but in each (or almost each) part of this tutorial will be shown how to add your own fields to this config and deserialize it. There are several important things about plugins:

  • Plugin realization (excepting abstract ones, of course) must have empty constructor for creating an instance or be an object (like object MyPlugin : Plugin)
  • Plugin have two sections - for DI setup (lets name it config stage) and bot setup (plelaunch stage)
  • Plugin have access predefined things from koin in setupBotPlugin or received in modules scopes:
    • PlaguBot config
    • PlaguBot plugins
    • Database and its config
    • Default Json format (can be accessed as koin.get<Json>())
    • The PlaguBot itself

How to launch

First, you need to change bot token inside of config.json. The other parts should be described in the readmes of the modules with these parts.

There are two main ways to launch it:

  • Run ./gradlew build && ./gradlew run --args="PATH_TO_YOUR_CONFIG" with replacing of PATH_TO_YOUR_CONFIG
  • Run ./gradlew build and get zip of bot and unarchive it somewhere you need. In this archive there is an executable files bot.bat (for windows) and bot (for linux) by the path inside of archive /bot/bin. After unarchiving you can just launch executable file with one argument: path to the config

telegrambottutorial's People

Contributors

insanusmokrassar avatar

Stargazers

 avatar

Watchers

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