@@ -35,15 +35,15 @@ def add_chat(bot: Bot, update: Update):
35
35
ses_id = str (ses .id )
36
36
expires = str (ses .expires )
37
37
sql .set_ses (chat .id , ses_id , expires )
38
- msg . reply_text ("AI successfully enabled for this chat!" )
38
+ chat . send_message ("AI successfully enabled for this chat!" )
39
39
message = (f"<b>{ html .escape (chat .title )} :</b>\n "
40
40
f"#AI_ENABLED\n "
41
41
f"<b>Admin:</b> { mention_html (user .id , user .first_name )} \n " )
42
42
return message
43
43
else :
44
- msg . reply_text ("AI is already enabled for this chat!" )
45
- return ""
46
-
44
+ chat . send_message ("AI is already enabled for this chat!" )
45
+ return ""
46
+
47
47
@run_async
48
48
@user_admin
49
49
@gloggable
@@ -53,17 +53,17 @@ def remove_chat(bot: Bot, update: Update):
53
53
user = update .effective_user
54
54
is_chat = sql .is_chat (chat .id )
55
55
if not is_chat :
56
- msg . reply_text ("AI isn't enabled here in the first place!" )
56
+ chat . send_message ("AI isn't enabled here in the first place!" )
57
57
return ""
58
58
else :
59
59
sql .rem_chat (chat .id )
60
- msg . reply_text ("AI disabled successfully!" )
60
+ chat . send_message ("AI disabled successfully!" )
61
61
message = (f"<b>{ html .escape (chat .title )} :</b>\n "
62
62
f"#AI_DISABLED\n "
63
63
f"<b>Admin:</b> { mention_html (user .id , user .first_name )} \n " )
64
64
return message
65
-
66
-
65
+
66
+
67
67
def check_message (bot : Bot , message ):
68
68
reply_msg = message .reply_to_message
69
69
if message .text .lower () == "saitama" :
@@ -73,8 +73,8 @@ def check_message(bot: Bot, message):
73
73
return True
74
74
else :
75
75
return False
76
-
77
-
76
+
77
+
78
78
@run_async
79
79
def chatbot (bot : Bot , update : Update ):
80
80
global api_client
@@ -101,10 +101,11 @@ def chatbot(bot: Bot, update: Update):
101
101
bot .send_chat_action (chat_id , action = 'typing' )
102
102
rep = api_client .think_thought (sesh , query )
103
103
sleep (0.3 )
104
- msg . reply_text (rep , timeout = 60 )
104
+ chat . send_message (rep , timeout = 60 )
105
105
except CFError as e :
106
106
bot .send_message (OWNER_ID , f"Chatbot error: { e } occurred in { chat_id } !" )
107
-
107
+
108
+
108
109
@run_async
109
110
def list_chatbot_chats (bot : Bot , update : Update ):
110
111
chats = sql .get_all_chats ()
0 commit comments