darrenwee / andreabot Goto Github PK
View Code? Open in Web Editor NEWAnnouncement & acknowledgement management bot. For USC FOP 2016.
License: MIT License
Announcement & acknowledgement management bot. For USC FOP 2016.
License: MIT License
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.
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.
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.
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.
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 must be called with /scream
without arguments. It will take 2 messages to complete the screaming wizard.
targets
to scream to. Separate by at least 1 space.message
to be sent.message
will then be broadcast to all users that belong to the groups in targets
.
User will be able to terminate screaming wizard at any step by sending the /stop
command.
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.
/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
.
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.