ineshbose / boyd_bot_messenger Goto Github PK
View Code? Open in Web Editor NEWBoyd Bot (Flask Version)
Home Page: https://inesh.xyz/boyd_bot_messenger
License: MIT License
Boyd Bot (Flask Version)
Home Page: https://inesh.xyz/boyd_bot_messenger
License: MIT License
The class Database
implemented in services.py
isn't as modular as it's intended to be.
As of release 1.10.0, this project uses pymongo
which is a NoSQL DB that easily stores dictionary / key-values in the database.
However, there may be difficulties to alter the class for say, redis
. Therefore, the class needs refactoring.
Each tuple has 3 attributes - _id
(primary key), uni_id
and uni_pw
. However, in-registration users will rather have _id
and reg_id
.
The bot should be able to provide a map, directions or link when a user asks for a specific location on campus. For example,
"Where is my next Psychology lecture?"
"Where is the Boyd Orr building?"
The locations can be found using event["location"]
in timetable.py
(that is if "location" in event else return "No Location Found"
). A raw link would be a little shabby, so an embedded map in the chat-bubble is preferred but this is not supported by all platforms.
Google Maps is the preferred service for locations. Some universities also use a custom map (by Google Maps) for their campus (eg https://www.gla.ac.uk/explore/maps/).
While developing the scheduler for v1.12.0, I discovered that cal_url
(atleast Glasgow) limits requests to approx 250 a day (I hit 288) and therefore I was blocked for a 24 hour period.
The app has been ignoring the limit and needs to consider this using _config.py
.
Timetable.login()
is the only bit that deals with GET requests with cal_url
.
Going to an initial idea of implementing the application in Django.
This would also change data to an SQL database.
_config.py
can be adjusted using settings.py
, and the app can then be distributed as an independent Django app (may also require setup.py
).
Universities often have confession pages which makes university life much more interesting and fun. Uni-Truths is a platform many universities use for this system. Having a bot submit a confession when told something like
"I wanna confess that I once took a piss and threw up at the same time in the GUU toilets. That takes skill"
"Post on GlasKnow / confession page - I miss my library crush"
However, due to chatlogs, etc, these confessions won't be TRULY anonymous.
If a university doesn't use this, they can toggle this off.
(Examples above may or may not be true.)
Currently, reading the next class is pretty limited.
In an earlier version, read_next
was a separate intent, but now is integrated with read_timetable
. It is called when there is no time found when parsing text.
However, the bot just reads the next class from the same day.
A user may require their next class, be it next week.
Another example could be "my next Java Programming class".
Enable users to use the bot and not have their University ID & Password stored in the database, but to fetch the calendar once.
This will require a BooleanField
in RegisterForm
with label "Remember me" (default=True
) and just store their sender ID in the database for getting to the gateway.
However, this feature may be unstable since the once-fetched calendar may get lost (a small chance).
The documentation for this project is done through MkDocs.
The content in docs/app.md
needs to be same as README.md
(be the same file basically).
Possible solution: symlink
Create tests for the app that should pass before deployment / commit using test user/data, parsing sample phrases and returning desired output (like timetable).
Many universities use Moodle (an open-source learning system) for courses, assignments, etc.
The bot should hopefully be able to fetch data regarding deadlines, submissions, exercises, etc.
If a university doesn't use this, they can toggle this off.
This issue is for Release 1.10.0 where fuzzywuzzy
is replaced by rapidfuzz
for its MIT License and better performance.
The package, however, may have installation problems for users (mostly Windows). While there's no proper solution for this yet, rapidfuzz
recommends to install as listed in their documentation.
Create a version that works on Discord instead of Facebook Messenger.
This would be a branch on the same repo and the goal would be to produce minimum diff.
Universities offer rooms around the campus for students that need one for say, a meeting. The bot should be able to book or provide information about rooms when told
"Book a room in the library for 24 November 2pm"
"Which rooms are available?"
This feature may be really difficult to implement since most universities have different room-booking systems. Webscraping (using selenium
) is an option (a bad one).
The bot should message all users (that have the preference) every morning, or possibly before every class with information about the day. For example,
At 8AM:
"""
Good morning {{ name }}
! Today you have..
``{{ classes }}`
"""
or before a class:
"""
Hey {{ name }}
, I hope you're headed for your {{ class_name }}
at {{ class_time }}
in {{ class_location }}
.
"""
Feature will possibly require threading
.
When a single class is presented to a user, that should also become the context of a conversation. For example,
User: What do I have next?
Bot: You have Psychology from 9AM to 10AM at Boyd Orr Building.
User: Where is it?
Bot: {{ location of class }}
Contexts, however, are not supported by all services (like wit
).
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.