Open piyushchauhan opened 4 years ago
I would like to work on this issue.
@Darshilp326 Ok I am assigning it to you. You can start working on it.
Make a new command for this task in new file. !scrap rolls
One possibility to solve this. @Darshilp326
!scrap rolls
was sent.@piyushchauhan For 2nd step we need to fetch messages which will lead to older problem only.
@piyushchauhan For 2nd step we need to fetch messages which will lead to older problem only.
Most probably there won't be more than 100 msgs sent by a user in that channel. So that will work practically.
Anyways later on we can add a moderation to the channel that if the person who messaged is in the channel is already in the spreadsheet database then we can delete that message. So that it won't cause much over head in future.
@piyushchauhan there is no inbuilt function for finding a specific user's message. We need to fetch all messages of that channel and then find manually by checking that message's author id and our user's id.
@piyushchauhan one solution can be for every message we need to check if it contains roll no. But for this we don't need command !scrap-rolls.
Refer this https://support.discord.com/hc/en-us/articles/115000468588 If this is possible through Discrod.js then our job is done.
@Darshilp326 Have you tried this? https://discordjs.guide/popular-topics/collectors.html#basic-message-collector
Have you made the Regex for roll number?
^\d{4}[a-z]{2,}\d{1,3}$ regex
Message collector will work ! Actually without that also if we check every message then it is similar to message collector only.
^\d{4}[a-z]{2,}\d{1,3}$ regex
\d{4}[a-z]{2}\d{2}
https://regex101.com/r/ck8jKo/22
This will be a better one. Always consider multiline strings when building regex
^\d{4}[a-z]{2,}\d{1,3}$ regex https://regex101.com/r/ck8jKo/21
\d{4}[a-z]{2}\d{2}
https://regex101.com/r/ck8jKo/22 This will be a better one. Always consider multiline strings when building regex
Ok i will take this but i have assumed that in one message we will be getting only one roll number
For example see the messages in
#intro
channel of Cassiopeia server at https://discord.gg/NYHj58M Steps:!scrap rolls
command is sent.Column order in the spreadsheet