// ------------------------------------------REGISTERED FUNCTIONS---------------------------------------------- public void SendMessage(string Message) { ThreadPool.QueueUserWorkItem(new WaitCallback(delegate(object state) { IRC_Functions.SendMessage(ParentChannel, Message); }), null); }
public void RefreshLUA() { ThreadPool.QueueUserWorkItem(new WaitCallback(delegate(object state) { InitLUA(ParentChannel); IRC_Functions.SendMessage(ParentChannel, "Script refreshed."); }), null); }
public void ChatMessageReceived(User user, bool IsMod, string Message) { // Should probably add an event handler, but RegisterLuaDelegateType is poorly documented. ThreadPool.QueueUserWorkItem(new WaitCallback(delegate(object state) { try { NLua.LuaFunction MessageReceived = Environment["event_MessageReceived"] as NLua.LuaFunction; MessageReceived.Call(user.Username, IsMod, Message); // Safer way to call than using DoString } catch (NLua.Exceptions.LuaScriptException e) { IRC_Functions.SendMessage(ParentChannel, "Script failed"); Log.Logger.OutputToConsole(e.ToString()); } catch { // Do nothing } }), null); }
///<summary> ///Clear messages by user in Channel ///</summary> public void ClearMessages() { IRC_Functions.ClearUserMessages(ChannelName, Username); }