Skip to content

Add list functionality

Latest
Compare
Choose a tag to compare
@AlexBurkey AlexBurkey released this 18 Aug 06:35
· 6 commits to master since this release

Adding functionality to parse lists of numbers in a line so commands like the following are valid. Also allows for whitespace separated lists or comma separated lists: 1 2 3 or 1,2,3 or 1, 2, 3.

!mfaimagebot <album-link> 2, 3, 42
!mfaimagebot 2, 3, 42

  • Order of the list is preserved: 2, 10, 1 links image 2, then 10, then 1
  • Repeated links are allowed: !mfaimagebot 1, 1, 1, 1 links image 1 four times
  • Being branded as a feature, negative numbers are valid: 0 links the last image in an album, -1 links the 2nd to last, etc.
  • Non-integers are silently ignored: !mfaimagebot notANormalCommandIntput 1, 3, 5.5, 10, <out-of-bounds>, 7, 3 should properly link image 1, then 3, then 10, then print an error for out of bounds, then image 3 again