From f9d3078865b0c4fe99fa7cb7ec4b82f2f9c31263 Mon Sep 17 00:00:00 2001 From: seth Date: Thu, 12 Jan 2023 18:37:32 -0500 Subject: fix: make sure get_copypasta returns a list --- src/moyai_bot/lib.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/moyai_bot/lib.py b/src/moyai_bot/lib.py index 65360a1..9ec4b0e 100644 --- a/src/moyai_bot/lib.py +++ b/src/moyai_bot/lib.py @@ -36,14 +36,14 @@ def split_msg(msg: str): return [msg[i:i + split] for i in range(0, len(msg), split)] -def get_copypasta(name): +def get_copypasta(name) -> list[str]: try: res = importlib.resources.read_text(copypastas, name + ".txt") except OSError: - return "something went wrong :(" + return ["something went wrong :("] if res == "": - return f"couldn't send copypasta: {name} :(" + return [f"couldn't send copypasta: {name} :("] if len(res) >= CHAR_LIMIT: res = split_msg(res) -- cgit v1.2.3