public string AddChannel(SockChatChannel chan) { lock (Channels) { SockChatChannel eChan = FindChannelByName(chan.Name); if (eChan != null) { return(SockChatMessage.PackBotMessage(1, @"nischan", chan.Name)); } if (chan.Name.StartsWith(@"@") || chan.Name.StartsWith(@"*")) { return(SockChatMessage.PackBotMessage(1, @"inchan")); } Channels.Add(chan); lock (Users) Users.Where(u => u.Hierarchy >= chan.Hierarchy).ForEach(u => u.Send(new ChannelCreatePacket(chan))); } return(null); }
public void Send(bool error, string id, params string[] args) { Send(SockChatServer.Bot, SockChatMessage.PackBotMessage(error ? 1 : 0, id, args)); }