Update messages
This commit is contained in:
parent
db801fb81b
commit
3d162344f3
26
chatcmds.lua
26
chatcmds.lua
@ -7,11 +7,11 @@
|
||||
|
||||
minetest.register_chatcommand("irc2_msg", {
|
||||
params = "<name> <message>",
|
||||
description = "Send a private message to a freenode IRC user",
|
||||
description = "Send a private message to a Libera Chat (IRC) user",
|
||||
privs = {shout=true},
|
||||
func = function(name, param)
|
||||
if not irc2.connected then
|
||||
return false, "Not connected to freenode IRC. Use /irc2_connect to connect."
|
||||
return false, "Not connected to Libera IRC. Use /irc2_connect to connect."
|
||||
end
|
||||
local found, _, toname, message = param:find("^([^%s]+)%s(.+)")
|
||||
if not found then
|
||||
@ -41,26 +41,26 @@ minetest.register_chatcommand("irc2_msg", {
|
||||
|
||||
minetest.register_chatcommand("irc2_names", {
|
||||
params = "",
|
||||
description = "List the users in freenode IRC.",
|
||||
description = "List the users in Libera IRC.",
|
||||
func = function()
|
||||
if not irc2.connected then
|
||||
return false, "Not connected to freenode IRC. Use /irc2_connect to connect."
|
||||
return false, "Not connected to Libera IRC. Use /irc2_connect to connect."
|
||||
end
|
||||
local users = { }
|
||||
for nick in pairs(irc2.conn.channels[irc2.config.channel].users) do
|
||||
table.insert(users, nick)
|
||||
end
|
||||
return true, "Users in freenode IRC: "..table.concat(users, ", ")
|
||||
return true, "Users in Libera IRC: "..table.concat(users, ", ")
|
||||
end
|
||||
})
|
||||
|
||||
|
||||
minetest.register_chatcommand("irc2_connect", {
|
||||
description = "Connect to the freenode IRC server.",
|
||||
description = "Connect to the Libera IRC server.",
|
||||
privs = {irc2_admin=true},
|
||||
func = function(name)
|
||||
if irc2.connected then
|
||||
return false, "You are already connected to freenode IRC."
|
||||
return false, "You are already connected to Libera IRC."
|
||||
end
|
||||
minetest.chat_send_player(name, "IRC: Connecting...")
|
||||
irc2.connect()
|
||||
@ -70,11 +70,11 @@ minetest.register_chatcommand("irc2_connect", {
|
||||
|
||||
minetest.register_chatcommand("irc2_disconnect", {
|
||||
params = "[message]",
|
||||
description = "Disconnect from freenode IRC.",
|
||||
description = "Disconnect from Libera IRC.",
|
||||
privs = {irc2_admin=true},
|
||||
func = function(name, param)
|
||||
if not irc2.connected then
|
||||
return false, "Not connected to freenode IRC. Use /irc2_connect to connect."
|
||||
return false, "Not connected to Libera IRC. Use /irc2_connect to connect."
|
||||
end
|
||||
if param == "" then
|
||||
param = "Manual disconnect by "..name
|
||||
@ -85,11 +85,11 @@ minetest.register_chatcommand("irc2_disconnect", {
|
||||
|
||||
|
||||
minetest.register_chatcommand("irc2_reconnect", {
|
||||
description = "Reconnect to freenode IRC.",
|
||||
description = "Reconnect to Libera IRC.",
|
||||
privs = {irc2_admin=true},
|
||||
func = function(name)
|
||||
if not irc2.connected then
|
||||
return false, "Not connected to freenode IRC. Use /irc2_connect to connect."
|
||||
return false, "Not connected to Libera IRC. Use /irc2_connect to connect."
|
||||
end
|
||||
minetest.chat_send_player(name, "IRC: Reconnecting...")
|
||||
irc2.disconnect("Reconnecting...")
|
||||
@ -100,11 +100,11 @@ minetest.register_chatcommand("irc2_reconnect", {
|
||||
|
||||
minetest.register_chatcommand("irc2_quote", {
|
||||
params = "<command>",
|
||||
description = "Send a raw command freenode IRC.",
|
||||
description = "Send a raw command Libera IRC.",
|
||||
privs = {irc2_admin=true},
|
||||
func = function(name, param)
|
||||
if not irc2.connected then
|
||||
return false, "Not connected to freenode IRC. Use /irc2_connect to connect."
|
||||
return false, "Not connected to Libera IRC. Use /irc2_connect to connect."
|
||||
end
|
||||
irc2.queue(param)
|
||||
minetest.chat_send_player(name, "Command sent!")
|
||||
|
18
hooks.lua
18
hooks.lua
@ -86,7 +86,7 @@ function irc2.hooks.ctcp(msg)
|
||||
|
||||
if command == "ACTION" and msg.args[1] == irc2.config.channel then
|
||||
local action = text:sub(8, -1)
|
||||
irc2.sendLocal(("* %s@freenode %s"):format(msg.user.nick, action))
|
||||
irc2.sendLocal(("* %s@Libera %s"):format(msg.user.nick, action))
|
||||
elseif command == "VERSION" then
|
||||
reply(("Minetest version %s, IRC mod version %s.")
|
||||
:format(get_core_version(), irc2.version))
|
||||
@ -106,7 +106,7 @@ function irc2.hooks.channelChat(msg)
|
||||
-- Don't let a user impersonate someone else by using the nick "IRC"
|
||||
local fake = msg.user.nick:lower():match("^[il|]rc$")
|
||||
if fake then
|
||||
irc2.sendLocal("<"..msg.user.nick.."@freenode> "..text)
|
||||
irc2.sendLocal("<"..msg.user.nick.."@Libera> "..text)
|
||||
return
|
||||
elseif msg.user.nick == "BlockyRelay" then
|
||||
return
|
||||
@ -145,7 +145,7 @@ function irc2.hooks.channelChat(msg)
|
||||
irc2.sendLocal(("* %s@%s %s")
|
||||
:format(actionnick, msg.user.nick, actionmessage))
|
||||
else
|
||||
irc2.sendLocal(("<%s@freenode> %s"):format(msg.user.nick, text))
|
||||
irc2.sendLocal(("<%s@Libera> %s"):format(msg.user.nick, text))
|
||||
end
|
||||
end
|
||||
|
||||
@ -163,10 +163,10 @@ end
|
||||
|
||||
function irc2.hooks.kick(channel, target, prefix, reason)
|
||||
if target == irc2.conn.nick then
|
||||
minetest.chat_send_all("IRC: kicked from "..channel.." (freenode) by "..prefix.nick..".")
|
||||
minetest.chat_send_all("IRC: kicked from "..channel.." (Libera) by "..prefix.nick..".")
|
||||
irc2.disconnect("Kicked")
|
||||
else
|
||||
irc2.sendLocal(("-!- %s was kicked from %s (freenode) by %s [%s]")
|
||||
irc2.sendLocal(("-!- %s was kicked from %s (Libera) by %s [%s]")
|
||||
:format(target, channel, prefix.nick, reason))
|
||||
end
|
||||
end
|
||||
@ -174,7 +174,7 @@ end
|
||||
|
||||
function irc2.hooks.notice(user, target, message)
|
||||
if user.nick and target == irc2.config.channel then
|
||||
irc2.sendLocal("-"..user.nick.."@freenode- "..message)
|
||||
irc2.sendLocal("-"..user.nick.."@Libera- "..message)
|
||||
end
|
||||
end
|
||||
|
||||
@ -201,20 +201,20 @@ end
|
||||
|
||||
|
||||
function irc2.hooks.join(user, channel)
|
||||
irc2.sendLocal(("-!- %s joined %s (freenode)")
|
||||
irc2.sendLocal(("-!- %s joined %s (Libera)")
|
||||
:format(user.nick, channel))
|
||||
end
|
||||
|
||||
|
||||
function irc2.hooks.part(user, channel, reason)
|
||||
reason = reason or ""
|
||||
irc2.sendLocal(("-!- %s has left %s (freenode) [%s]")
|
||||
irc2.sendLocal(("-!- %s has left %s (Libera) [%s]")
|
||||
:format(user.nick, channel, reason))
|
||||
end
|
||||
|
||||
|
||||
function irc2.hooks.quit(user, reason)
|
||||
irc2.sendLocal(("-!- %s has quit freenode [%s]")
|
||||
irc2.sendLocal(("-!- %s has quit Libera [%s]")
|
||||
:format(user.nick, reason))
|
||||
end
|
||||
|
||||
|
@ -10,7 +10,7 @@ irc2.auto_connect (Auto-connect on load) bool true
|
||||
irc2.nick (Bot nickname) string Minetest
|
||||
|
||||
# Server to connect to.
|
||||
irc2.server (IRC server) string irc.freenode.net
|
||||
irc2.server (IRC server) string irc.libera.chat
|
||||
|
||||
# Server port.
|
||||
# The standard IRC protocol port is 6667 for regular servers,
|
||||
|
Loading…
x
Reference in New Issue
Block a user