2023-02-03 16:13:57 +01:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
# -*-coding:UTF-8 -*
|
|
|
|
"""
|
|
|
|
The Telegram Feeder Importer Module
|
|
|
|
================
|
|
|
|
|
|
|
|
Process Telegram JSON
|
|
|
|
|
|
|
|
"""
|
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
import datetime
|
|
|
|
|
|
|
|
sys.path.append(os.environ['AIL_BIN'])
|
|
|
|
##################################
|
|
|
|
# Import Project packages
|
|
|
|
##################################
|
2023-11-02 16:28:33 +01:00
|
|
|
from importer.feeders.abstract_chats_feeder import AbstractChatFeeder
|
2023-08-18 11:05:21 +02:00
|
|
|
from lib.ConfigLoader import ConfigLoader
|
2023-10-05 16:24:28 +02:00
|
|
|
from lib.objects import ail_objects
|
2023-08-18 11:05:21 +02:00
|
|
|
from lib.objects.Chats import Chat
|
|
|
|
from lib.objects import Messages
|
|
|
|
from lib.objects import UsersAccount
|
2023-02-03 16:13:57 +01:00
|
|
|
from lib.objects.Usernames import Username
|
|
|
|
|
2023-08-18 11:05:21 +02:00
|
|
|
import base64
|
2023-10-05 16:24:28 +02:00
|
|
|
|
2023-11-02 16:28:33 +01:00
|
|
|
class TelegramFeeder(AbstractChatFeeder):
|
2023-02-03 16:13:57 +01:00
|
|
|
|
|
|
|
def __init__(self, json_data):
|
2023-11-02 16:28:33 +01:00
|
|
|
super().__init__('telegram', json_data)
|
2023-08-18 11:05:21 +02:00
|
|
|
|
2023-11-02 16:28:33 +01:00
|
|
|
# def get_obj(self):.
|
|
|
|
# obj_id = Messages.create_obj_id('telegram', chat_id, message_id, timestamp)
|
|
|
|
# obj_id = f'message:telegram:{obj_id}'
|
|
|
|
# self.obj = ail_objects.get_obj_from_global_id(obj_id)
|
|
|
|
# return self.obj
|
2023-08-18 11:05:21 +02:00
|
|
|
|