Add new /getsubstring command#1
Merged
Merged
Conversation
Collaborator
Author
|
Essentially just copied /chat, and /variable as they are very similar. /chat and /variable and a few others only work because of the difference of string.split() and string.slice() |
simpleyuji
reviewed
Jul 18, 2023
| getUsage() { | ||
| return [ | ||
| "Returns a variable named $substring", | ||
| "/getsubstring [substring] [message]", |
Collaborator
There was a problem hiding this comment.
something like /getnthword [index] [message] (index is the correct programmer term for numbers that reference position of something)
simpleyuji
reviewed
Jul 18, 2023
| return true; | ||
| } | ||
| perform(caller,args) { | ||
| let substringSelector = args[0]; |
Collaborator
There was a problem hiding this comment.
the variable should be called index
simpleyuji
reviewed
Jul 18, 2023
| perform(caller,args) { | ||
| let substringSelector = args[0]; | ||
| if(isNaN(substringSelector)) { | ||
| caller.showChatError(`Substring selector cannot be NaN`) |
Collaborator
There was a problem hiding this comment.
same here index must be a number
simpleyuji
reviewed
Jul 18, 2023
| let substrings = text.split(" ") | ||
|
|
||
| if(substringSelector > substrings.length+1) { | ||
| caller.showChatError(`Invalid substring selector.`); |
Collaborator
There was a problem hiding this comment.
something like invalid index
Collaborator
Author
|
Thank you for the corrections. I'll edit them so they are easier for people to understand. |
simpleyuji
approved these changes
Jul 18, 2023
simpleyuji
pushed a commit
that referenced
this pull request
Oct 22, 2023
Merge pull request #11 from githubb-userr/master
PacoRoberto9-Official
pushed a commit
to PacoRoberto9-Official/Junon
that referenced
this pull request
Jul 3, 2026
PacoRoberto9-Official
pushed a commit
to PacoRoberto9-Official/Junon
that referenced
this pull request
Jul 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.