Allow !latest to accept strings for regex matches #6
Loading…
Reference in New Issue
No description provided.
Delete Branch "tomasino/cosmicbot:latest-regex"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The shell command
latest
now includes post number in the output. After seeing people in the IRC channel attempt to get the latest posts by ship name, I've implemented that feature in the shell. Passing an int tolatest
gives that number of entries. Passing a string does agrep -i
search and returns up to 5 results.There might be some extra variable casting necessary. I'm not sure if the bot interprets all params as strings, even numeric ones. If that's the case then the isinstance probably needs to be replaced with a regex test instead.
I'm not sure of a way to test these changes prior to PR, sadly.
@tomasino All params are strings. Probably you could do:
Updated the code to reflect that test.
Please update the "Latest entry from" message for the case that it's a string and not a number.
I've provided a different message for non-numeric searches.
Will it work with the weird indent on
else
?No, it definitely wouldn't. Vim was expanding tabs, sadly. I've fixed the indenting. Do you want me to squash these commits down prior to merge?
No, I'll merge as is. Thanks!