-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add feature to search through factoids within Discord. #23
Add feature to search through factoids within Discord. #23
Conversation
Because i absolutely suck at git, this also resolves #8 |
I 100% prefer that we fix the panel over adding workarounds. If the panel has problems, those should be addressed over adding a new command to Absol to replace it. |
I think there are two problems with using the panel on mobile- one being that the panel is slow on mobile, but the other (and bigger) problem is that it's hard to switch between Discord and a browser (i.e. the panel) on mobile, which is made more severe by the fact that the panel is slow. |
Every time I see this, I see it's the same speed on phone and desktop. I don't see it being slower on a phone than a computer. It's not fast, but it's not like it's faster on your desktop than phone. And it's not slower than switching to any channel, typing a search in, looking at the results (with paging) to find the one you want.
What phones make it hard? Most phones make it easy to change between apps, even a lot faster than changing between Discord channels. I don't see this as a problem, rather a refusal to use it. |
You might want to talk to Boxersteavee#9999 as they're the user that has mostly been concerned about this. |
i've tested every feature i can to the extent of my abilites, so i think its done |
db.Where("content LIKE ? OR name LIKE ?", "%"+strings.Join(args, " ")+"%", "%"+strings.Join(args, " ")+"%").Table("factoids").Count(&rows) // this is a different query anyway so it just needs to be a seperate line to get the total number of results | ||
|
||
// ensures that page number is valid | ||
if pageNumber < 0 || pageNumber > int(rows)/max+1 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just puke the last page, we already did heavy work on this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know how this would be done, as it would rely on knowing the count before the find, and that's not possible without doing the aforementioned heavy computing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's very simple to just throw the first page back at them, i'll add something to do that
This pull request implements a function to search through the factoids using keywords, for example
!?s adwcleaner
would return all factoids with the wordadwcleaner
somewhere in the name or contents. If there are more then factoids.max (default 5) results, then they will be paginated and you can access other pages by typing in their page number at the end, like!?s hosts 2
for the second page of results for hosts. Queries must be at least 3 characters to prevent spam by getting every factoid with the letter A.This would mostly help on mobile, where accessing the website is not feasible or not performant.
Also resolves #8 and obsoletes #2