Spotted in log from new server using the bot: if you are on a channel where [p]inat last has no matching messages in its history, it fail with an error to the user & traceback in the log like:
[2019-12-11 08:21:07] [ERROR] red: Exception in command 'inat last'
Traceback (most recent call last):
File "/home/synrg/.local/share/Appledore/cogs/CogManager/cogs/inatcog/last.py", line 43, in get_last_obs_msg
m for m in msgs if not m.author.bot and re.search(PAT_OBS_LINK, m.content)
StopIteration
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/synrg/.local/lib/python3.7/site-packages/discord/ext/commands/core.py", line 79, in wrapped
ret = await coro(*args, **kwargs)
File "/home/synrg/.local/share/Appledore/cogs/CogManager/cogs/inatcog/inatcog.py", line 156, in last
last = await inat_link_msg.get_last_obs_msg(msgs)
RuntimeError: coroutine raised StopIteration
Clearly, [p]inat last just has to catch StopIteration & gracefully return Not found. Should be an easy fix.
Spotted in log from new server using the bot: if you are on a channel where
[p]inat last
has no matching messages in its history, it fail with an error to the user & traceback in the log like:Clearly,
[p]inat last
just has to catch StopIteration & gracefully returnNot found.
Should be an easy fix.