Update chatbot/plugins/chat.py
Browse files- chatbot/plugins/chat.py +16 -5
chatbot/plugins/chat.py
CHANGED
@@ -279,7 +279,11 @@ async def check_steal_channel_id(client, event: ChatMemberUpdated):
|
|
279 |
}},
|
280 |
upsert=True
|
281 |
)
|
282 |
-
|
|
|
|
|
|
|
|
|
283 |
except Exception as e:
|
284 |
LOGS.error(f"Error check_steal_channel_id: {str(e)}")
|
285 |
|
@@ -343,9 +347,16 @@ async def auto_post_channel(client, callback):
|
|
343 |
photo=file_id,
|
344 |
caption=data.get("translate_text", "")
|
345 |
)
|
346 |
-
|
347 |
-
|
348 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
349 |
except Exception as e:
|
350 |
LOGS.error(f"auto_post failed: {str(e)}")
|
351 |
await callback.answer("Server busy try again later", True)
|
@@ -473,7 +484,7 @@ async def flux_prompt(client, callback):
|
|
473 |
photo = await client.send_photo(
|
474 |
"LicenseAknBotDB",
|
475 |
file_path,
|
476 |
-
caption=f"User Mention:
|
477 |
f"User ID: `{user_id}`",
|
478 |
reply_markup=view_button_user
|
479 |
)
|
|
|
279 |
}},
|
280 |
upsert=True
|
281 |
)
|
282 |
+
await client.send_message(
|
283 |
+
event.new_chat_member.promoted_by.id,
|
284 |
+
f"Successfully connected to your [`{event.chat.id}`] channel"
|
285 |
+
)
|
286 |
+
# LOGS.info(f"Update Channel: {event.new_chat_member}")
|
287 |
except Exception as e:
|
288 |
LOGS.error(f"Error check_steal_channel_id: {str(e)}")
|
289 |
|
|
|
347 |
photo=file_id,
|
348 |
caption=data.get("translate_text", "")
|
349 |
)
|
350 |
+
keyboard = create_keyboard(user_id=user_id)
|
351 |
+
await callback.answer("Posted to Your Channel Check Now", True)
|
352 |
+
await callback.edit_message_reply_markup(reply_markup=keyboard)
|
353 |
+
return
|
354 |
+
|
355 |
+
await callback.answer("Permissions: can_post_messages", True)
|
356 |
+
return
|
357 |
+
|
358 |
+
await callback.answer("Need Channel as admin", True)
|
359 |
+
return
|
360 |
except Exception as e:
|
361 |
LOGS.error(f"auto_post failed: {str(e)}")
|
362 |
await callback.answer("Server busy try again later", True)
|
|
|
484 |
photo = await client.send_photo(
|
485 |
"LicenseAknBotDB",
|
486 |
file_path,
|
487 |
+
caption=f"User Mention: {callback.from_user.mention}\n"
|
488 |
f"User ID: `{user_id}`",
|
489 |
reply_markup=view_button_user
|
490 |
)
|