fix CmdPage tracebacks

This commit is contained in:
InspectorCaracal 2024-11-06 21:24:06 -07:00 committed by GitHub
parent f007199878
commit f9d88b16a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1382,7 +1382,7 @@ class CmdPage(COMMAND_DEFAULT_CLASS):
if target and target.isnumeric():
# a number to specify a historic page
number = int(target)
elif target:
elif message:
target_obj = self.caller.search(target, quiet=True)
if target_obj:
# a proper target
@ -1393,7 +1393,7 @@ class CmdPage(COMMAND_DEFAULT_CLASS):
message = target + " " + (message[0] if message else "")
else:
# a single-word message
message = message[0].strip()
message = target.strip()
pages = list(pages_we_sent) + list(pages_we_got)
pages = sorted(pages, key=lambda page: page.date_created)