redbrick / brickbot Goto Github PK
View Code? Open in Web Editor NEWA simple serverless bot for the new Redbrick Discord.
A simple serverless bot for the new Redbrick Discord.
luas - a command that gives luas information by stop number
I'm not really sure if this is a Realtime API either but it exists. I'll snoop around for projects that might do this too.
No args:
should list all available commands with a blurb as to what they do
One arg:
should list help for the command specified in the argument
info - a command that simulates that gives you brickbot information such as the author, contributors, a link to the code, and current uptime.
I haven't looked for any code yet, but this should be as simple as a few lines of bash/python/whatever :P
A job that runs asyncly in the event loop to move users that are verified into the brickie role.
crypto - a command showing the latest info on a specified cryptocurrency
https://github.com/nemo-rb/mooney is a very popular bot in Redbrick IRC - we can use something with this. Maybe not with that code exactly, but something similar exists
Name of Command
qr
Description of Command
Receives a URL and returns the output of https://faas.jamesmcdermott.ie/function/qr
as an image, which is sent to the channel it was received from.
Does code exist to implement this functionality, and if so where can it be found?
The function for this exists at https://github.com/theycallmemac/brickbot-faas/tree/master/functions/qr
Simple, I have it as an OpenFaas Function already, I just need to build in the capabilities for calling it.
Really easy stuff, we --> I type things.
Introduction in this commit.
Line 89 of bot.js
Block by #16 at the moment, but something to consider, it'll make life easier.
convert - represents the equivalent conversion for a sum of money from one currency to another
I wrote https://github.com/theycallmemac/convert a while back, and I can probably fix it up to get it running once more.
Should begin a DM channel with the caller and start the signup/verify flow
New commands - by default - should only be runnable by "special" users - i.e., users we can trust.
Otherwise, a commands audience can be specified as an array of roles we want to use it.
By default, this shall be ["committee", "rbadmin", "dev"]
for the sake of simplicity, with left to right precedence (a dev can't derole and admin, and admin can't derole a committee, etc)
wiki - returns a link to a random page on wiki.redbrick.dcu.ie
There's a Random Page functionality on the wiki already so could be a fun one for people to just ping all the time on Discord. May also encourage use of the wiki.
Brickbot (once the framework is together) needs an isitup command to display website information.
If every plugin was spun up using OpenFaas it would mean that we could write a plugin in any language.
bus - a command that provides dublin bus information via bus stop number
Dublin Bus provide a real-time API. https://github.com/adamisntdead/DublinBus or something similar would suffice.
Simple, I have it as an OpenFaas Function already, I just need to build in the capabilities for calling it.
The current system just checks that a user exists. There is no verification of identity and no checks for collisions in used usernames. See #51
The verification flow should do the following:
currently still uses my circleci by this i mean the CircleCI image in the README.md to this --> https://circleci.com/gh/redbrick/brickbot.svg?style=svg
The !verify
command accepts a username as the first parameter, which is used to lookup a user on an LDAP server. It's possible to do !verify * [email protected]
(the username being a wildcard), and have brickbot cycle through every single user on the LDAP server to see if the email [email protected]
matches their altmail. If it so happens that the email is associated with any username in the database, it'll grant you access to the Discord server. It may also be possible to craft other strings to send to the LDAP server, as presently, brickbot just injects user input into the search string.
I think the easiest way to fix this is to use an EqualityFilter
as the filter
key in https://github.com/redbrick/brickbot/blob/master/commands/verify.js#L19, but I don't have the time to test it.
The package.json file is missing a significant amount of information - all it contains are dependencies. It needs to be updated before resolving #17
Should send an email request to the admins asking that a given username <> email combo be registered.
announce - a command that sends a copy of the most recent Redbrick announce letter privately to whoever invoked it
I don't really think there's code that does this anywhere. Something fresh needs to be written.
events - a command that gets a list of redbrick events for the specific period of time (day, week, month)
There's no code out there for this at the moment, but we use Google Calendar for all the events so that could be a great place to start.
Self-explanatory.
translate - takes text provided and translates it into a desired language
This is definitely easy to put together - https://translate.yandex.net/api/v1.5/tr.json/translate is probably the API you want. A key for the API can be obtained from https://translate.yandex.com/developers/keys
It feels overly simplistic but because all of the functions are hosted in the form https://faas.jamesmcdermott.ie/function/namedFunction
it makes sense to check that https://faas.jamesmcdermott.ie/
is up first. It's probably also worth testing that the SSL cert is valid.
weather - show the expected weather forecast for today.
I think https://github.com/schachmat/wego is a good option for this. Very easy to configure. The real work here needs to be the JavaScript to display it.
coinflip - a command that simulates the toss of a coin
I haven't looked for any code yet, but this should be as simple as a few lines of bash.
Brickbot (once the framework is together) needs a spotify command to display track information
This is pretty self explanatory. Tests should also be mandatory when submitting PR's with changes being made to the logic of bot.js
committee || cmt - lists all current Redbrick Committee members by rbusername, name and role.
Could implement a feature where you can request specific roles;
!cmt admin
It would then return username, name of every person in that role (maybe a photo/link to redbrick site with more info about that person if we want to look at that further down the line).
room - provides timetable information for a specified room or building in DCU
Once upon a time https://github.com/theycallmemac/dcurooms was all the rave, I swear. It can work good in this context I just need to figure out how to implement it accordingly.
Simple, I have it as an OpenFaas Function already, I just need to build in the capabilities for calling it.
Check off a valid username <> email combo and send a verification email
Move all users with role X
to role Y
in keeping with the permissions system
Paths such as /home/bots/brickbot/commands
in bot.js and brickbot.service.
Along with this, we should move tokens from /tmp to /etc.
This should send the user a generated password. Also ideally dont log it
Replicate original coinflip functionality
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.