leadguru-jobs 0.408.0__py3-none-any.whl → 0.409.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {leadguru_jobs-0.408.0.dist-info → leadguru_jobs-0.409.0.dist-info}/METADATA +1 -1
- {leadguru_jobs-0.408.0.dist-info → leadguru_jobs-0.409.0.dist-info}/RECORD +9 -9
- lgt_jobs/jobs/bot_stats_update.py +2 -1
- lgt_jobs/jobs/chat_history.py +1 -1
- lgt_jobs/lgt_common/slack_client/web_client.py +1 -3
- lgt_jobs/lgt_data/model.py +0 -1
- lgt_jobs/lgt_data/mongo_repository.py +4 -0
- {leadguru_jobs-0.408.0.dist-info → leadguru_jobs-0.409.0.dist-info}/WHEEL +0 -0
- {leadguru_jobs-0.408.0.dist-info → leadguru_jobs-0.409.0.dist-info}/top_level.txt +0 -0
@@ -8,8 +8,8 @@ lgt_jobs/smtp.py,sha256=2PdCvyonQdyWZbPH9ozXFwapZp00fcxhBe7lQiVtMCo,1354
|
|
8
8
|
lgt_jobs/jobs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
9
9
|
lgt_jobs/jobs/analytics.py,sha256=iN1Z9ZtRHrpjzmSN4cbqwL6XzGWQYFmDBnBG-NvmlMc,974
|
10
10
|
lgt_jobs/jobs/archive_leads.py,sha256=Rc9MTWvVUCMEXi7mTrHWKZVyaRiseCFpHqUZcXekmIk,849
|
11
|
-
lgt_jobs/jobs/bot_stats_update.py,sha256=
|
12
|
-
lgt_jobs/jobs/chat_history.py,sha256=
|
11
|
+
lgt_jobs/jobs/bot_stats_update.py,sha256=YlsD217E1L6mEkn0ggMKJk0Q0w9wHWlBFzWWFYED-Ws,7023
|
12
|
+
lgt_jobs/jobs/chat_history.py,sha256=WIpgxQZ2YA1sEwLmJBg0pMZRGOMQBavsA6jXRKOe74g,5329
|
13
13
|
lgt_jobs/jobs/inbox_leads.py,sha256=HGnhZEzMZw_Yzf40tQIRQc3E3QmcmEUyc1c5KTmJHFI,4646
|
14
14
|
lgt_jobs/jobs/mass_message.py,sha256=jLO-yykQzf-V7JY7a6PFwVoT4z91SJWN5UPrHj_xAP8,2039
|
15
15
|
lgt_jobs/jobs/send_code.py,sha256=ei5WHVpI2w2gv0JGU8wjg0HJYUO_OZqNJPm-W6yO1dA,828
|
@@ -32,18 +32,18 @@ lgt_jobs/lgt_common/pubsub/pubsubfactory.py,sha256=7HAg_P2sZ6DDJkDyxzc4yI-i38bDS
|
|
32
32
|
lgt_jobs/lgt_common/slack_client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
33
33
|
lgt_jobs/lgt_common/slack_client/methods.py,sha256=-PxK8StkJ-dyACHdRRiQlRL2qaG9KEyWB7wo4eh7ifU,1506
|
34
34
|
lgt_jobs/lgt_common/slack_client/slack_client.py,sha256=fpfkk8uBMiTknMwgSNFGiGegN3qoJADJhjbpkpLKO8Y,15896
|
35
|
-
lgt_jobs/lgt_common/slack_client/web_client.py,sha256=
|
35
|
+
lgt_jobs/lgt_common/slack_client/web_client.py,sha256=ZGvfBqaqEkHzVD97NzIjlH1Rx7FP8MSSPVtbcCfBr0g,6149
|
36
36
|
lgt_jobs/lgt_data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
37
37
|
lgt_jobs/lgt_data/analytics.py,sha256=qo5nNFQxOTTk8i3tmCq0d3F9iaV9MTIR84SSi6uNrJ8,23427
|
38
38
|
lgt_jobs/lgt_data/engine.py,sha256=iTcLvU7QZvB14hcERQrxSql9cVEcMEzu_tUcWD2Z24A,8076
|
39
39
|
lgt_jobs/lgt_data/enums.py,sha256=A5nWwBgTVW7XaqL30NHNmO0SG_yeDk1dI-U5xrgU2zg,1552
|
40
40
|
lgt_jobs/lgt_data/helpers.py,sha256=58ycqKF1z5nAw0vs6yVCg-SQet107YHyKYXaQUc7M68,157
|
41
|
-
lgt_jobs/lgt_data/model.py,sha256=
|
42
|
-
lgt_jobs/lgt_data/mongo_repository.py,sha256=
|
41
|
+
lgt_jobs/lgt_data/model.py,sha256=Yc9yuy7AmiajppiMC010wg5zcAxtP90nfL-k70_QJHM,27948
|
42
|
+
lgt_jobs/lgt_data/mongo_repository.py,sha256=wI8rprjrKR4zV95I2hgeA-Us8NkvnIox4XsGGqYG0T4,37064
|
43
43
|
lgt_jobs/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
44
44
|
lgt_jobs/services/web_client.py,sha256=D3y5KVVBk7mesRnsiByx4tFmNbfTOKOUoIp3VCHuk0I,1983
|
45
45
|
lgt_jobs/templates/new_message_mail_template.html,sha256=82XdDPtmkJVUWUcZtgd8bv_9-viAG2WWOnf3AhR6PeY,3635
|
46
|
-
leadguru_jobs-0.
|
47
|
-
leadguru_jobs-0.
|
48
|
-
leadguru_jobs-0.
|
49
|
-
leadguru_jobs-0.
|
46
|
+
leadguru_jobs-0.409.0.dist-info/METADATA,sha256=aciV_dzTDxELx_9x0P-oq3Z46LWQMnOU4TUj28ry3jQ,1296
|
47
|
+
leadguru_jobs-0.409.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
48
|
+
leadguru_jobs-0.409.0.dist-info/top_level.txt,sha256=rIuw1DqwbnZyeoarBSC-bYeGOhv9mZBs7_afl9q4_JI,9
|
49
|
+
leadguru_jobs-0.409.0.dist-info/RECORD,,
|
@@ -56,7 +56,8 @@ class BotStatsUpdateJob(BaseBackgroundJob, ABC):
|
|
56
56
|
discord_server.deleted = server.deleted
|
57
57
|
else:
|
58
58
|
discord_server.deleted = True
|
59
|
-
discord_channels = [Channel.from_dic(channel) for channel in client.get_channels(discord_server.id)
|
59
|
+
discord_channels = [Channel.from_dic(channel) for channel in client.get_channels(discord_server.id)
|
60
|
+
if channel.get('type', 0) == 0]
|
60
61
|
for discord_channel in discord_channels:
|
61
62
|
if server:
|
62
63
|
channel = next(filter(lambda x: x.id == discord_channel.id, server.channels), None)
|
lgt_jobs/jobs/chat_history.py
CHANGED
@@ -93,7 +93,7 @@ class LoadChatHistoryJob(BaseBackgroundJob, ABC):
|
|
93
93
|
|
94
94
|
messages = [SlackMessageConvertService.from_slack_response(user.email, "slack_files",
|
95
95
|
bot.token, m, contact.sender_id, bot.id,
|
96
|
-
|
96
|
+
bot.cookies) for m in messages]
|
97
97
|
new_messages = LoadChatHistoryJob._get_new_messages(contact, bot, messages)
|
98
98
|
chat_history = [message.to_dic() for message in new_messages]
|
99
99
|
ChatRepository().upsert_messages(chat_history)
|
@@ -3,7 +3,6 @@ from google.cloud import storage
|
|
3
3
|
from datetime import datetime, timedelta
|
4
4
|
from lgt_jobs.lgt_data.model import ChatMessage
|
5
5
|
from .slack_client import SlackClient
|
6
|
-
from ...lgt_data.mongo_repository import to_object_id
|
7
6
|
|
8
7
|
|
9
8
|
def get_file_url(blob_path):
|
@@ -18,7 +17,7 @@ def get_file_url(blob_path):
|
|
18
17
|
|
19
18
|
class SlackMessageConvertService:
|
20
19
|
@staticmethod
|
21
|
-
def from_slack_response(user_email, bot_name, bot_token, dic, sender_id, bot_id,
|
20
|
+
def from_slack_response(user_email, bot_name, bot_token, dic, sender_id, bot_id, cookies=None):
|
22
21
|
|
23
22
|
"""
|
24
23
|
:rtype: SlackHistoryMessageModel
|
@@ -31,7 +30,6 @@ class SlackMessageConvertService:
|
|
31
30
|
result.ts = dic.get('ts', '')
|
32
31
|
result.attachments = dic.get('attachments', [])
|
33
32
|
result.files = []
|
34
|
-
result.user_id = to_object_id(user_id)
|
35
33
|
|
36
34
|
if 'files' in dic:
|
37
35
|
for file in dic.get('files'):
|
lgt_jobs/lgt_data/model.py
CHANGED
@@ -806,6 +806,7 @@ class DedicatedBotRepository(BaseMongoRepository):
|
|
806
806
|
user_id = kwargs.get('user_id')
|
807
807
|
source_id = kwargs.get('source_id')
|
808
808
|
server_id = kwargs.get('server_id')
|
809
|
+
active_server_id = kwargs.get('active_server_id')
|
809
810
|
|
810
811
|
if bot_id:
|
811
812
|
pipeline["_id"] = to_object_id(bot_id)
|
@@ -828,6 +829,9 @@ class DedicatedBotRepository(BaseMongoRepository):
|
|
828
829
|
if server_id:
|
829
830
|
pipeline["servers"] = {'$elemMatch': {'id': server_id, 'active': True}}
|
830
831
|
|
832
|
+
if active_server_id:
|
833
|
+
pipeline["servers"] = {'$elemMatch': {'id': active_server_id, 'deleted': False}}
|
834
|
+
|
831
835
|
if only_valid:
|
832
836
|
pipeline['invalid_creds'] = False
|
833
837
|
|
File without changes
|
File without changes
|