Check allowed user to send tweets

This commit is contained in:
yago 2014-11-27 21:44:29 +01:00
parent 1c96903cc0
commit 0a14948ebd

View File

@ -15,7 +15,9 @@ local client = OAuth.new(consumer_key, consumer_secret, {
}) })
function run(msg, matches) function run(msg, matches)
if not is_sudo(msg) then
return "You aren't allowed to send tweets"
end
local response_code, response_headers, response_status_line, response_body = local response_code, response_headers, response_status_line, response_body =
client:PerformRequest("POST", "https://api.twitter.com/1.1/statuses/update.json", { client:PerformRequest("POST", "https://api.twitter.com/1.1/statuses/update.json", {
status = matches[1] status = matches[1]
@ -23,7 +25,7 @@ function run(msg, matches)
if response_code ~= 200 then if response_code ~= 200 then
return "Error: "..response_code return "Error: "..response_code
end end
return "Tweet enviado" return "Tweet sended"
end end
return { return {