Coder Social home page Coder Social logo

go-triggerbot's Introduction

Telegram Triggerbot

A Basic Telegram trigger bot. Triggers can be configured as go regular expressions in a configuration file. Currently only text messages can be triggered.

Go

Compiling

Download and install it. In the Source code directory run: go build -v . Done - proceed withe Section Usage.

Usage

Use config-example.yaml as a template and place save it as triggerbot.yml in the same Directory as the binary. A different name and location can be set via the command line parameter -config

Make sure to insert The Bot TOKEN into the config file. Use @BotFather to create a bot and a TOKEN. Make sure to disable privacy mode.

telegram:
  token: "YOUR BOTTOKEN"
  timeout: 60

limits:
  - # Allow one request per 5 minutes
    bucket: 5m
    limit: 1
  - # Allow 5 requests per hour
    bucket: 1h
    limit: 5

trigger:
  - # A normal Case sensitive Match
    match: "WTF?"
    text: "What the Fish?"
  - # Case insensitive Match
    match: "(?i)guten morgen"
    text: "Nimm Dir nen Kaffee! ☕️"
  - # This will match "Die 5 Freunde" but not "Die fünf Freunde"
    match: "[Dd]ie \\d+ Freunde"
    text: "... und Timmy der Hund"

NOTE: The Configuration file uses YAML as format. Indentation matters! Also make sure not to mix Tabs and Spaces when doing indentation.

go-triggerbot's People

Contributors

toke avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

weissbrotde

go-triggerbot's Issues

Stop triggers

Triggers that stop the bot from working in a chat for a specified time.

Connection triggers

Triggers that stay inactive until another trigger is triggered and will be disabled after the specified time after the activation trigger is triggered.

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.