From f4a20a972f1d589ef40e43355fc2c93275cab744 Mon Sep 17 00:00:00 2001 From: Andreas Bielawski Date: Tue, 9 Aug 2016 17:35:40 +0200 Subject: [PATCH] =?UTF-8?q?...mit=20einer=20Nachkommastelle=20+=20Bugfix?= =?UTF-8?q?=20f=C3=BCr=20ID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- otouto/plugins/id.lua | 2 +- otouto/plugins/stats.lua | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/otouto/plugins/id.lua b/otouto/plugins/id.lua index 3baed62..acc8562 100644 --- a/otouto/plugins/id.lua +++ b/otouto/plugins/id.lua @@ -44,7 +44,7 @@ function id:get_user(user_id, chat_id) return user_info end -function id:action(msg) +function id:action(msg, config, matches) if matches[1] == "/id" then if msg.reply_to_message then diff --git a/otouto/plugins/stats.lua b/otouto/plugins/stats.lua index 7154ac5..7e4016c 100644 --- a/otouto/plugins/stats.lua +++ b/otouto/plugins/stats.lua @@ -71,8 +71,8 @@ function stats:chat_stats(chat_id) local text = '' for k,user in pairs(users_info) do local msg_num = user.msgs - local percent = msg_num / all_msgs * 100 - text = text..user.name..': '..comma_value(msg_num)..' ('..round(percent)..'%)\n' + local percent = tostring(round(msg_num / all_msgs * 100, 1)) + text = text..user.name..': '..comma_value(msg_num)..' ('..percent:gsub('%.', ',')..'%)\n' end if text:isempty() then return 'Keine Stats für diesen Chat verfügbar!'end local text = text..'\nTOTAL: '..comma_value(all_msgs)