I updated the members plugin to not only auto-member people whenever they join the org but to also instantly remove them from the memberlist, notify list, guestlist, etc if they leave or are kicked form the org.
Something similar to:
private void Events_ChannelMessageEvent(BotShell bot, ChannelMessageArgs e) {
if (e.Type == ChannelType.Organization || e.Type == ChannelType.Towers) {
if (e.Channel == "Org Msg") {
//capture join/leave/kick org messages and do things
if (e.Descrambled.CategoryID == 508) {
if (e.Descrambled.EntryID == 173558247) {
//<someone> invited <toon> to your organization.
Regex matches = new Regex(@"(.+)\sinvited\s(.+)\sto\syour\sorganization\.");
if (matches.IsMatch(HTML.UnescapeString(HTML.StripTags(e.Message)))) {
Match match = matches.Match(HTML.UnescapeString(HTML.StripTags(e.Message)));
string inviter = match.Groups[1].Value;
string invited = match.Groups[2].Value;
if (this._autoMember) {
bot.Users.AddUser(invited, UserLevel.Member, inviter);
bot.FriendList.Add("notify", invited);
if (bot.FriendList.IsFriend("guestlist", invited)) {
bot.FriendList.Remove("guestlist", invited);
}
if (bot.PrivateChannel.IsOn(invited)) {
bot.PrivateChannel.Kick(invited);
}
}
if (this._welcomeMembers) bot.SendOrganizationMessage(bot.ColorHighlight + "Welcome to the org, " + bot.ColorNormal + invited + bot.ColorHighlight + "!!!");
}
}
else if (e.Descrambled.EntryID == 5146599) {
//<toon> has joined your organization.
Regex matches = new Regex(@"(.+)\shas\sjoined\syour\sorganization\.");
if (matches.IsMatch(HTML.UnescapeString(HTML.StripTags(e.Message)))) {
Match match = matches.Match(HTML.UnescapeString(HTML.StripTags(e.Message)));
string invited = match.Groups[1].Value;
if (this._autoMember) {
bot.Users.AddUser(invited, UserLevel.Member, bot.Character);
bot.FriendList.Add("notify", invited);
if (bot.FriendList.IsFriend("guestlist", invited)) {
bot.FriendList.Remove("guestlist", invited);
}
if (bot.PrivateChannel.IsOn(invited)) {
bot.PrivateChannel.Kick(invited);
}
}
if (this._welcomeMembers) bot.SendOrganizationMessage(bot.ColorHighlight + "Welcome to the org, " + bot.ColorNormal + invited + bot.ColorHighlight + "!!!");
}
}
else if (e.Descrambled.EntryID == 45978487) {
//<toon> just left your organization.
Regex matches = new Regex(@"(.+)\sjust\sleft\syour\sorganization\.");
if (matches.IsMatch(HTML.UnescapeString(HTML.StripTags(e.Message)))) {
Match match = matches.Match(HTML.UnescapeString(HTML.StripTags(e.Message)));
string toon = match.Groups[1].Value;
if (this._autoMember) {
bot.Users.RemoveUser(toon);
bot.FriendList.Remove("notify", toon);
if (bot.FriendList.IsFriend("guestlist", toon)) {
bot.FriendList.Remove("guestlist", toon);
}
if (bot.PrivateChannel.IsOn(toon)) {
bot.PrivateChannel.Kick(toon);
}
}
}
}
else if (e.Descrambled.EntryID == 20908201) {
//<someone> removed inactive character <toon> from your organization.
Regex matches = new Regex(@"(.+)\sremoved\sinactive\scharacter\s(.+)\sfrom\syour\sorganization\.");
if (matches.IsMatch(HTML.UnescapeString(HTML.StripTags(e.Message)))) {
Match match = matches.Match(HTML.UnescapeString(HTML.StripTags(e.Message)));
string kicker = match.Groups[1].Value;
string kicked = match.Groups[2].Value;
if (this._autoMember) {
bot.Users.RemoveUser(kicked);
bot.FriendList.Remove("notify", kicked);
if (bot.FriendList.IsFriend("guestlist", kicked)) {
bot.FriendList.Remove("guestlist", kicked);
}
if (bot.PrivateChannel.IsOn(kicked)) {
bot.PrivateChannel.Kick(kicked);
}
}
}
}
}
}
}
}