Spaces:
Paused
Paused
BinaryONe commited on
Commit ·
e9d98bd
1
Parent(s): 343d0af
Version V2: Code Modification & Simplification
Browse files
YukkiMusic/plugins/play/Chat_Selecter.py
CHANGED
|
@@ -49,7 +49,7 @@ async def callback_query_handler(client, callback_query):
|
|
| 49 |
data = callback_query.data
|
| 50 |
print(data, callback_query)
|
| 51 |
|
| 52 |
-
|
| 53 |
id = data.split(' ')[1]
|
| 54 |
chat_id = data.split(' ')[2]
|
| 55 |
user_idx=callback_query.from_user.id
|
|
@@ -63,9 +63,7 @@ async def callback_query_handler(client, callback_query):
|
|
| 63 |
details["title"],
|
| 64 |
details["duration_min"],
|
| 65 |
)
|
| 66 |
-
|
| 67 |
-
check=check.replace("'",'')
|
| 68 |
-
check=check.replace("/","")
|
| 69 |
video = True if check == "v" else None
|
| 70 |
#print(check,video)
|
| 71 |
buttons = InlineKeyboardButton("Go to Group", url='https://t.me/+MeO0kQmZ5ddiYmZl')
|
|
@@ -113,8 +111,8 @@ async def chat_selecter(client, data):
|
|
| 113 |
except Exception as e:
|
| 114 |
print(f"Error fetching chat info for chat ID {chat.id}: {e}")"""
|
| 115 |
chat_list=[
|
| 116 |
-
{ "text": "Only Logs [ Updates Group ]", "callback_data": f"{data.get('
|
| 117 |
-
{ "text": "Me & Her", "callback_data": f"{data.get('
|
| 118 |
]
|
| 119 |
for button in chat_list:
|
| 120 |
button_list.append(
|
|
|
|
| 49 |
data = callback_query.data
|
| 50 |
print(data, callback_query)
|
| 51 |
|
| 52 |
+
check=data.split(' ')[0]
|
| 53 |
id = data.split(' ')[1]
|
| 54 |
chat_id = data.split(' ')[2]
|
| 55 |
user_idx=callback_query.from_user.id
|
|
|
|
| 63 |
details["title"],
|
| 64 |
details["duration_min"],
|
| 65 |
)
|
| 66 |
+
|
|
|
|
|
|
|
| 67 |
video = True if check == "v" else None
|
| 68 |
#print(check,video)
|
| 69 |
buttons = InlineKeyboardButton("Go to Group", url='https://t.me/+MeO0kQmZ5ddiYmZl')
|
|
|
|
| 111 |
except Exception as e:
|
| 112 |
print(f"Error fetching chat info for chat ID {chat.id}: {e}")"""
|
| 113 |
chat_list=[
|
| 114 |
+
{ "text": "Only Logs [ Updates Group ]", "callback_data": f"{data.get('check')} {data.get('id')} {int(-1002090110322)}"},
|
| 115 |
+
{ "text": "Me & Her", "callback_data": f"{data.get('check')} {data.get('id')} {int(-1001847684787)}"}
|
| 116 |
]
|
| 117 |
for button in chat_list:
|
| 118 |
button_list.append(
|
YukkiMusic/plugins/play/webapp.py
CHANGED
|
@@ -78,6 +78,9 @@ async def raw_update_handler(client, message: Message):
|
|
| 78 |
id=split_data[1]
|
| 79 |
id=id.replace('"', '')
|
| 80 |
id=id.replace("'", "")
|
|
|
|
|
|
|
|
|
|
| 81 |
#split_data = web_app_data.split(':')
|
| 82 |
print(f"WebApp data received: {web_app_data},{id}")
|
| 83 |
if message.chat.type == ChatType.PRIVATE:
|
|
@@ -92,7 +95,7 @@ async def raw_update_handler(client, message: Message):
|
|
| 92 |
user_name = message.from_user.first_name
|
| 93 |
|
| 94 |
|
| 95 |
-
button_list=await chat_selecter(client, {"
|
| 96 |
await client.send_message(chat_id=user_idx, text="Choose an option:", reply_markup=InlineKeyboardMarkup([button_list]))
|
| 97 |
#video_url=f'https://www.youtube.com/watch?v={id}'
|
| 98 |
|
|
|
|
| 78 |
id=split_data[1]
|
| 79 |
id=id.replace('"', '')
|
| 80 |
id=id.replace("'", "")
|
| 81 |
+
check=split_data[0].replace('"', '')
|
| 82 |
+
check=check.replace("'",'')
|
| 83 |
+
check=check.replace("/","")
|
| 84 |
#split_data = web_app_data.split(':')
|
| 85 |
print(f"WebApp data received: {web_app_data},{id}")
|
| 86 |
if message.chat.type == ChatType.PRIVATE:
|
|
|
|
| 95 |
user_name = message.from_user.first_name
|
| 96 |
|
| 97 |
|
| 98 |
+
button_list=await chat_selecter(client, {"check":check,"id":id} )
|
| 99 |
await client.send_message(chat_id=user_idx, text="Choose an option:", reply_markup=InlineKeyboardMarkup([button_list]))
|
| 100 |
#video_url=f'https://www.youtube.com/watch?v={id}'
|
| 101 |
|