Skip to content

Commit

Permalink
Enhancements.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sahri Riza Umami committed Apr 5, 2016
1 parent 6116d25 commit 5625d38
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 23 deletions.
19 changes: 9 additions & 10 deletions bot/bot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -174,16 +174,17 @@ end

-- Create a basic config.lua file and saves it.
function create_config()
print('\nSome functions and plugins using bot API as sender.\n'
print('\n\27[1;33mSome functions and plugins using bot API as sender.\n'
..'Please provide bots API token and username to ensure it\'s works as intended.\n'
..'You can ENTER to skip and then fill the required info into data/config.lua.\n')
io.write('Please input your bot API key (token): ')
local bot_api_key=io.read()
io.write('\nPlease input your bot API @username: ')
local bot_api_uname=io.read()
..'You can ENTER to skip and then fill the required info into data/config.lua.\27[0;39;49m\n')

io.write('\27[1mPlease input your bot API key (token): \27[0;39;49m')
local bot_api_key = io.read()

io.write('\n\27[1mPlease input your bot API @username: \27[0;39;49m')
local bot_api_uname = io.read()
local bot_api_uname = bot_api_uname:gsub('@', '')
print('\nYour bots API token is: '..bot_api_key..'\n'
..'Your bots API @username is : @'..bot_api_uname)

-- A simple config with basic plugins and ourselves as privileged user
_config = {
administration = {},
Expand Down Expand Up @@ -213,8 +214,6 @@ function create_config()
}
}
save_config()
--serialize_to_file(config, './data/config.lua')
--print ('saved config into ./data/config.lua')
end

-- Save the content of _config to config.lua
Expand Down
10 changes: 0 additions & 10 deletions patches/tg_queries.c_937.patch

This file was deleted.

2 changes: 1 addition & 1 deletion plugins/administration.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1586,7 +1586,7 @@ do
if not about then
send_api_msg(msg, get_receiver_api(msg), '<b>'..gtitle..'</b>\n\n'..clickme, true, 'html')
else
send_api_msg(msg, get_receiver_api(msg), '<b>'..gtitle..'</b>\n\n'..about..clickme, true, 'html')
send_api_msg(msg, get_receiver_api(msg), '<b>'..gtitle..'</b>\n\n'..about..'\n\n'..clickme, true, 'html')
end
end
else
Expand Down
8 changes: 6 additions & 2 deletions plugins/google.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,12 @@ do
..unescape_html(res_tbl.titleNoFormatting)..'</a>\n'
end
local stringresults = table.concat(stringresults)
local header = '<b>Google results for</b> <i>'..terms..'</i> <b>:</b>\n'
send_api_msg(msg, greceiver, header..stringresults, true, 'html')
if stringresults == '' then
reply_msg(msg.id, 'No Google results for: '..terms, ok_cb, true)
else
local header = '<b>Google results for</b> <i>'..terms..'</i> <b>:</b>\n'
send_api_msg(msg, greceiver, header..stringresults, true, 'html')
end
end

local function lmgtfy_by_reply(extra, success, result)
Expand Down

0 comments on commit 5625d38

Please sign in to comment.