ChaterJee 0.4.1__py3-none-any.whl → 0.4.3__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.
- ChaterJee/ChaterJee.py +23 -6
- {chaterjee-0.4.1.dist-info → chaterjee-0.4.3.dist-info}/METADATA +1 -1
- chaterjee-0.4.3.dist-info/RECORD +6 -0
- chaterjee-0.4.1.dist-info/RECORD +0 -6
- {chaterjee-0.4.1.dist-info → chaterjee-0.4.3.dist-info}/WHEEL +0 -0
- {chaterjee-0.4.1.dist-info → chaterjee-0.4.3.dist-info}/top_level.txt +0 -0
ChaterJee/ChaterJee.py
CHANGED
@@ -68,7 +68,7 @@ class ChatLogs:
|
|
68
68
|
states={
|
69
69
|
0: [MessageHandler(filters.Regex("^(JOB)"), self.StatJobs)],
|
70
70
|
1: [MessageHandler(filters.Regex("^(Yes|No)$"), self.ClearChat)],
|
71
|
-
2: [MessageHandler(filters.Regex("^(FILE)
|
71
|
+
2: [MessageHandler(filters.Regex("^(FILE)"), self.SendEditButton)],
|
72
72
|
},
|
73
73
|
fallbacks=[CommandHandler("cancel", self.cancel)],
|
74
74
|
)
|
@@ -226,6 +226,7 @@ class ChatLogs:
|
|
226
226
|
else:
|
227
227
|
self.txt = f"File {file_path} not Found!"
|
228
228
|
await self.sendUpdate(update, context)
|
229
|
+
return ConversationHandler.END
|
229
230
|
else:
|
230
231
|
JSONfiles = self.get_json_files(".")
|
231
232
|
#self.txt = "Expected a JSON file as argument. Nothing provided."
|
@@ -241,6 +242,7 @@ class ChatLogs:
|
|
241
242
|
else:
|
242
243
|
self.txt = f"No JSON file found in the current directory!"
|
243
244
|
await self.sendUpdate(update, context)
|
245
|
+
return ConversationHandler.END
|
244
246
|
|
245
247
|
def get_json_files(self, directory):
|
246
248
|
json_files = []
|
@@ -250,9 +252,13 @@ class ChatLogs:
|
|
250
252
|
return json_files
|
251
253
|
|
252
254
|
async def SendEditButton(self, update: Update, context: ContextTypes.DEFAULT_TYPE):
|
255
|
+
#print("I'm here!")
|
253
256
|
self.smsID.append(update.message.message_id)
|
254
257
|
file_name = update.message.text[6:]
|
255
|
-
print(file_name)
|
258
|
+
#print(file_name)
|
259
|
+
with open(file_name,'r') as ffr:
|
260
|
+
JsonStr = json.load(ffr)
|
261
|
+
encoded_params = urllib.parse.quote(json.dumps(JsonStr))
|
256
262
|
extender = f"?variables={encoded_params}&fileNAME={file_name}"
|
257
263
|
await context.bot.sendChatAction(chat_id=self.CHATID, action="typing")
|
258
264
|
msg = await update.message.reply_text(
|
@@ -265,7 +271,6 @@ class ChatLogs:
|
|
265
271
|
),
|
266
272
|
)
|
267
273
|
self.smsID.append(msg.message_id)
|
268
|
-
return ConversationHandler.END
|
269
274
|
|
270
275
|
async def web_app_data(self, update: Update, context: ContextTypes.DEFAULT_TYPE) -> None :
|
271
276
|
data = json.loads(update.effective_message.web_app_data.data)
|
@@ -280,13 +285,25 @@ class ChatLogs:
|
|
280
285
|
JSdata = {**JSdata, **data}
|
281
286
|
with open(fileNAME, 'w') as ffw:
|
282
287
|
json.dump(JSdata, ffw, indent=4)
|
283
|
-
self.
|
288
|
+
await context.bot.sendChatAction(chat_id=self.CHATID, action="typing")
|
289
|
+
msg = await update.message.reply_text(
|
290
|
+
f"edits are saved to {fileNAME}", reply_markup=ReplyKeyboardRemove()
|
291
|
+
)
|
292
|
+
self.smsID.append(msg.message_id)
|
293
|
+
#self.txt = f"edits are saved to {fileNAME}"
|
284
294
|
else:
|
285
|
-
self.
|
295
|
+
await context.bot.sendChatAction(chat_id=self.CHATID, action="typing")
|
296
|
+
msg = await update.message.reply_text(
|
297
|
+
f"No new changes! file kept unchanged.", reply_markup=ReplyKeyboardRemove()
|
298
|
+
)
|
299
|
+
self.smsID.append(msg.message_id)
|
300
|
+
#self.txt = f"No new changes! file kept unchanged."
|
301
|
+
#await self.sendUpdate(update, context)
|
302
|
+
return ConversationHandler.END
|
286
303
|
|
287
304
|
#msg = await context.bot.send_message(chat_id=self.CHATID, text=txt)
|
288
305
|
#self.smsID.append(msg.message_id)
|
289
|
-
await self.sendUpdate(update, context)
|
306
|
+
#await self.sendUpdate(update, context)
|
290
307
|
|
291
308
|
async def commands(self, update: Update, context: ContextTypes.DEFAULT_TYPE):
|
292
309
|
self.smsID.append(update.message.message_id)
|
@@ -0,0 +1,6 @@
|
|
1
|
+
ChaterJee/ChaterJee.py,sha256=qZTGkAZx3ZGhkepPynzHWUnTIESsHQP4by5gpbMTwls,16941
|
2
|
+
ChaterJee/__init__.py,sha256=tZmkZY2XbzJ8rHDh8nOmb1W73kPecPv3xcEiCPwkZf4,98
|
3
|
+
chaterjee-0.4.3.dist-info/METADATA,sha256=snKhcufcmF-OrJj21RC8VJGF16kpxkRYV9TAu9SBUuQ,5872
|
4
|
+
chaterjee-0.4.3.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
|
5
|
+
chaterjee-0.4.3.dist-info/top_level.txt,sha256=Z1UAYoaNybpDiKjqa1yFpti_q0FNECVItb3-9yAh3gM,10
|
6
|
+
chaterjee-0.4.3.dist-info/RECORD,,
|
chaterjee-0.4.1.dist-info/RECORD
DELETED
@@ -1,6 +0,0 @@
|
|
1
|
-
ChaterJee/ChaterJee.py,sha256=ics1nhjdUV1DUhkox0cBIQNf5ASr5BJErXwHO-Fmfww,16012
|
2
|
-
ChaterJee/__init__.py,sha256=tZmkZY2XbzJ8rHDh8nOmb1W73kPecPv3xcEiCPwkZf4,98
|
3
|
-
chaterjee-0.4.1.dist-info/METADATA,sha256=8X0Et1azQIHZBoiW7KQJ_enhoAhdSG16Nz5wEEWuP5M,5872
|
4
|
-
chaterjee-0.4.1.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
|
5
|
-
chaterjee-0.4.1.dist-info/top_level.txt,sha256=Z1UAYoaNybpDiKjqa1yFpti_q0FNECVItb3-9yAh3gM,10
|
6
|
-
chaterjee-0.4.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|