Konflikte gelöst
This commit is contained in:
		| @@ -1,8 +1,8 @@ | |||||||
| #!/bin/sh | #!/bin/sh | ||||||
| # Launch Brawlbot | # Launch Mikubot | ||||||
| # Restart Brawlbot five seconds after halted. | # Restart Mikubot five seconds after halted. | ||||||
| while true; do | while true; do | ||||||
|     lua main.lua |     lua main.lua | ||||||
|     echo 'Miku wurde gestoppt. ^C zum beenden.' |     echo 'Mikubot wurde gestoppt. ^C zum beenden.' | ||||||
|     sleep 5s |     sleep 5s | ||||||
| done | done | ||||||
| @@ -23,14 +23,9 @@ local bot = {} | |||||||
| bot.version = '160824' | bot.version = '160824' | ||||||
|  |  | ||||||
| function bot:init(config) -- The function run when the bot is started or reloaded. | function bot:init(config) -- The function run when the bot is started or reloaded. | ||||||
| <<<<<<< HEAD:miku/bot.lua |     assert(config.bot_api_key, 'Dein Bot-Token ist nicht in der Config gesetzt!') | ||||||
|     bindings = require('miku.bindings').init(config.bot_api_key) |     bindings = require('miku.bindings').init(config.bot_api_key) | ||||||
| 	utilities = require('miku.utilities') | 	utilities = require('miku.utilities') | ||||||
| ======= |  | ||||||
|     assert(config.bot_api_key, 'Dein Bot-Token ist nicht in der Config gesetzt!') |  | ||||||
|     bindings = require('otouto.bindings').init(config.bot_api_key) |  | ||||||
| 	utilities = require('otouto.utilities') |  | ||||||
| >>>>>>> upstream/master:otouto/bot.lua |  | ||||||
| 	cred_data = load_cred() | 	cred_data = load_cred() | ||||||
|  |  | ||||||
| 	-- Fetch bot information. Try until it succeeds. | 	-- Fetch bot information. Try until it succeeds. | ||||||
|   | |||||||
| @@ -155,14 +155,10 @@ function banhammer:pre_process(msg, config) | |||||||
| 		end | 		end | ||||||
|       else |       else | ||||||
| 	    if not has_been_warned then | 	    if not has_been_warned then | ||||||
| <<<<<<< HEAD:miku/plugins/banhammer.lua |  | ||||||
| 		  utilities.send_reply(msg, "Dies ist ein privater Bot, der erst nach einer Freischaltung benutzt werden kann.\nThis is a private bot, which can only be used after an approval.") |  | ||||||
| ======= |  | ||||||
| 		  utilities.send_reply(msg, config.banhammer_text or [[ | 		  utilities.send_reply(msg, config.banhammer_text or [[ | ||||||
| 		  Dies ist ein privater Bot, der erst nach einer Freischaltung benutzt werden kann. | 		  Dies ist ein privater Bot, der erst nach einer Freischaltung benutzt werden kann. | ||||||
| 	This is a private bot, which can only be used after an approval. | 	This is a private bot, which can only be used after an approval. | ||||||
| 		  ]]) | 		  ]]) | ||||||
| >>>>>>> upstream/master:otouto/plugins/banhammer.lua |  | ||||||
| 		  redis:hset('user:'..user_id, 'has_been_warned', true) | 		  redis:hset('user:'..user_id, 'has_been_warned', true) | ||||||
| 		else | 		else | ||||||
| 		  print('User has already been warned!') | 		  print('User has already been warned!') | ||||||
|   | |||||||
| @@ -2,15 +2,9 @@ local cleverbot = {} | |||||||
|  |  | ||||||
| function cleverbot:init(config) | function cleverbot:init(config) | ||||||
| 	cleverbot.triggers = { | 	cleverbot.triggers = { | ||||||
| <<<<<<< HEAD:miku/plugins/cleverbot.lua |  | ||||||
| 	"^/[Cc][Bb][Oo][Tt] (.*)$", | 	"^/[Cc][Bb][Oo][Tt] (.*)$", | ||||||
| 	"^[Mm][Ii][Kk][Uu][Bb][Oo][Tt], (.+)$", | 	"^[Mm][Ii][Kk][Uu][Bb][Oo][Tt], (.+)$", | ||||||
| 	"^[Mm][Ii][Kk][Uu], (.+)$" | 	"^[Mm][Ii][Kk][Uu], (.+)$" | ||||||
| ======= |  | ||||||
| 	"^/cbot (.+)$", |  | ||||||
| 	"^[Bb]rawlbot, (.+)$", |  | ||||||
| 	"^[Bb]ot, (.+)$" |  | ||||||
| >>>>>>> upstream/master:otouto/plugins/cleverbot.lua |  | ||||||
| 	} | 	} | ||||||
| 	cleverbot.url = config.chatter.cleverbot_api | 	cleverbot.url = config.chatter.cleverbot_api | ||||||
| end | end | ||||||
|   | |||||||
| @@ -1,66 +1,6 @@ | |||||||
| <<<<<<< HEAD:miku/plugins/luarun.lua | local luarun = {} | ||||||
| local luarun = {} |  | ||||||
|  |  | ||||||
| function luarun:init(config) | local utilities = require('miku.utilities') | ||||||
| 	luarun.triggers = utilities.triggers(self.info.username, config.cmd_pat):t('lua', true):t('return', true).table |  | ||||||
| 	if config.luarun_serpent then |  | ||||||
| 		serpent = require('serpent') |  | ||||||
| 		luarun.serialize = function(t) |  | ||||||
| 			return serpent.block(t, {comment=false}) |  | ||||||
| 		end |  | ||||||
| 	else |  | ||||||
| 		JSON = require('dkjson') |  | ||||||
| 		luarun.serialize = function(t) |  | ||||||
| 			return JSON.encode(t, {indent=true}) |  | ||||||
| 		end |  | ||||||
| 	end |  | ||||||
| end |  | ||||||
|  |  | ||||||
| function luarun:action(msg, config) |  | ||||||
|  |  | ||||||
| 	if not is_sudo(msg, config) then |  | ||||||
| 		return true |  | ||||||
| 	end |  | ||||||
|  |  | ||||||
| 	local input = utilities.input(msg.text) |  | ||||||
| 	if not input then |  | ||||||
| 		utilities.send_reply(msg, 'Bitte gebe einen Befehl ein.') |  | ||||||
| 		return |  | ||||||
| 	end |  | ||||||
|  |  | ||||||
| 	if msg.text_lower:match('^'..config.cmd_pat..'return') then |  | ||||||
| 		input = 'return ' .. input |  | ||||||
| 	end |  | ||||||
|  |  | ||||||
| 	local output = loadstring( [[ |  | ||||||
| 		local bot = require('miku.bot') |  | ||||||
| 		local bindings = require('miku.bindings') |  | ||||||
| 		local utilities = require('miku.utilities') |  | ||||||
| 		local json = require('dkjson') |  | ||||||
| 		local URL = require('socket.url') |  | ||||||
| 		local http = require('socket.http') |  | ||||||
| 		local https = require('ssl.https') |  | ||||||
| 		return function (msg, config) ]] .. input .. [[ end |  | ||||||
| 	]] )()(msg, config) |  | ||||||
| 	if output == nil then |  | ||||||
| 		output = 'Ausgef<EFBFBD>hrt!' |  | ||||||
| 	else |  | ||||||
| 		if type(output) == 'table' then |  | ||||||
| 			local s = luarun.serialize(output) |  | ||||||
| 			if URL.escape(s):len() < 4000 then |  | ||||||
| 				output = s |  | ||||||
| 			end |  | ||||||
| 		end |  | ||||||
| 		output = '```\n' .. tostring(output) .. '\n```' |  | ||||||
| 	end |  | ||||||
| 	utilities.send_message(msg.chat.id, output, true, msg.message_id, true) |  | ||||||
|  |  | ||||||
| end |  | ||||||
|  |  | ||||||
| ======= |  | ||||||
| local luarun = {} |  | ||||||
|  |  | ||||||
| local utilities = require('otouto.utilities') |  | ||||||
| local URL = require('socket.url') | local URL = require('socket.url') | ||||||
| local JSON, serpent | local JSON, serpent | ||||||
|  |  | ||||||
| @@ -96,9 +36,9 @@ function luarun:action(msg, config) | |||||||
|     end |     end | ||||||
|  |  | ||||||
|     local output, success = |     local output, success = | ||||||
|         load("local bot = require('otouto.bot')\n\z |         load("local bot = require('miku.bot')\n\z | ||||||
|         local bindings = require('otouto.bindings')\n\z |         local bindings = require('miku.bindings')\n\z | ||||||
|         local utilities = require('otouto.utilities')\n\z |         local utilities = require('miku.utilities')\n\z | ||||||
|         local json = require('dkjson')\n\z |         local json = require('dkjson')\n\z | ||||||
|         local URL = require('socket.url')\n\z |         local URL = require('socket.url')\n\z | ||||||
|         local http = require('socket.http')\n\z |         local http = require('socket.http')\n\z | ||||||
| @@ -130,5 +70,4 @@ function luarun:action(msg, config) | |||||||
|  |  | ||||||
| end | end | ||||||
|  |  | ||||||
| >>>>>>> upstream/master:otouto/plugins/luarun.lua |  | ||||||
| return luarun | return luarun | ||||||
		Reference in New Issue
	
	Block a user