AdamT20054 / DJSCaptcha

A NPM module for Discord.js made to easily create CAPTCHAs to present to your Discord servers members.
https://www.npmjs.com/package/djscaptcha
GNU General Public License v3.0
13 stars 1 forks source link

Option to send captcha in ephemeral messages through the buttons #9

Closed Francesco99d closed 1 year ago

Francesco99d commented 2 years ago

Given Discord's new Ephemeral messaging feature, one could use this method to send the Embed containing the captcha and via the buttons (also recently introduced), one could reply with the code so as to be verified. Doing so also solves the problem for users who do NOT have Direct Messages active for the Server in question (since the whole verification procedure will take place in the verification channel on the Server itself).

github-actions[bot] commented 2 years ago

Thank you for opening yor first issue! Following our issue templates will help us fix the issue quicker

AdamT20054 commented 2 years ago

I actually really like this idea.

I can add impheral messages this weekend.I'll look into adding buttons for it too.

If users have DMs disabled, it'll send the captcha in a given channel (Right now the message isn't empheral) so once that's changed to empheral it should be sorted.

Thank you for the suggestion :)

Francesco99d commented 2 years ago

Thank you for the project, I am glad you liked my idea.... This solves a possible problem, plus it uses new functions of the Discord API. I wish you good work and a happy continuation of the day

AdamT20054 commented 2 years ago

Thank you for the project, I am glad you liked my idea.... This solves a possible problem, plus it uses new functions of the Discord API. I wish you good work and a happy continuation of the day

Honestly I completely forgot about ephemeral messages.. they were around with V13 and I've been using them for a separate V14 project so I'll 100% add this in (probably as an option).

Could you elaborate on how you'd think the bot could use buttons? I can look at making a button builder option where you can send button links along with the captcha but besides that I'm not sure how else it'd incorporate them.

I also take it you're facing no issues using the module? (Just checking, didn't run a unit test before the last push)

Thanks :)

Francesco99d commented 2 years ago

I honestly don't have much time lately, so I only had a look at the project.... As soon as I can, I will try it out ;). Regarding my idea of "button implementation", I was thinking to leave the message explaining how to occur and below it pop up a "verify" button that will send an ephemeral message with the captcha and below it an additional message (similar to the previous one that takes advantage of an additional function of discord i.e. forms so that the captcha code can be entered there). In my opinion, it would come out very professional and clean without having to resort to sending in DM or using an additional channel for sending the code...

To explain further I am attaching some screens, I hope they will come in handy: image image image

AdamT20054 commented 2 years ago

I can look at implementing the buttons in the future, however it'd take some time to add them in a way that makes sense.

The module doesn't use a "verify" message to trigger the captcha, the module will produce and handle a captcha when it is called. If you wanted a specific implementation then (not yet) you can call the module when a button is pressed (and I'll add support for this in the coming updates) and it'll handle it through buttons/modals instead of messages.

Thanks :)

Francesco99d commented 2 years ago

The idea of "triggering" captcha submission with a button is for the sake of argument just an idea.... The really useful thing (in my opinion) to implement is the utilization of modals for code entry so by doing so, you will be able to use only one channel (the one directly in the Server) and avoid having to have the message written in plain text. If you then combine this with the use of ephemeral messages, even better, it will give the whole thing a more polished and professional look.

In any case I appreciate you taking my ideas into consideration ;)

AdamT20054 commented 2 years ago

The idea of "triggering" captcha submission with a button is for the sake of argument just an idea.... The really useful thing (in my opinion) to implement is the utilization of modals for code entry so by doing so, you will be able to use only one channel (the one directly in the Server) and avoid having to have the message written in plain text. If you then combine this with the use of ephemeral messages, even better, it will give the whole thing a more polished and professional look.

In any case I appreciate you taking my ideas into consideration ;)

I'm working on the ephemeral feature now, and we can only use it with interactions. The idea of this module was text based so I'd have to completely re-write it to utilise interactions instead.

So the idea wont be out this weekend - not unless I find some miracle cure to keep focused for 14 hours a day lol - but switching the entire module to interactions is something I've already started.

I'd expect it to be out in ~3 weeks. You can use the module like normal till then, I intend on not forcing the use of interactions - for those who auto-update modules and those who simply don't want it - so it'll require slightly different use (which I'll explain in the docs when it happens).

You can keep track of this on the Project page, and I'll periodically update in this issue :)

AdamT20054 commented 2 years ago

I have created the Interactions branch for this implementation

Branch: https://github.com/AdamT20054/DJSCaptcha/tree/Interactions

Francesco99d commented 2 years ago

Well what can I say, I really thank you very much for the effort you are putting in and don't worry, it was not my intention to increase the amount of work, take as much time as you need.... I'm looking forward to seeing the development of the project, I'm just sorry I can't give you a concrete hand in the development... Unfortunately, my knowledge of JavaScript is limited to the basics :/

AdamT20054 commented 2 years ago

Well what can I say, I really thank you very much for the effort you are putting in and don't worry, it was not my intention to increase the amount of work, take as much time as you need.... I'm looking forward to seeing the development of the project, I'm just sorry I can't give you a concrete hand in the development... Unfortunately, my knowledge of JavaScript is limited to the basics :/

haha no worries :)

Thank you for the suggestion though, I'll keep you updated on it's development

AdamT20054 commented 2 years ago

Quite glad you suggested this actually.

Doing a rewrite, just found a load of small errors I've only just picked up :)

Francesco99d commented 2 years ago

Quite glad you suggested this actually.

Doing a rewrite, just found a load of small errors I've only just picked up :)

Glad to have been helpful ;)

AdamT20054 commented 2 years ago

Complex logic gates are a headcahe when you end up with a problem there isn't already a gate for :p

Francesco99d commented 2 years ago

And that's where you have to engineer to join multiple ports together :/ The beauty and the ugliness of programming...

AdamT20054 commented 2 years ago

20220913_144135.jpg

Spent my computer science class doing it... turns out I was just overcomplicating it

Francesco99d commented 2 years ago

What have you been asked to accomplish? The important thing is to succeed in the task. Then in computer science, many times the way to solve a problem, goes through mistakes first.... And that's where you have to prove yourself. If I can give you one piece of advice, whatever happens, never get overwhelmed by problems (and I'm not just talking about programming)

AdamT20054 commented 2 years ago

The final notation I come up with was

(A+B)*(-C+D)

This encompasses everything the bot needs to do when it comes to kicking people. A and B being for the Role Add, and C and D being for the Role Remove bit (I'll comment on it some more in the code comments)

AdamT20054 commented 2 years ago

Also going to add logging.

logChannel: Logging:

Francesco99d commented 2 years ago

Well it seems like a good idea to add modules dedicated to Logging, I'm glad this template is evolving

AdamT20054 commented 2 years ago

Spent the past 2 days fixing an issue that wasn't an issue, i had just misunderstood my own design 😭 Beta update coming out tomorrow, ephemeral update to follow after

AdamT20054 commented 2 years ago

For the logging, going to do a very basic version for now, I'll come up with a robust solution for the Ephemeral update (where you can customise the log embed with the captcha options)

Francesco99d commented 2 years ago

Great, thanks for keeping me updated ;)

Spent the past 2 days fixing an issue that wasn't an issue, i had just misunderstood my own design 😭 Beta update coming out tomorrow, ephemeral update to follow after

Don't blame yourself, we all go through times when our heads are off and we end up stuck in a loop. Just look at things from a different perspective (or after a while) and you can find a solution 😅

AdamT20054 commented 2 years ago

I can add impheral messages this weekend.I'll look into adding buttons for it too.

I may of lied, this was before me realising it'd need a whole re-write 🤣 Good progress nevertheless, slowly building it up,

Francesco99d commented 2 years ago

Unforeseen events are always around the corner, take your time ;)

AdamT20054 commented 2 years ago

First re-write out this weekend, then Ephemeral can be built on it (should be out the following weekend)

Francesco99d commented 2 years ago

Good job, I'm eager to try it out

AdamT20054 commented 2 years ago

I don't know why logging is the hardest thing to implement 😭 Logging is out this weekend, or I'm putting it on hold till after the Ephemeral update is out :) Don't really want to drag out this update just to add logging in

Francesco99d commented 2 years ago

If I can give you some advice, work on the project by setting goals for yourself; you have on your side the good fortune of not having deadlines to meet. If I were you, I would set priorities for the various features to be implemented; for example, do you want to work on a feature that you think is really critical? Well, devote yourself to just that, and ONLY if you have time left over, you can devote yourself to something secondary.... Otherwise you run the risk of overloading yourself with a myriad of things to do at the same time, and this I advise you to avoid. Take your time to do everything, the project itself is very interesting and once it is finished, if you can add all the features you mentioned, it will be more complete than ever! I trust you and appreciate your determination and commitment that you are pouring into this project; I believe it will be able to help numerous people like me looking for such a solution. Regarding the problem with Logging, how come you are stuck? If I can give you a hand in at least figuring out what's wrong, I'd appreciate it. As much as I am not well versed in the practical act, I can provide support in framing the problem so that you can more easily arrive at a solution...

AdamT20054 commented 2 years ago

I cant actually remember that the issue was, had to put it on hold while I did some school stuff.

I'm off for the next 3 weeks so I'm going to try get it sorted (with logging done for hopefully Monday) and I also want to convert it over to Typescript since It's a lot better for the people who use it (because it has typings).

I need to have a mini-rewrite once I've got this V2 update pushed, just so everything is organised again, also added #14 which I need to do (which isn't hard in the slightest)

Thanks for your support <3 Hopefully I'll have something you can use ready for next weekend :)

AdamT20054 commented 2 years ago

**the TS update is a long way away, I have loads of things planned before that so it'll probably be the V3/V4 release (V2 is the Interactions update)

AdamT20054 commented 2 years ago

Logging is done, just got to iron out issues with the kicking now because JS struggles with logic gates

Francesco99d commented 2 years ago

I cant actually remember that the issue was, had to put it on hold while I did some school stuff.

I'm off for the next 3 weeks so I'm going to try get it sorted (with logging done for hopefully Monday) and I also want to convert it over to Typescript since It's a lot better for the people who use it (because it has typings).

I need to have a mini-rewrite once I've got this V2 update pushed, just so everything is organised again, also added #14 which I need to do (which isn't hard in the slightest)

Thanks for your support <3 Hopefully I'll have something you can use ready for next weekend :)

Great, I see you are getting your work organized, great thing.... You did well to break down the various features into the various sub-versions of the update, better to do a few things at a time. Of course you always prioritize the school first so there is no rush in completing this project.

Francesco99d commented 2 years ago

**the TS update is a long way away, I have loads of things planned before that so it'll probably be the V3/V4 release (V2 is the Interactions update)

Great, I will be happy to try it, of course I will try to be your beta tester in case I find something wrong ;)

Francesco99d commented 2 years ago

Logging is done, just got to iron out issues with the kicking now because JS struggles with logic gates

Well done, I remember you were stuck on this very aspect.... I'm glad you were able to implement it

AdamT20054 commented 1 year ago

**the TS update is a long way away, I have loads of things planned before that so it'll probably be the V3/V4 release (V2 is the Interactions update)

Great, I will be happy to try it, of course I will try to be your beta tester in case I find something wrong ;)

It should be good to test if you're down? (*logging)

AdamT20054 commented 1 year ago

I'll get the beta version uploaded for testing at around 18:00 today (UK time)

Francesco99d commented 1 year ago

I'll get the beta version uploaded for testing at around 18:00 today (UK time)

At my place it should be 19:00, I don't know if I'll get a chance to try it out for today, but for sure during the day on Monday the 7th I should make it, let me know if you can get the beta out

AdamT20054 commented 1 year ago

Currently Ill atm and I've got exams, getting the update out asap.

Francesco99d commented 1 year ago

Currently Ill atm and I've got exams, getting the update out asap.

Then get well soon, when the update is available I will do my best to try it ;)

AdamT20054 commented 1 year ago

Doing some major overhauls on parts of it, hence why it's taking so long :)

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days