diff --git a/miku/plugins/cleverbot.lua b/miku/plugins/cleverbot.lua index 86c341f..209730a 100644 --- a/miku/plugins/cleverbot.lua +++ b/miku/plugins/cleverbot.lua @@ -16,7 +16,16 @@ local apikey = cred_data.cleverbot_apikey -- get your key here: https://www.clev function cleverbot:action(msg, config, matches) utilities.send_typing(msg.chat.id, 'typing') local text = matches[1] - local query, code = https.request(BASE_URL..'?key='..apikey..'&input='..URL.escape(text)) + local hash = get_redis_hash(msg, 'cleverbot') + + local state = redis:get(hash) + + if not state then + query, code = https.request(BASE_URL..'?key='..apikey..'&input='..URL.escape(text)) + else + query, code = https.request(BASE_URL..'?key='..apikey..'&input='..URL.escape(text)..'&cs='..state) + end + if code ~= 200 then utilities.send_reply(msg, config.errors.connection) return @@ -28,6 +37,7 @@ function cleverbot:action(msg, config, matches) return end + redis:set(hash, data.cs) utilities.send_reply(msg, data.output) end diff --git a/miku/plugins/getfile.lua b/miku/plugins/getfile.lua index 8b13165..4ddaf23 100644 --- a/miku/plugins/getfile.lua +++ b/miku/plugins/getfile.lua @@ -1,5 +1,4 @@ --- YOU NEED THE FOLLOWING FOLDERS: photo, document, video, voice --- PLEASE ADJUST YOUR PATH BELOW +-- YOU NEED THE FOLLOWING FOLDERS IN YOUR SAVE PATH: photo, document, video, voice, audio, sticker local media_download = {}