Use dataclasses instead of dicts/namedtuples

This commit is contained in:
2021-02-28 13:40:08 +01:00
committed by Valentin Lorentz
parent 12da7e1e3b
commit ac2a37362c
15 changed files with 124 additions and 97 deletions

View File

@ -1,20 +1,7 @@
from collections import namedtuple
import datetime
import re
import secrets
HistoryMessage = namedtuple("HistoryMessage", ["time", "msgid", "target", "text"])
def to_history_message(msg):
return HistoryMessage(
time=msg.tags.get("time"),
msgid=msg.tags.get("msgid"),
target=msg.params[0],
text=msg.params[1],
)
# thanks jess!
IRCV3_FORMAT_STRFTIME = "%Y-%m-%dT%H:%M:%S.%f%z"