Skip to content

Commit ed428ce

Browse files
committed
Fix duplicated discordmt messages
1 parent d8082b8 commit ed428ce

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

.luacheckrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ globals = {
1616

1717
"default", "doors", "player_api", "sfinv", "binoculars", "bucket",
1818

19+
"discord",
20+
1921
"vector",
2022
math = {
2123
fields = {

mods/ctf/ctf_chat/init.lua

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,22 @@ minetest.register_on_mods_loaded(function()
110110

111111
if chat then
112112
local pteam = ctf_teams.get(name)
113+
114+
local od
115+
if discord then
116+
od = discord.send
117+
discord.send = function() end
118+
end
119+
113120
if pteam then
114121
minetest.chat_send_all(minetest.colorize(ctf_teams.team[pteam].color, "<" .. name .. "> ") .. message)
115122
else
116123
minetest.chat_send_all("<" .. name .. "> " .. message)
117124
end
125+
126+
if discord then
127+
discord.send = od
128+
end
118129
end
119130

120131
return true

mods/ctf/ctf_chat/mod.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
name = ctf_chat
22
depends = ctf_teams
3-
optional_depends = filter
3+
optional_depends = filter, discordmt

0 commit comments

Comments
 (0)