-
-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
💡 Auto-thread prerequisites #93
Comments
After thinking about this a bit more, I have an idea for the command structure.
A message would only be auto-threaded if all of the requirements passed, not just any. |
@luniks I think this feature would just apply to channels with |
Hello @MarcusOtter! Thanks for your feedback. Perhaps I misunderstood the topic of this issue. My guest was having the possibility to add conditional rules on how the auto-thread process is triggered (for exemple : a certain role of a user). So the basic idea is to create a new thread only on specific use cases, and a chain of replies could be one of them for me. For sure with this configuration, the auto-threading would become the exception and not the usual case ;) But maybe I missed something or their is some technical constraints I am not aware of. Please let me known! |
Right, I think I was distracted when I read your original message and misunderstood. Sorry about that! Amount of replies definitely makes sense. Might be a bit tricky to figure out implementation-wise but shouldn't be impossible :) |
Any update on this? Would be very nice if this is implented for a suggestion channel for example. |
I think we should make it configurable on what actually happens when the prerequisites are not fulfilled, something like
|
@nchristopher great idea, and lots of neat arguments too!
|
A regex option would be cool - but we need to make sure that we do it safely (there are regexes that can be constructed to be very very slow or hang the program). |
This might be useful then: https://www.npmjs.com/package/safe-regex |
To follow up on this, the ability to exclude some of these criteria would make this feature a lot more powerful. As an example, if I have Bot1, Bot2, Bot3 etc up to Bot10 and I want to exclude Bot10 from creating a thread, it is much simpler to say "user is not Bot10" than it is to say "User is Bot1 or User is Bot2 or User is bot3 etc through to Bot9". |
@YozoraXCII yes, this 100%! Just adding a not operator should be fine, that way you can have a list as an input. Having AND and OR operators too would make the solution a lot more powerful. For example: AND, OR and NOT can also be replaced by symbols if you want. AND = && |
The implementation would likely be something like two parameters |
It is more verbose for sure, but much less powerful. Could we also get an alternative implementation with Boolean expressions supported? |
I think the user experience for the average person is more important than the very very high configurability for the more technical-minded software people. When we start adding boolean logic and scripting to the bot it's better to just let people fork it and run their own versions of commands. So I don't see myself adding something like that, sorry. EDIT: Not to mention how much more complex some sort of scripting logic would be to implement, and a key design goal of this bot is to keep it as simple as possible. |
Okey, fair point :) |
@MarcusOtter ( @luniks ) If I want to fork this to add Auto-thread option after X messages, could you point me in the right direction?.. I assume the settings are stored in this file (for example includebots):
And created by this file: discord-needle/src/commands/auto-thread.ts Line 207 in ee1e717
And then the thread creation is checked with "shouldHaveThread":
I just noticed the comment "// In the future if we have prerequisites we need to check those here", so I assume this is where you imagined putting this..
So I would need some logic in a listener like "if latestTenMessages has only 2 users, then allow thread creation"? Thanks for any input you have. Cheers PS: I'm leaning toward a thread being created only when a "reply" is used. This should simplify everything. |
I think all I need to change is above I'm not sure yet how to check if lastMessage is a reply. According to https://stackoverflow.com/questions/67032774/detect-if-message-is-a-reply, the MessageType can be checked for Reply. https://discord-api-types.dev/api/discord-api-types-v10/enum/MessageType#Reply I think it should be: https://old.discordjs.dev/#/docs/discord.js/main/class/Message?scrollTo=type |
Okay, I've forked and made a single line patch from my last message. Testing now. Parking a couple of feature requests from Discord Support. Apparently, this is how Slack works by default. |
Sweet, it works! @luniks Only two lines were changed. In discord-needle/src/services/ThreadCreationService.ts, |
@MarcusOtter Hey Marcus, I'm going to add this issue as a solution to the Discord Support feature request pages above. Slack is set up this way by default, and it really cuts down the clutter. It would be great to add this to your repo, so people don't have to use my forked version, and can use your website bot invite. Thanks for making this repo! This feature is a big deal for me using Discord and keeping it organized. Like this comment if you want to see this in Marcus's Needle. |
You can use this bot I'm hosting for the time-being. Or you can host your own in GCP: btw, the bot command to turn it on is |
@auwsom Thanks for looking into some of this stuff. Your version seems to make sure that Needle never creates a thread if it is a reply, which is also an interesting aspect we might consider for this prerequisites feature in the future. It will not be merged into the main repo as-is because that would be a big breaking change for everyone and is also not supposed to be the default behavior - it needs to be configurable. But the idea is there, so thank you for showing that it is possible! |
@MarcusOtter sure, no problem.. just to be clear, it makes a thread only when the reply is used. This is how Slack is by default. Maybe we can make it an option. |
Agree with this, and this issue has been up for over a year now, it'd be far better to have a rudamentory version of this feature soon, than to wait another year to implement a more complex version of it. |
If someone could point me to where in code the messages are intercepted and read, I could create a branch and try to begin implementing this |
@Junebugging check out my code (and some details in my comments above) One thing i wanted to check when using it in Discord is that it creates "a subtopic" for each thread in the left side bar. I'm not sure how Slack handles that. |
I appreciate the enthusiasm here and I recognize that this is the most commonly requested feature by far. I don't have a lot of time to work on this bot so that's why progress has been lacking. For me, the main hurdle right now is the UX. What would configuration of this look like? It needs to be very generalizable and easy for us to add more requirements down the line. And it needs to be very clear to the user how it works. The best way would be if we could configuration of this to /auto-thread in some way (since that's how all other settings of auto-threading behavior is handled), but I think the amount of parameters would be very overwhelming (and I think there's even a hard limit of how many parameters we can have for one command). Some things we still need to figure out:
I don't have good answers for these |
The most bare-bones version of this feature is 100x better than none at all, I believe. Such advanced requirements might only be used by a very small minority of the users, and I don't think such advanced features are currently used by anyone, as I can't find an alternative bot that does this. But if you don't want to add the feature unless it's got this modular and future proof functionality, maybe you could handle it through letting the user repeat the option, so say a Example of usage:
The bot would start with the message that was sent in the configured channel, then it would pass it through these include-requirements, then excludes, then overrides, in that order. If it passed all these This is a solid filtering method that I think would fit even a majority of advanced users' requirements, while in my opinion being intuitive enough for most people to understand without any prior knowledge, simply by the prompt alone. The filtering options this would provide I believe is more than enough, because the current alternative is having no requirement options at all. This styling would follow Discord's already established style of filtering syntax, which the target demographic of server-managers are definitely familiar with, only with additional options. It could also prioritize requirements in the same order Discord does, based on specificity, which would be intuitive to server managers.
ProcessingI believe the most logical functionality for the When a message is received, it must meet every
And afterwards, is denied if it meets a Then, In addition, if a ExampleSay as an example you want images sent by people with the @artist role to be threaded, but you want them to be verified because the @artist role is self-selectable, you'd pass OverridesIf you want even more advanced filtering to be possible, a somewhat intuitive option would be to tell the user that placing a The requirements could alternatively be overridden based on the order the requirements are written. Alternative approaches:
(All of these suggestion does however depend on how Discord bots can present information to the user - but even if this is limited, most people looking for a bot with such a specific thread-feature as this would probably be willing to go to the webpage to quickly learn the format of a simple repeated string-based requirements system like the one I've suggested, especially if the bot can give a hint pointing to the help website or command.)
An imperfect but decent solution is better than no solution in my opinion, but I absolutely see and respect your dedication to wanting to plan out how you implement things, to make sure you don't add features that are a pain to work with or change in the future. It's an important thing to prioritize, but personally at least. I believe that if a great deal of time has passed and no better solution has presented itself, it's unlikely that a better solution will ever appear. At that point I believe it's best to take an imperfect implementation, when that imperfect feature can be of great help to people even in its imperfect state. I don't think there's a much better way to implement this either way, unless the entire input system is re-built to use reactions and dropdowns like some other bots do, or unless Discord bots can present more advanced options or popups to users, within a simple message-command, than I'm aware of. PS: Sorry for the ridiculously long message, hope I made my suggestions clear despite the length, and that they can be of use somehow. |
Lots of good points, thank you for all of this. It's super helpful to go back and forth a bit on this and to write it out as most of it has just been in my head 😅
I agree. At the same time, we don't want to come up with a patch later that completely rewrites how the bare-bones version worked, that will just be frustrating for users. We still need to plan ahead and make sure it can be expanded on, unfortunately. That doesn't mean we need to solve the complex and highly unique case that I mentioned as an example, but here are some use cases I think we actually need before shipping a bare-bones version (which has been requested numerous times):
As far as I know, this is not possible in Discord. A slash command can only receive a set number of arguments and arguments can not be repeated.
Yes, I think this is actually the biggest obstacle right now. It's really hard to display information like this intuitively to users and that's kind of where I get stuck, in the specific details of implementation (what should be a command, what should be an argument, etc). I think the suggestion you put on the table is okay UX wise, but the auto-complete interface really does not work well in my opinion (and also, is not very commonly used by bots, so many users will likely not understand how it works). Especially pinging specific roles and channels would be difficult in a setup like this because, yes, we can give suggestions, but sometimes the names aren't unique. For example you can have multiple "#support" channels under different categories, but a user could never figure out which one is which in the auto-complete. We would need Discord's channel picker here, since it shows the category the channel is under. EDIT: Of course the channel filter makes no sense here, but a similar problem could occur with roles or users with nicknames. The main point is that Discord's dropdowns are easier to user for normal people than selecting (or not selecting) a text suggestion. Another benefit of using the actual Discord-native dropdowns would be that we can give validation before they even send the comamnd (e.g. not a valid channel, not a valid user, etc). With auto-complete and raw text, a user could send whatever they want, and our bot would have to try and parse that string, and only then get a reply back, which is a more frustrating experience. Especially if you've written multiple requirements already. The trial and error loop becomes much more cumbersome and I think I would have to dedicate a lot more time to helping users set up Needle to work for their servers (which I am basically not doing at all right now! only RegEx help every now and then).
I still stand behind what I said last year regarding writing boolean logic or raw text - it is not a good user experience, and 99% of users don't want it. The 1% that want the advanced functionality can fork the bot and implement their own logic. I don't want to encumber/overwhelm "normal" users just to make the bot more advanced, even if that just means a handful of new parameters in a command. It would be great if we could just use the built-in Discord dropdowns and pickers over raw text. Not to mention how convoluted and overly complicated the implementation would be.
One thing that would actually just make this so much better is if Discord just released multi-page modals and added more components to modals (like user/role dropdowns, channel picker, etc). They've been talking about it for years but developer experience isn't exactly their main priority, unfortunately. Just thought I'd throw that out there - it's possible that Discord does actually release things that make the UX so much better. But you're right that sitting and waiting around for something better to show up isn't a good idea. |
Here's where my head is at right now:
At least we could do the use-cases I mentioned in the last message with this. I'm thinking the The good thing about this UX is that we use Discord's native pickers for everything and we can give the users good hints throughout the process. The drawback is that it's a separate command and is a bit verbose, but I'm telling myself that this makes it more clear for the users. Here's another suggestion, splitting
One drawback of this is that it's not obvious that setting
OR
|
Oh yeah that's true, if Discord's selector prompts can't work within a text command like that that complicates things a bunch. And I completely agree that requiring the user to learn to create a complex filtering string is not desirable at all, especially when Discord selector prompts don't work, something that could cause same-name conflicts.
But again, the intent of suggesting it is that it could be an easier-to-add advanced option for the users who need, it in case the feature doesn't get implemented properly, but that could remain alongside a proper implementation. I don't think this is necessary at all, so long as the feature is likely to be implemented in some other way. So for now, not something to think about. Anyways, back to the proper implementation I really like your filter suggestion! I think it makes the most sense and is the most intuitive for AND'ing together filtering options, as long as it's clear that it interacts with the auto-thread command. Though it still isn't entirely clear that they'll be AND'ed together, so what about your suggestion (either first or second), but an additional option for AND'ing filtering options, called The including, requiring and excluding could be handled by:
|
Require is a better word for it, thank you. With I think Also maybe to make it clear that |
We also need to figure out what to do with the current So by default we also create threads on bots, and then we remove the |
I don't think user complexity should be a concern when other more basic features, like custom titles, have regex like this without an explanation: And all of these options To configure Needle properly you already need to be a bit technical, so needing a bit of technical knowledge for this kind of feature wouldn't be deviating from this |
I like your suggestion, something akin to
But the command can be changed later on |
Any update on this? |
Describe the improvement
A way to select requirements that a message must pass for it to be auto-threaded.
For example, a server might want to only auto-thread on messages that contain a link, or have a keyword, or are from a specific user or bot (#61).
I'm not exactly sure how this should be implemented. The string option only allows selecting one choice, and this would probably work best as a dropdown. We might be able to use modals or a dropdown message component.
Problems this improvement solves
In one of the Discord servers I'm in, we have a news channel, where members post links to news articles. Needle is setup to auto-thread messages in this channel. However, other messages are sometimes sent in this channel, so it'd be nice to only auto-thread on messages that post an article.
Alternative solutions
No response
The text was updated successfully, but these errors were encountered: