Checks if Twitter keys are empty
This commit is contained in:
parent
08e5a6c85f
commit
7c8c56655f
@ -15,9 +15,23 @@ local client = OAuth.new(consumer_key, consumer_secret, {
|
|||||||
})
|
})
|
||||||
|
|
||||||
function run(msg, matches)
|
function run(msg, matches)
|
||||||
|
if consumer_key:isempty() then
|
||||||
|
return "Twitter Consumer Key is empty, write it in plugins/twitter.lua"
|
||||||
|
end
|
||||||
|
if consumer_secret:isempty() then
|
||||||
|
return "Twitter Consumer Secret is empty, write it in plugins/twitter.lua"
|
||||||
|
end
|
||||||
|
if access_token:isempty() then
|
||||||
|
return "Twitter Access Token is empty, write it in plugins/twitter.lua"
|
||||||
|
end
|
||||||
|
if access_token_secret:isempty() then
|
||||||
|
return "Twitter Access Token Secret is empty, write it in plugins/twitter.lua"
|
||||||
|
end
|
||||||
|
|
||||||
if not is_sudo(msg) then
|
if not is_sudo(msg) then
|
||||||
return "You aren't allowed to send tweets"
|
return "You aren't allowed to send tweets"
|
||||||
end
|
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]
|
||||||
|
Reference in New Issue
Block a user