From 947d397673e4e150f6553851bded1c0363df5ae6 Mon Sep 17 00:00:00 2001 From: dupie Date: Wed, 8 Jul 2015 22:56:50 -0400 Subject: [PATCH] fixed btc --- README.md | 2 +- plugins/btc.lua | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 69fbc65..62114f7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # otouto -The plugin-wielding, multi-purpose Telegram chat bot. +The plugin-wielding, multi-purpose Telegram bot. Public bot runs on [@mokubot](http://telegram.me/mokubot). diff --git a/plugins/btc.lua b/plugins/btc.lua index c75ce27..c70233a 100644 --- a/plugins/btc.lua +++ b/plugins/btc.lua @@ -24,11 +24,10 @@ function PLUGIN.action(msg) local jdat = JSON.decode(jstr) - if string.len(msg.text) > 6 then - arg1 = string.upper(string.sub(msg.text, 6, 8)) - end - if string.len(msg.text) > 9 then - arg2 = string.sub(msg.text, 10) + local input = get_input(msg.text) + if input then + arg1 = string.upper(string.sub(input, 1, 3)) + arg2 = string.sub(input, 5) if not tonumber(arg2) then return send_msg(msg, 'Invalid argument.') end