This commit is contained in:
2024-03-24 04:05:54 +03:00
parent 26f511535a
commit c5e0c91828
24 changed files with 132 additions and 322 deletions
+4 -6
View File
@@ -1,11 +1,10 @@
from kurocore.utils.vk_utils import generate_random_id
from kurocore.vk.utils import generate_random_id
class ChatEvent:
__slots__ = ('session', 'api', 'raw', 'type', 'member_id', 'text', 'photo')
def __init__(self, session, api, raw: dict):
self.session = session
def __init__(self, api, raw: dict):
self.api = api
self.raw: dict = raw
@@ -18,8 +17,7 @@ class ChatEvent:
class Event:
__slots__ = ('session', 'api', 'raw', 'type')
def __init__(self, session, api, raw: dict):
self.session = session
def __init__(self, api, raw: dict):
self.api = api
self.raw: dict = raw['object']
@@ -35,7 +33,7 @@ class Event:
if text:
data.update({'message': text})
if attachments:
if type(attachments) == str:
if type(attachments) is str:
data.update({'attachment': attachments})
else:
data.update({'attachment': ','.join(attachments)})