@@ -137,7 +137,7 @@ async def handle_webhook(update: TelegramUpdate, token: str = Depends(auth_teleg
137
137
elif callback_data == "SUB" :
138
138
cursor .execute ("""SELECT chat_id, link
139
139
FROM users
140
- WHERE shared_status == %s AND chat_id != %s
140
+ WHERE shared_status = %s AND chat_id != %s
141
141
ORDER BY
142
142
CASE
143
143
WHEN shares < 0 THEN 2
@@ -184,7 +184,7 @@ async def handle_webhook(update: TelegramUpdate, token: str = Depends(auth_teleg
184
184
185
185
cursor .execute ("""SELECT chat_id, link
186
186
FROM users
187
- WHERE shared_status == %s AND chat_id != %s
187
+ WHERE shared_status = %s AND chat_id != %s
188
188
ORDER BY
189
189
CASE
190
190
WHEN shares < 0 THEN 2
@@ -214,11 +214,12 @@ async def handle_webhook(update: TelegramUpdate, token: str = Depends(auth_teleg
214
214
chat_id_store = result [0 ]
215
215
link = result [1 ]
216
216
cursor .execute ("""UPDATE users SET shared_status=%s where chat_id=%s""" , (True , chat_id_store ,))
217
-
217
+ conn . commit ()
218
218
cursor .execute ("""SELECT viewing FROM users WHERE chat_id=%s""" , (chat_id ,))
219
219
220
220
result = cursor .fetchone ()
221
221
cursor .execute ("""UPDATE users SET shared_status = %s where chat_id = %s""" , (False , result [0 ],))
222
+ conn .commit ()
222
223
cursor .execute ("""UPDATE users SET viewing=%s where chat_id=%s""" , (chat_id_store , chat_id ))
223
224
conn .commit ()
224
225
keyboard = [[InlineKeyboardButton ("Subscribed 🫡" , callback_data = "SUBBED" ),
0 commit comments