This is a modified version of my personal AntiDuel addon to respond to party invites.
Lua Code:
UIParent:HookScript("OnEvent",function(self,event,...)
if event=="PARTY_INVITE_REQUEST" then
local a1,a2,a3,a4=...;
DeclineGroup();
if a2 or a3 or a4 then
StaticPopupSpecial_Hide(LFGInvitePopup);
elseif a5 then
StaticPopup_Hide("PARTY_INVITE_XREALM");
else
StaticPopup_Hide("PARTY_INVITE");
end
end
end);
Though in all honesty, you could just run the following to stop the UI from processing party invites.
This won't actually decline the invite, but it'll stop the UI from telling you about it.
Code:
UIParent:UnregisterEvent("PARTY_INVITE_REQUEST");