Opened 5 years ago

Last modified 3 years ago

#893 accepted defect

TW-WelcomeBot updates 'trustedplayer' channel on messagebot

Reported by: 24 Owned by: Trancid
Priority: normal Milestone: milestone:
Component: Bots - Other Version: Latest version from repository
Severity: minor Keywords:
Cc:

Description

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!

-24

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
SELECT
0
, 'trustedplayers'
, LOWER(TP.fcPlayerName)
, 1
FROM TWMarketing.tblTrustedPlayers AS TP
LEFT OUTER JOIN trench_TrenchWars.tblChannelUser AS CU ON TP.fcPlayerName = CU.fcName AND CU.fcChannel = 'trustedplayers'

WHERE
(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
WHERE
CU.fcChannel = 'trustedplayers' AND
CU.fcName IS NOT NULL AND
TP.fcPlayerName IS NULL AND
CU.fnLevel NOT IN('2','3');

Change History (1)

comment:1 Changed 3 years ago by Trancid

  • Owner set to Trancid
  • Status changed from new to accepted
Note: See TracTickets for help on using tickets.