jkomoros / flux-bot Goto Github PK
View Code? Open in Web Editor NEWDiscord bot for GALE-x
Discord bot for GALE-x
messages that have ๐ฏ ๐คฏ ๐ get skimmed into the cream of crop channel
Originally captured in #19
Make it general, so there's a emoji combination --> thread skimming
e.g. hashtag-worth-your-times with a summary sentence
bot picks them up, puts into (v0: a rollup channel, v1: an external thing like the working doc) with a link back to the hashtagged comment
And also later e.g. livestreamers (?)
Sometimes we'll be having a random conversation when we think, "hey, this message would be a good Lens of the Week" or "hey, that's a signpost". Copy-pasting the message over to the relevant thread where we catalog those items has a bit of friction, and so many of those valuable messages get lost. What if a simple emoji reaction to a message could send the message off to a specific channel for easier cataloging?
๐ can send the message to #signposts
๐ to #lenses
๐ to #books
๐๏ธ to #worth-your-times
๐ to a yet-to-be-created #article-ideas (or similarly named) channel
This would be mostly a copy-and-paste operation, either copy-pasting the text of the message or (if possible) pasting a deep-link to the message into the new channel.
We may need to add some kind of guide to remind users which emojis do which things.
e.g. look for a name without spaces
The production bot just runs in a tmux session on a VM somewhere, printing log messages to stdout no one is watching. That also makes it hard to tell if it's working or not. (Although the 'Available' indicator in the Discord UI for the bot is an easy check that the binary is at least still running with a valid Discord session).
When running in production it should instead log to somewhere more visible, ideally visible in Google Cloud Engine logs of some form
For example, use TFIDF to pick out diistinctive words to rename a thread distinctively.
There could be a slash command that could be run in the thread to update it.
Threads created by forking (see #34) could also automatically be named with this.
Generating a TFIDF index is hard for the whole corpus. We could use a TFIDF map extractec from https://thecompendium.cards as a default to start from. And use the same stemming.
Improve coverage by writing a few smoke tests that give us a bit of confidence about refactorings.
GuildCreate
that triggers creation of "Archived Threads" categoryMessageCreate
smoke test(s)ChannelCreate
smoke test(s)ChannelUpdate
smoke test(s)Some old threads are archived but it would be good to be able to ping them againand resussicate them.
This would be kind of hard because you'd want all of the channels to cascade down through the previous archives as a new one in the active set is pushed down the edge.
Related to the original #34 issue
Where people who start threads with lots of participation can generate more OPs or something
perhaps even session.channelMessages will sometimes return messages without a guildID?
Create a new archive, if necessary, to hold the thread.
Mark as read only.
Organize the archive category towards the bottom (but above previous archives for this group)
๐๐ฏ๐คฏ -> Copy to "Best of" thread
Consolidate URLs in a channel
Consolidate book mentions by crawling for Amazon, Goodreads, etc
A different bot ID for the dev one and the production one.
Document patterns to test and patterns to deploy in README
If not running rocketchat, can be smaller, less storage.
Better deployment options? Maybe a docker image for convenience?
For a guild, reprocess to handle which categories are thread, and which ones are archives, every time a channel is edited or created. (Note that reordering will generate a lot of events)
To create a thread
Where all of them end in Threads
. Main Threads
, Core Threads
, Threads
, etc. Each with their own archive.
Including thread n count
configuration and the token
Note: it's hard to detect that a channelUpdate happened that made a channel a thread (i.e. that it's parented to a Threads category)
... Or at least something other than my mac pro
That happens ALL the time, every time a channel has its position changed.
One idea is to have the channel indexes have very large gaps, and when the channels are updated, only update the index if necessary to get it in the right order. And then skip channels whose position numbers don't need to be udpated.
Useful for e.g. creating a new thread based on an article when on the go
Discord only allows 500 (I think) channels. At some point we'll hit that limit. (Remember that categories also count as channels).
Ideally well in advance of hitting the limit (maybe 10?) we'd do some garbage collection and compaction.
One option is to just download a JSON dump of the old thread (we could just use discordgo's structs) and keep that around in some backup. That should work but it's offline backup--it wouldn't be possible to search the threads for example.
Another option would be to create an archive thread and then reply the conversations to them in some format. You'd ideally want to have similar numbers of emoji reactions to them, maintain reply-style structure, etc. It would be kind of hard to do presumably.
E.g. bot DMs the sponsors to ask for recommendation text, then shares in a new thread in the core group
With #35, we're fetching all messages to do processing. Other features will need that index, too.
Currently it's just being done by saving out a JSON snapshot every so often, but for bigger guilds that won't work.
Perhaps Firestore? Keeping the index in sync will be a pain in the butt but is necessary for lots of things...
Somewhere in the discord server so people can know how it works
Or rather, weren't when Thread Archive 0 was created. Perhaps it was because the production bot hadn't had its permissions set correctly?
If it doesn't happen when Thread Archive 1 is created then we can safely ignore it.
If someone replies to any message in any channel and uses the magic command, then the bot should create a new thread starting with the message that it's in reply to.
At the beginning, it will be a slash command reply that is in reply to the message that should be the new OP.
The thread OP should be a copy/paste of the message, with a link back to the original (using a channel reference, an actual link, and an @mention of the user).
In the future (once #35) is supported, when we can rename threads by tfidf words, then it should be possible to fork a thread merely by hitting the ๐ด emoji reaction on a post and have it auto named based on the contents of the OP.
Originally captured in #19
While working on #34, I was going to do a slash command for forking... but it turns out that it's not possible to issue a slash command in response to another message.
The machinery to do a slash command is something we'll definitely want again later, so might as well do a basic behavior with it. /archive
is that behavior, I guess.
For any members who haven't written any messages within 3 (?) months, move them from Member to Lapsed Member, which removes their read/write privilges on all but the #ground-rules channel. To get reinstated they just have to do a simple action--ping the admin email group, or maybe ping the bot, and they'll be reinstated.
Perhaps just before you are switched to be a lapsed member, the bot @mentions you in a main channel, so that others who are participating can see you're about to become a lapsed member and maybe ping you to encourage you to particiapate?
e.g. a bunch of replies, or a bunch of new messages in a short burst
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.