private void eliminarSaludoMod(ChatCommandRequest cmd) { List <TUserSaludo> ms = obternetSaludos(); ms.Remove(ms.Find(x => x.Name == cmd.argumentos[0])); escribirListaSaludos(ms); }
private void eliminarComando(ChatCommandRequest cmd) { List <ChatCommand> lc = obternetListaComandos(); lc.Remove(lc.Find(x => x.Key == cmd.argumentos[0])); escribirListaComandos(lc); }
private static string HTMLGeneratedIMG(ChatCommandRequest cmd) { return(@"<!DOCTYPE html> <html lang=""en"" xmlns=""http://www.w3.org/1999/xhtml"" > <head> <meta charset = ""utf-8"" /> <link href=""style.css"" rel=""stylesheet"" /> <link href=""https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.0/animate.min.css"" rel=""stylesheet"" /> <script src=""https://code.jquery.com/jquery-3.2.1.js""></script> <script type=""text/javascript""> $(document).ready(function() { setTimeout(function() { $("".content"").fadeOut(500); },12500); }) </script> <title></title> </head> <body> <div class=""content""> <img class=""animated rollIn"" width=""720"" height=""480"" src=""" + cmd.argumentos[0] + @""" /> </div> </body> </html>"); }
private void agregarComando(ChatCommandRequest cmd) { ChatCommand newCmd = newCommand(cmd); List <ChatCommand> lc = obternetListaComandos(); lc.Add(newCmd); escribirListaComandos(lc); }
private void agregarSaludoMod(ChatCommandRequest cmd) { TUserSaludo salud = obtenerSaludo(cmd); List <TUserSaludo> ms = obternetSaludos(); ms.Add(salud); escribirListaSaludos(ms); }
private static ChatCommand newCommand(ChatCommandRequest cmd) { return(new ChatCommand() { Key = cmd.argumentos[0], Value = cmd.Value.Substring(cmd.argumentos[0].Length + 1), argumentos = cmd.argumentos }); }
private void editarComando(ChatCommandRequest cmd) { ChatCommand newCmd = newCommand(cmd); List <ChatCommand> lc = obternetListaComandos(); lc.Remove(lc.Find(x => x.Key == newCmd.Key)); lc.Add(newCmd); escribirListaComandos(lc); }
private static TUserSaludo obtenerSaludo(ChatCommandRequest cmd) { TUserSaludo salud = new TUserSaludo(); salud.Name = cmd.argumentos[0]; salud.Channel = Channel; salud.Saludo = cmd.Value.Substring(cmd.argumentos[0].Length + 1); return(salud); }
private void commandRecived(OnMessageReceivedArgs e, out ChatCommandRequest cmd, out string[] arg) { cmd = new ChatCommandRequest(); arg = e.ChatMessage.Message.Split(" "); cmd.Key = arg[0]; cmd.Value = e.ChatMessage.Message.Replace(cmd.Key + " ", ""); cmd.argumentos = limpiarMensaje(e.ChatMessage.Message.Replace(cmd.Key + " ", "")).Split(" "); cmd.Channel = Channel; }
private void agregarTimer(ChatCommandRequest cmd) { MessageAlias timer = new MessageAlias(); timer.Time = int.Parse(cmd.argumentos[0]); if (cmd.argumentos[1].StartsWith('!')) { timer.command = listaComandos.Find(x => x.Key.Equals(cmd.argumentos[1])); } else { timer.value = cmd.Value.Substring(cmd.argumentos[0].Length + 1); } MessageAliasTimer timerT = new MessageAliasTimer(); timerT.Time = int.Parse(cmd.argumentos[0]); if (cmd.argumentos[1].StartsWith('!')) { timerT.command = listaComandos.Find(x => x.Key.Equals(cmd.argumentos[1])); } else { timerT.value = cmd.Value.Substring(cmd.argumentos[0].Length + 1); } timerT.aTimer.Interval = timerT.Time * 60000; timerT.aTimer.Elapsed += (sender, e) => { OnTimePass(timerT); }; timerT.aTimer.Enabled = true; timerT.Channel = Channel; listaTimers.Add(timerT); List <MessageAlias> mensages = obternetTimers <MessageAlias>(); mensages.Add(timer); escribirListaTimers(mensages); }
private void editarSaludoMod(ChatCommandRequest cmd) { eliminarSaludoMod(cmd); agregarSaludoMod(cmd); }
private void eliminarTimer(ChatCommandRequest cmd) { List <MessageAlias> mensages = obternetTimers <MessageAlias>(); }