Giter Site home page Giter Site logo

round_robin_tasker's People

Contributors

dattatreya303 avatar

Watchers

 avatar  avatar

round_robin_tasker's Issues

Add persistence to conversation handler

To make a conversationhandler persistent (save states between bot restarts) ConversationHandler(<no change>, persistent=True, name='my_name') If you want a conversationhandler to be persistent you MUST NAME IT. persistent is False by default. Adding these arguments and adding the conversationhandler to a persistence-aware updater/dispatcher will make it persistent.

Handle commands interrupting a conversation

Problem: Updates get checked through the handlers sequentially. So if a user, while in the midst of a conversation, sends a command which is processed before the concerned conversation handler by the dispatcher, it messes up the conversation (especially if its another conversation).

Possible fixes:

  1. Maintain a var in context.chat_data to identify any ongoing conversation. Check that var at the beginning of all command entry point callbacks. Proceed only if the var is empty.
  2. Maintain a var in context.chat_data to identify any ongoing conversation. Add a top-level nested conversation handler. the entry point should be any message, the timeout should be infinite, states should correspond to actual user commands. Make the entry point a command handler. First, perform the check for an ongoing conversation and if found return that state. If no ongoing conversation, return the state corresponding to the command (over a switch case preferably).
  3. Maintain a global var to identify any ongoing conversation. Send all updates to that handler only. Will require changes in the library. We will have to use a fork of the library with our changes, and not download from pip. Will need to create a separate build script.

Decentralise logging

A single log handler is being used right now, which belies source (class: function) of the log. Separate log handlers for each file/class would give more comprehensive information.

Missing chat id checks on chat data context

Key checks are missing for chat id in context.chat_data in several places. This is leading to KeyErrors when starting the server or sending a command in a chat with no associated ChatData object.

Add unit testing

  • Make test cases for each issue labelled with feature and bug.
  • Make it a norm to write test cases first for all future features and bugs.

Add /start command callback method

  • Introduce the bot and what it does.
  • Mention the test bot for experimental features
  • Show the list of commands and brief instructions
  • Mention telegram id for feedback

Update README

The first part should be same as #13 .
Add more details about repo structure, deployment process, persistence, todos etc

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.