wrightedu / CSE-Discord-Bot

Discord bot for the WSU CSE Discord server
GNU General Public License v3.0
2 stars 4 forks source link

`corgme` extracts images in a weird order #193

Closed L30N1DAS closed 1 year ago

L30N1DAS commented 1 year ago

Describe the bug images = ['dogs/corgis/' + path.name for path in Path('dogs').rglob('*.*')] makes the list in a strange yet unknown order (i.e., when corgme is run on a particular number, the correct numbered image is not retrieved). sorted(Path('dogs').rglob('*.*')) will sort the list alphabetically, but image_10.jpg will precede image_2.jpg, still outputting the incorrect image.

To Reproduce Steps to reproduce the behavior:

  1. Put print(f"{number}") and print(f"{images[number]}") after image = images[number]
  2. Turn on bot and run -corgme
  3. Observe that the printed numbers do not match

Expected behavior The output image's number should match the entered number

Screenshots image

ReginPotter commented 1 year ago

I honestly dont think this matters. To the student it is giving them the correct image so it is fine to me.