add BufferLine.timestamp (datetime.datetime
object)
This commit is contained in:
parent
e4d71f6c0c
commit
3e574f3c52
2 changed files with 8 additions and 4 deletions
|
@ -1,4 +1,4 @@
|
||||||
import collections, dataclasses, re, typing
|
import collections, dataclasses, datetime, re, typing
|
||||||
from src import IRCBot, IRCServer, utils
|
from src import IRCBot, IRCServer, utils
|
||||||
|
|
||||||
MAX_LINES = 64
|
MAX_LINES = 64
|
||||||
|
@ -6,15 +6,18 @@ MAX_LINES = 64
|
||||||
@dataclasses.dataclass
|
@dataclasses.dataclass
|
||||||
class BufferLine(object):
|
class BufferLine(object):
|
||||||
id: str
|
id: str
|
||||||
|
timestamp: datetime.datetime
|
||||||
sender: str
|
sender: str
|
||||||
message: str
|
message: str
|
||||||
action: bool
|
action: bool
|
||||||
tags: dict
|
tags: dict
|
||||||
from_self: bool
|
from_self: bool
|
||||||
method: str
|
method: str
|
||||||
|
|
||||||
|
deleted: bool=False
|
||||||
|
|
||||||
notes: typing.Dict[str, str] = dataclasses.field(
|
notes: typing.Dict[str, str] = dataclasses.field(
|
||||||
default_factory=dict)
|
default_factory=dict)
|
||||||
deleted: bool=False
|
|
||||||
|
|
||||||
class BufferLineMatch(object):
|
class BufferLineMatch(object):
|
||||||
def __init__(self, line: BufferLine, match: str):
|
def __init__(self, line: BufferLine, match: str):
|
||||||
|
|
|
@ -101,8 +101,9 @@ def message(events, event):
|
||||||
|
|
||||||
buffer_line = None
|
buffer_line = None
|
||||||
if message:
|
if message:
|
||||||
buffer_line = IRCBuffer.BufferLine(message_id, user.nickname, message,
|
buffer_line = IRCBuffer.BufferLine(message_id, utils.datetime.utcnow(),
|
||||||
action, event["line"].tags, from_self, event["line"].command)
|
user.nickname, message, action, event["line"].tags, from_self,
|
||||||
|
event["line"].command)
|
||||||
|
|
||||||
buffer_obj = target_obj
|
buffer_obj = target_obj
|
||||||
if is_channel:
|
if is_channel:
|
||||||
|
|
Loading…
Reference in a new issue