-
Notifications
You must be signed in to change notification settings - Fork 8
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
Enable navigation via direct input #1
base: master
Are you sure you want to change the base?
Conversation
@@ -250,6 +257,7 @@ fun search(message: Message, terms: List<String>) { | |||
search.addReaction(jumpRight) | |||
if (allEmbeds.size > 2) | |||
search.addReaction(last) | |||
search.addReaction(nums) |
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.
This is indented unneccesarially.
@@ -223,6 +225,11 @@ fun updateMessageWithJump(jump: Int, message: Message, entry: Triple<Long, Int, | |||
} | |||
} | |||
|
|||
fun updateIndexToInput(originalMessage: Message, entry: Triple<Long, Int, List<EmbedBuilder>>){ | |||
val questionMessage = originalMessage.channel.sendMessage("What number entry would you like to go to?").get() | |||
awaiting.add(Pair(Pair(originalMessage,questionMessage),entry)) |
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.
use to
instead of the pair constructor.
val (messages, entry) = awaitElement | ||
val (uid, index, embeds) = entry | ||
if (userInput.author.id == uid) { | ||
val numsOnly = userInput.content.replace("[^0-9]".toRegex(), "") |
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.
Use \D
Untested post-changes, because I don't have my compiler readily available (am editing online). I wouldn't recommend enacting them yet |
Now tested with no conflicts. Edge cases handling as they should. Haven't tested with cross-account interference yet, but I fail to see why that'd break and the rest wouldn't |
Test cross-account interference, just to be safe |
No description provided.