Changed license updated
Browse files- chatbot/plugins/chat.py +18 -17
chatbot/plugins/chat.py
CHANGED
@@ -1,21 +1,10 @@
|
|
1 |
#!/usr/bin/env python
|
2 |
# -*- coding: utf-8 -*-
|
3 |
-
# Copyright
|
4 |
#
|
5 |
# from : https://github.com/TeamKillerX
|
6 |
# Channel : @RendyProjects
|
7 |
-
# This
|
8 |
-
# it under the terms of the GNU Affero General Public License as published by
|
9 |
-
# the Free Software Foundation, either version 3 of the License, or
|
10 |
-
# (at your option) any later version.
|
11 |
-
#
|
12 |
-
# This program is distributed in the hope that it will be useful,
|
13 |
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14 |
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15 |
-
# GNU Affero General Public License for more details.
|
16 |
-
#
|
17 |
-
# You should have received a copy of the GNU Affero General Public License
|
18 |
-
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
19 |
|
20 |
import asyncio
|
21 |
import importlib
|
@@ -668,7 +657,19 @@ async def terjemahkan(client, callback):
|
|
668 |
LOGS.error(f"Exception translate: {str(e)}")
|
669 |
await callback.answer("Server busy try again later", True)
|
670 |
|
671 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
672 |
@Client.on_callback_query(filters.regex("^trmulti_(\d+)_([a-f0-9]{8})$"))
|
673 |
async def multiple_langagues(client, callback):
|
674 |
user_id, uuidstr = callback.matches[0].groups()
|
@@ -749,7 +750,7 @@ def create_keyboard(
|
|
749 |
[
|
750 |
[
|
751 |
InlineKeyboardButton(f"♾️", callback_data=f"trmulti_{user_id}_{uuid_str}"),
|
752 |
-
InlineKeyboardButton(f"
|
753 |
InlineKeyboardButton(f"💾", callback_data=f"memory_{user_id}_{uuid_str}")
|
754 |
],
|
755 |
[
|
@@ -801,7 +802,6 @@ async def votes(client, callback_query):
|
|
801 |
|
802 |
await callback_query.answer()
|
803 |
|
804 |
-
|
805 |
@Client.on_message(
|
806 |
~filters.scheduled
|
807 |
& filters.command(["start"])
|
@@ -1383,9 +1383,10 @@ async def chatbot_talk(client: Client, message: Message):
|
|
1383 |
|
1384 |
check_is_system = await db.backup_chatbot.find_one({"user_id": message.from_user.id})
|
1385 |
if not check_is_system:
|
|
|
1386 |
await db.backup_chatbot.update_one(
|
1387 |
{"user_id": message.from_user.id},
|
1388 |
-
{"$set": {"is_system": False}},
|
1389 |
upsert=True
|
1390 |
)
|
1391 |
await message.reply_text(
|
|
|
1 |
#!/usr/bin/env python
|
2 |
# -*- coding: utf-8 -*-
|
3 |
+
# Copyright 2019-2025 (c) Randy W @xtdevs, @xtsea
|
4 |
#
|
5 |
# from : https://github.com/TeamKillerX
|
6 |
# Channel : @RendyProjects
|
7 |
+
# This project is proprietary software. Unauthorized redistribution is prohibited.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
|
9 |
import asyncio
|
10 |
import importlib
|
|
|
657 |
LOGS.error(f"Exception translate: {str(e)}")
|
658 |
await callback.answer("Server busy try again later", True)
|
659 |
|
660 |
+
@Client.on_callback_query(filters.regex("^showchat_(\d+)$"))
|
661 |
+
async def createchat_cb(client, callback):
|
662 |
+
user_id = int(callback.matches[0].group(1))
|
663 |
+
data = await db.backup_chatbot.find_one({"user_id": int(user_id)})
|
664 |
+
if not data:
|
665 |
+
await callback.answer("Can't found user", True)
|
666 |
+
return
|
667 |
+
create_chat = data.get("create_chat_uuid", None)
|
668 |
+
if not create_chat:
|
669 |
+
await callback.answer("You can reset chat, this no chat found", True)
|
670 |
+
return
|
671 |
+
await callback.answer(f"Created Chat: {create_chat_uuid}", True)
|
672 |
+
|
673 |
@Client.on_callback_query(filters.regex("^trmulti_(\d+)_([a-f0-9]{8})$"))
|
674 |
async def multiple_langagues(client, callback):
|
675 |
user_id, uuidstr = callback.matches[0].groups()
|
|
|
750 |
[
|
751 |
[
|
752 |
InlineKeyboardButton(f"♾️", callback_data=f"trmulti_{user_id}_{uuid_str}"),
|
753 |
+
InlineKeyboardButton(f"🔒", callback_data=f"showchat_{user_id}"),
|
754 |
InlineKeyboardButton(f"💾", callback_data=f"memory_{user_id}_{uuid_str}")
|
755 |
],
|
756 |
[
|
|
|
802 |
|
803 |
await callback_query.answer()
|
804 |
|
|
|
805 |
@Client.on_message(
|
806 |
~filters.scheduled
|
807 |
& filters.command(["start"])
|
|
|
1383 |
|
1384 |
check_is_system = await db.backup_chatbot.find_one({"user_id": message.from_user.id})
|
1385 |
if not check_is_system:
|
1386 |
+
uuid_create = str(uuid.uuid4())[:8]
|
1387 |
await db.backup_chatbot.update_one(
|
1388 |
{"user_id": message.from_user.id},
|
1389 |
+
{"$set": {"is_system": False, "create_chat_uuid": uuid_create}},
|
1390 |
upsert=True
|
1391 |
)
|
1392 |
await message.reply_text(
|