Giter VIP home page Giter VIP logo

andreabot's People

Contributors

darrenwee avatar hongshaoyang avatar

Watchers

 avatar  avatar

andreabot's Issues

parallelize message send to large group

There should be a better way to broadcast messages to a group. With the current list of ~20 recipients, a /yell message command takes around 40-60 seconds to fully propagate as each message is sent only after the other.

Might investigate asynchronous functionality from PyTelegramBotAPI to speed this up as the broadcasts are not dependent on each other. Low priority but nice to have. Might need to upsize the DigitalOcean droplet to get more CPU threads.

persistent storage of announcements

Announcements are currently stored in a volatile list. The list is lost upon termination of andreabot.py or if the bot crashes.

Investigate use of shelve library to make announcements persistent.

remove timestamp from broadcasts

I am unsure if Telegram's message time-stamps are based on time of send or time of receipt. If it is the former, we can strip the time-stamp from /yell (and /scream) to eliminate message bulk.

Will attempt to test this with others.

on-the-fly user management

Currently, adding a new user to the mailing list in authorized.py is a slightly painful, manual process that also requires restarting the bot which also clears the announcement list as it is currently volatile.

Investigate a way for an admin to add a new user to the mailing list through a Telegram command, e.g. /admin add chat_id user_name and have it remain persistent. Related to #3.

screams: targeted yells with acknowledgement

Background

Yells are messages that are broadcast to all users on the mailing list (see /who) by a person requester without requiring acknowledgement.

Screams will be similar to yells but are (1) targeted to groups and (2) require acknowledgement.

To implementing acknowledgement, all messages (scream or yell) with now be indexed with an ID.

/scream

Usage: /scream

Launches the screaming wizard for the requester.

Wizard Steps

Wizard must be called with /scream without arguments. It will take 2 messages to complete the screaming wizard.

  1. Request for list of groups targets to scream to. Separate by at least 1 space.
  2. Request for the message message to be sent.

message will then be broadcast to all users that belong to the groups in targets.

Early Termination

User will be able to terminate screaming wizard at any step by sending the /stop command.

Illegal Parameter Check

Check for valid group names in targets at step (1). We will follow the group key listed inside authorized.py which is also returned to the user upon a /who query.

Supporting Functions

/from

Usage: /from <person> or /from <group>

Returns the 5 most recent messages from person or from anyone in group, or No such messages found. to requester.

/get

Usage: /get <id>

Returns a message with ID id to the requester, or No such message found. to requester.

/read

Usage: /read <id> by requester

Flip the hasRead flag for requester for message ID id and return success/failed notification.

/status

Usage: /status <id>

Returns a list of who has read, not read or failed to receive message ID id.

House Collapse

If targets contains cogls or vogls, we will perform house collapse where only the COGL/VOGL from each house will need to respond (i.e. use /read <id>). This is reflected in /status by only showing which houses have acknowledged.

Example

The reply from AndreaBot should look like:

Read:
1. Nox       2. Verde
3. Sigvar

Not read:
1. Jileen    2. Aether
3. Deborah

Failed to receive:
1. Hydra

This will enable the /scream requester to quickly check which houses have read the announcement. Non-house affiliated members are represented by their names as per normal.

If at least 1 member from house can receive, house will never be recorded as failed to receive. Similarly, if at least 1 member from house has read the message, house will be shown as read.

/vstatus

Usage: /vstatus <id>

Similar to the return from /status but without house collapse, i.e. all recipients are individually listed.

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.