Twitter_User: Ignoriere, wenn kein HTTP 200

This commit is contained in:
Andreas Bielawski 2016-06-29 20:06:19 +02:00
parent 29b71b59ab
commit 771f7e9955

View File

@ -67,6 +67,7 @@ function twitter_user:action(msg)
local twitter_url = "https://api.twitter.com/1.1/users/show/"..matches[1]..".json" local twitter_url = "https://api.twitter.com/1.1/users/show/"..matches[1]..".json"
local response_code, response_headers, response_status_line, response_body = client:PerformRequest("GET", twitter_url) local response_code, response_headers, response_status_line, response_body = client:PerformRequest("GET", twitter_url)
local response = json.decode(response_body) local response = json.decode(response_body)
if response_code ~= 200 then return end
local full_name = response.name local full_name = response.name
local user_name = response.screen_name local user_name = response.screen_name