Coder Social home page Coder Social logo

bot's Introduction

Stampython: A Telegram bot for karma accounting

Build Status Code Climate Pypi

Introduction

Attempt to create a python script that monitors a telegram bot URL and replies to commands for adding/removing karma.

Check more information about Telegram Bots.

Important

  • The bot will need to have access to all of your messages in order to find the words with "++" or "--"

Notes

  • On first execution it will create database and start filling values

Test

Usage

  • word++ to add karma
  • word-- to remove karma
  • /quote add username text to add a quote for given username with the following text as message
  • /quote username to retrieve a random quote for that username.

Extra commands only for owner user

Configuration

The bot, once token has been used and owner set via commandline, will store that information in the database, so you can control it from a chat window

  • /config show will list actual defined settings
  • /config set var=value will set one of those settings with a new value
    • As of this writing (verbosity, url for api, token, sleep timeout, owner, database, run in daemon mode)
  • /config delete var will delete that variable from configuration.

Stats

The bot stores stats on users/chats, remembering the chat/user name and last time seen so it can be later used for purging data not being accessed in a while

  • /stats show (user|chat) will list the list of users/chats and time of last update

Auto-karma triggers

Bot allows to trigger auto-karma events, so when keyword is given, it will trigger an event to increase karma value for other words

  • /autok key=value Will create a new auto-karma trigger, so each time key is used, it will trigger value++ event
  • /alias list [word] Will show current defined autokarma triggers and in case a word is provided will search based on that word
  • /alias delete key=value will delete a previously defined auto-karma so no more auto-karma events will be triggered for that pair

Alias

Bot allows to setup alias, so when karma is given to a word, it will instead add it to a different one (and report that one)

  • /alias key=value Will create a new alias, so each time key++ is used, it will instead do value++
    • This operation, sums the previous karma of key and value and stores it in value so no karma is lost
    • Recursive aliases can be defined, so doing:
      • /alias lettuce=vegetable
      • /alias vegetable=food
      • lettuce++ will give karma to food.
    • Alias can be defined to groups of words so, it can be defined to have:
      • /alias friday=tgif tfsmif
      • friday++ will increase karma on tgif and tfsmif.
  • /alias list Will show current defined aliases
  • /alias delete key will delete a previously defined alias so each word gets karma on its own

quote

  • /quote del id to remove a specific quote id from database

bot's People

Contributors

iranzo avatar flloreda avatar

Stargazers

remove avatar

Watchers

James Cloos avatar remove 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.