Cleverbot: send_typing() und zusätzliches Pattern: ^Brawlbot, (.+)$"
This commit is contained in:
parent
5449bd3263
commit
8c747a27d7
@ -2,7 +2,8 @@ local cleverbot = {}
|
|||||||
|
|
||||||
function cleverbot:init(config)
|
function cleverbot:init(config)
|
||||||
cleverbot.triggers = {
|
cleverbot.triggers = {
|
||||||
"^/cbot (.*)$"
|
"^/cbot (.+)$",
|
||||||
|
"^[Bb]rawlbot, (.+)$",
|
||||||
}
|
}
|
||||||
|
|
||||||
cleverbot.doc = [[*
|
cleverbot.doc = [[*
|
||||||
@ -14,6 +15,7 @@ cleverbot.command = 'cbot <Text>'
|
|||||||
function cleverbot:action(msg, config)
|
function cleverbot:action(msg, config)
|
||||||
local text = msg.text
|
local text = msg.text
|
||||||
local url = "https://brawlbot.tk/apis/chatter-bot-api/cleverbot.php?text="..URL.escape(text)
|
local url = "https://brawlbot.tk/apis/chatter-bot-api/cleverbot.php?text="..URL.escape(text)
|
||||||
|
utilities.send_typing(self, msg.chat.id, 'typing')
|
||||||
local query = https.request(url)
|
local query = https.request(url)
|
||||||
if query == nil then utilities.send_reply(self, msg, 'Ein Fehler ist aufgetreten :(') return end
|
if query == nil then utilities.send_reply(self, msg, 'Ein Fehler ist aufgetreten :(') return end
|
||||||
local decode = json.decode(query)
|
local decode = json.decode(query)
|
||||||
|
Reference in New Issue
Block a user