aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar jesopo2019-11-27 12:07:15 +0000
committerGravatar jesopo2019-11-27 12:07:15 +0000
commit710b711c709305e6b69201e6957a3c8db8557139 (patch)
treef878f6053ee69280f3ca46c28aca590955cf19de /src
parentremove IRCBuffer.skip_next (not used), pass buffer lines on message events (diff)
signature
dataclass-ify IRCBuffer.BufferLine, add .notes={}
Diffstat (limited to 'src')
-rw-r--r--src/IRCBuffer.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/IRCBuffer.py b/src/IRCBuffer.py
index f1ad0888..5c0b75a2 100644
--- a/src/IRCBuffer.py
+++ b/src/IRCBuffer.py
@@ -1,17 +1,17 @@
-import collections, re, typing
+import collections, dataclasses, re, typing
from src import IRCBot, IRCServer, utils
MAX_LINES = 64
+@dataclasses.dataclass
class BufferLine(object):
- def __init__(self, sender: str, message: str, action: bool, tags: dict,
- from_self: bool, method: str):
- self.sender = sender
- self.message = message
- self.action = action
- self.tags = tags
- self.from_self = from_self
- self.method = method
+ sender: str
+ message: str
+ action: bool
+ tags: dict
+ from_self: bool
+ method: str
+ notes: typing.Dict[str, str] = {}
class BufferLineMatch(object):
def __init__(self, line: BufferLine, match: str):