hhamana / slack-r Goto Github PK
View Code? Open in Web Editor NEWSlack client for jokers
Slack client for jokers
I've been developing functionality with some external server mocking endpoints I use with some fixed responses, but manual checking is starting to take its toll as functionalities and complexity increases.
Integration tests should be developed to settle what works and detect future breaking changes.
However, Rust's strong typing makes it extremely hard to mock things, and this bot makes extensive use of third-party calls (Slack).
Instead of mocking then, some sort of server mimicking Slack should be re-implemented to respond when running tests.
While ID obfuscate the random choice effectively, it makes it much harder to adapt to sudden changes (member will be off on a certain day, for instance, which the bot cannot know, even with #7.)
Might require saving member names along with IDs when adding from add channel
or add member
, and adapt config.json members
from a Vec to a Hashmap ( {"id": "name"}
.
The joke
command could be given a more generic name, like task
, and the text to send should be customizable.
One could register different kind of tasks, referring to the message, and use the bot to schedule different kind of messages.
This would change the flow to something like this
$ slack-r task joke -d "yyyy-mm-dd"
<user> was assigned to a joke on <day>
$ slack-r task huddle -d "yyyy-mm-dd"
The huddle on <day> will be chaired by <user>
$ slack-r task flower -d "yyyy-mm-dd"
The flower should be watered by <user> on <day>
The duplicate check logic would have to check for the specific looked pattern so many flows can be scheduled on the same day in parallel.
This would allow less commands to type instead of one by one, but also remove the need to check for pending scheduled message in-between, while running on the same connection, therefore much more resource efficient.
Could be either
The current duplicate prevention logic needs to consider the scheduled time, and compare to already scheduled messages, in Local/UTC time. This must take into account shifted times for the weekend cases.
It should also offer a bypass by a flag, such as --force
, and offer to use it when blocking a message.
On a add channel <channel>
command, if the bot is already present, its own ID will be included in the list of channel members.
The bot should make sure to not in include itself in the list of members in config.
Hold an internal count of which members have been used already, and filter them out of the random pick (check blacklist, or pick from whitelist). Reset after all members have been picked once, so the cycle can be repeated.
Considerations:
Allow a flow to delete mistakes/reroll, in combination with the scheduled
command.
Scheduled Display should show the ID information in a clear way to reuse and work with it, also using Local times.
then add a delete <id>
command to delete the targeted ID, with confirmation showing the scheduled message to be deleted.
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.