i am trying to set up a custom bot with telegram-cli (https://github.com/vysheng/tg) and Cloud9. Working fine so far but i cant get the "create_group_chat" argument running. Maybe someone has a clue?
ps.: i am not a developer. sorry if the code is total shit!
do
local function callback(extra, success, result)
vardump(success)
vardump(result)
end
local function run(msg, matches)
local chat topic = matches[1]
-- Topic
if matches[1] == "topic" then
chat topic = string.gsub(" ")
end
end
local function run(msg, matches)
local user = matches[2]
-- User 1
if matches[1] == "name" then
user = string.gsub(user," ","_")
end
-- User 2
if matches[1] == "name" then
user = string.gsub(user," ","_")
end
-- Create Groupchat
local function run (msg, matches)
create_group_chat(chat topic, user1, user2, callback, false)
return "Add: "..user.." to "..chat
end
return {
description = "explenation",
usage = {
"!creategroup topic [topic] [user_name1] [user_name2] [user_name3]"
},
patterns = {
"^!creategroup topic (topic) (name1) (name2) (name3) (.*)$"
},
run = run
}
end