TW-WelcomeBot updates 'trustedplayer' channel on messagebot
|Reported by:||24||Owned by:||Trancid|
|Component:||Bots - Other||Version:||Latest version from repository|
Currently, I'm having to use the SQL code at the bottom to move members from trusted players list, to the trusted player channel, and off when they are removed. In order for the bot to recognize that the trusted players have been/added, I have to kill the bot and respawn it.
I think the BEST way to do this, is to have TW-WelcomeBot send an IRC message to MessageBot to add/remove the players when we !trust/!untrust. The only time I see this being a problem is when MessageBot is down for some reason; if this is the case, I would like a message to come back to the person doing the !trust letting them know that they were not added/removed from the 'trustedplayers' messagebot channel because the bot is down.
Please let me know if you have any other questions or concerns!
Current Code Used To ADD/REMOVE players (requires bot restart).
-- Add players to Channel 'TrustedPlayers' who aren't currently on there and are on Trusted Player list.
INSERT INTO trench_TrenchWars.tblChannelUser
FROM TWMarketing.tblTrustedPlayers AS TP
LEFT OUTER JOIN trench_TrenchWars.tblChannelUser AS CU ON TP.fcPlayerName = CU.fcName AND CU.fcChannel = 'trustedplayers'
(CU.fcName <> TP.fcPlayerName OR CU.fcName IS NULL) AND
(CU.fnLevel NOT IN('2','3') OR CU.fnLevel IS NULL)
ORDER BY TP.fcPlayerName;
-- Delete User From Channel 'TrustedPlayers' who aren't on Trusted Player list
DELETE CU FROM trench_TrenchWars.tblChannelUser AS CU
LEFT OUTER JOIN TWMarketing.tblTrustedPlayers AS TP ON CU.fcName = TP.fcPlayerName
CU.fcChannel = 'trustedplayers' AND
CU.fcName IS NOT NULL AND
TP.fcPlayerName IS NULL AND
CU.fnLevel NOT IN('2','3');