- GitHub: Fix, wenn keine Beschreibung

- Notify: Interpunktion
This commit is contained in:
Andreas Bielawski 2016-10-23 22:06:30 +02:00
parent a8082bd34d
commit 6447fbd2a5
2 changed files with 8 additions and 4 deletions

View File

@ -24,7 +24,11 @@ end
function github:send_github_data(data)
if not data.owner then return nil end
local name = '<b>'..data.name..'</b>'
local description = '<i>'..data.description..'</i>'
if data.description then
description = '\n<i>'..data.description..'</i>'
else
description = ''
end
local owner = data.owner.login
local clone_url = data.clone_url
if data.language == nil or data.language == "" then
@ -42,7 +46,7 @@ function github:send_github_data(data)
else
homepage = '\n<a href="'..data.homepage..'">Homepage besuchen</a>'
end
local text = name..' von '..owner..'\n'..description..'\n<pre>git clone '..clone_url..'</pre>'..language..issues..homepage
local text = name..' von '..owner..description..'\n<pre>git clone '..clone_url..'</pre>'..language..issues..homepage
return text
end

View File

@ -87,11 +87,11 @@ function notify:action(msg, config, matches)
redis:hset(hash, 'id', msg.from.id)
print('Adding '..username..' to redis set notify:ls')
redis:sadd('notify:ls', username)
local res = utilities.send_message(msg.from.id, 'Du erhältst jetzt Benachrichtigungen, wenn du angesprochen wirst, nutze `/notify del` zum Deaktivieren.', true, nil, true)
local res = utilities.send_message(msg.from.id, 'Du erhältst jetzt Benachrichtigungen, wenn du angesprochen wirst. Nutze `/notify del` zum Deaktivieren.', true, nil, true)
if not res then
utilities.send_reply(msg, 'Bitte schreibe mir [privat](http://telegram.me/' .. self.info.username .. '?start=notify), um den Vorgang abzuschließen.', true)
elseif msg.chat.type ~= 'private' then
utilities.send_reply(msg, 'Du erhältst jetzt Benachrichtigungen, wenn du angesprochen wirst, nutze `/notify del` zum Deaktivieren.', true)
utilities.send_reply(msg, 'Du erhältst jetzt Benachrichtigungen, wenn du angesprochen wirst. Nutze `/notify del` zum Deaktivieren.', true)
end
end
end