mirror of
https://github.com/MinetestForFun/irc_modpack.git
synced 2025-02-03 13:40:21 +01:00
Remove whitespaces
This commit is contained in:
parent
9fae29e3b9
commit
eca49efd4a
@ -46,13 +46,13 @@ function irc:bot_command(msg, text)
|
|||||||
cmd = text
|
cmd = text
|
||||||
args = ""
|
args = ""
|
||||||
end
|
end
|
||||||
|
|
||||||
if not self.bot_commands[cmd] then
|
if not self.bot_commands[cmd] then
|
||||||
self:reply("Unknown command '"..cmd.."'. Try 'list'."
|
self:reply("Unknown command '"..cmd.."'. Try 'list'."
|
||||||
.." Or use @playername <message> to send a private message")
|
.." Or use @playername <message> to send a private message")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local success, message = self.bot_commands[cmd].func(msg.user, args)
|
local success, message = self.bot_commands[cmd].func(msg.user, args)
|
||||||
if message then
|
if message then
|
||||||
self:reply(message)
|
self:reply(message)
|
||||||
|
@ -13,7 +13,7 @@ end
|
|||||||
function set:add(connection)
|
function set:add(connection)
|
||||||
local socket = connection.socket
|
local socket = connection.socket
|
||||||
insert(self.sockets, socket)
|
insert(self.sockets, socket)
|
||||||
|
|
||||||
self.connections[socket] = connection
|
self.connections[socket] = connection
|
||||||
insert(self.connections, connection)
|
insert(self.connections, connection)
|
||||||
end
|
end
|
||||||
@ -32,13 +32,13 @@ end
|
|||||||
|
|
||||||
function set:select()
|
function set:select()
|
||||||
local read, write, err = select(self.sockets, nil, self.timeout)
|
local read, write, err = select(self.sockets, nil, self.timeout)
|
||||||
|
|
||||||
if read then
|
if read then
|
||||||
for k, socket in ipairs(read) do
|
for k, socket in ipairs(read) do
|
||||||
read[k] = self.connections[socket]
|
read[k] = self.connections[socket]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return read, err
|
return read, err
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ function irc:player_part(name)
|
|||||||
self.joined_players[name] = nil
|
self.joined_players[name] = nil
|
||||||
minetest.chat_send_player(name, "IRC: You are now out of the channel.")
|
minetest.chat_send_player(name, "IRC: You are now out of the channel.")
|
||||||
end
|
end
|
||||||
|
|
||||||
function irc:player_join(name)
|
function irc:player_join(name)
|
||||||
if self.joined_players[name] then
|
if self.joined_players[name] then
|
||||||
minetest.chat_send_player(name, "IRC: You are already in the channel.")
|
minetest.chat_send_player(name, "IRC: You are already in the channel.")
|
||||||
@ -28,7 +28,7 @@ minetest.register_chatcommand("join", {
|
|||||||
irc:player_join(name)
|
irc:player_join(name)
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_chatcommand("part", {
|
minetest.register_chatcommand("part", {
|
||||||
description = "Part the IRC channel",
|
description = "Part the IRC channel",
|
||||||
privs = {shout=true},
|
privs = {shout=true},
|
||||||
@ -36,7 +36,7 @@ minetest.register_chatcommand("part", {
|
|||||||
irc:player_part(name)
|
irc:player_part(name)
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_chatcommand("who", {
|
minetest.register_chatcommand("who", {
|
||||||
description = "Tell who is currently on the channel",
|
description = "Tell who is currently on the channel",
|
||||||
privs = {},
|
privs = {},
|
||||||
@ -49,13 +49,13 @@ minetest.register_chatcommand("who", {
|
|||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
minetest.register_on_joinplayer(function(player)
|
minetest.register_on_joinplayer(function(player)
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
irc.joined_players[name] = irc.config.auto_join
|
irc.joined_players[name] = irc.config.auto_join
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
||||||
minetest.register_on_leaveplayer(function(player)
|
minetest.register_on_leaveplayer(function(player)
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
irc.joined_players[name] = nil
|
irc.joined_players[name] = nil
|
||||||
|
@ -18,7 +18,7 @@ local function load_tokens()
|
|||||||
local f = io.open(tokens_file, "r")
|
local f = io.open(tokens_file, "r")
|
||||||
local tokens = {}
|
local tokens = {}
|
||||||
if f then
|
if f then
|
||||||
tokens = minetest.deserialize(f:read())
|
tokens = minetest.deserialize(f:read())
|
||||||
f:close()
|
f:close()
|
||||||
end
|
end
|
||||||
return tokens
|
return tokens
|
||||||
@ -68,7 +68,7 @@ minetest.register_chatcommand("gen_token", {
|
|||||||
..irc_users[nick] .. " (token regenerated)")
|
..irc_users[nick] .. " (token regenerated)")
|
||||||
irc_users[nick] = nil
|
irc_users[nick] = nil
|
||||||
irc:say(nick, "Token regenerated. You are now logged off.")
|
irc:say(nick, "Token regenerated. You are now logged off.")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
@ -93,7 +93,7 @@ minetest.register_chatcommand("del_token", {
|
|||||||
..irc_users[nick] .. " (token regenerated)")
|
..irc_users[nick] .. " (token regenerated)")
|
||||||
irc_users[nick] = nil
|
irc_users[nick] = nil
|
||||||
irc:say(nick, "Token regenerated. You are now logged off.")
|
irc:say(nick, "Token regenerated. You are now logged off.")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return true, "Access for you using a token has been removed. Use /gen_token to create" ..
|
return true, "Access for you using a token has been removed. Use /gen_token to create" ..
|
||||||
" a new token at any time"
|
" a new token at any time"
|
||||||
|
Loading…
Reference in New Issue
Block a user